Skip to content

Commit cb79af0

Browse files
Apply suggestions
1 parent 3b5fba7 commit cb79af0

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

data-pipeline/src/telemetry/mod.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,34 @@ mod tests {
611611
)
612612
}
613613

614+
#[test]
615+
fn telemetry_from_send_data_result_test() {
616+
let result = SendDataResult {
617+
requests_count: 10,
618+
responses_count_per_code: HashMap::from([(200, 3)]),
619+
errors_timeout: 1,
620+
errors_network: 2,
621+
errors_status_code: 3,
622+
bytes_sent: 4,
623+
chunks_sent: 5,
624+
chunks_dropped: 6,
625+
..Default::default()
626+
};
627+
628+
let expected_telemetry = SendPayloadTelemetry {
629+
requests_count: 10,
630+
errors_network: 2,
631+
errors_timeout: 1,
632+
errors_status_code: 3,
633+
bytes_sent: 4,
634+
chunks_sent: 5,
635+
chunks_dropped: 6,
636+
responses_count_per_code: HashMap::from([(200, 3)]),
637+
};
638+
639+
assert_eq!(SendPayloadTelemetry::from(&result), expected_telemetry)
640+
}
641+
614642
#[cfg_attr(miri, ignore)]
615643
#[tokio::test]
616644
async fn runtime_id_test() {

data-pipeline/src/trace_exporter/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,8 @@ impl TraceExporter {
657657
if let Some(telemetry) = &self.telemetry {
658658
if let Err(e) = telemetry.send(&SendPayloadTelemetry::from_retry_result(
659659
&result,
660-
payload_len.try_into().unwrap_or(0),
661-
chunks.try_into().unwrap_or(0),
660+
payload_len as u64,
661+
chunks as u64,
662662
)) {
663663
error!("Error sending telemetry: {}", e.to_string());
664664
}

0 commit comments

Comments
 (0)