Skip to content
64 changes: 32 additions & 32 deletions opentelemetry-proto/src/transform/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,19 @@
.data_points()
.map(|dp| TonicHistogramDataPoint {
attributes: dp.attributes().map(Into::into).collect(),
start_time_unix_nano: to_nanos(hist.start_time),
time_unix_nano: to_nanos(hist.time),
count: dp.count,
sum: Some(dp.sum.into_f64()),
start_time_unix_nano: to_nanos(hist.start_time()),
time_unix_nano: to_nanos(hist.time()),
count: dp.count(),
sum: Some(dp.sum().into_f64()),

Check warning on line 221 in opentelemetry-proto/src/transform/metrics.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-proto/src/transform/metrics.rs#L218-L221

Added lines #L218 - L221 were not covered by tests
bucket_counts: dp.bucket_counts().collect(),
explicit_bounds: dp.bounds().collect(),
exemplars: dp.exemplars().map(Into::into).collect(),
flags: TonicDataPointFlags::default() as u32,
min: dp.min.map(Numeric::into_f64),
max: dp.max.map(Numeric::into_f64),
min: dp.min().map(Numeric::into_f64),
max: dp.max().map(Numeric::into_f64),

Check warning on line 227 in opentelemetry-proto/src/transform/metrics.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-proto/src/transform/metrics.rs#L226-L227

Added lines #L226 - L227 were not covered by tests
})
.collect(),
aggregation_temporality: TonicTemporality::from(hist.temporality).into(),
aggregation_temporality: TonicTemporality::from(hist.temporality()).into(),

Check warning on line 230 in opentelemetry-proto/src/transform/metrics.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-proto/src/transform/metrics.rs#L230

Added line #L230 was not covered by tests
}
}
}
Expand All @@ -242,28 +242,28 @@
.data_points()
.map(|dp| TonicExponentialHistogramDataPoint {
attributes: dp.attributes().map(Into::into).collect(),
start_time_unix_nano: to_nanos(hist.start_time),
time_unix_nano: to_nanos(hist.time),
count: dp.count as u64,
sum: Some(dp.sum.into_f64()),
scale: dp.scale.into(),
zero_count: dp.zero_count,
start_time_unix_nano: to_nanos(hist.start_time()),
time_unix_nano: to_nanos(hist.time()),
count: dp.count() as u64,
sum: Some(dp.sum().into_f64()),
scale: dp.scale().into(),
zero_count: dp.zero_count(),

Check warning on line 250 in opentelemetry-proto/src/transform/metrics.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-proto/src/transform/metrics.rs#L245-L250

Added lines #L245 - L250 were not covered by tests
positive: Some(TonicBuckets {
offset: dp.positive_bucket.offset,
bucket_counts: dp.positive_bucket.counts.clone(),
offset: dp.positive_bucket().offset(),
bucket_counts: dp.positive_bucket().counts().collect(),

Check warning on line 253 in opentelemetry-proto/src/transform/metrics.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-proto/src/transform/metrics.rs#L252-L253

Added lines #L252 - L253 were not covered by tests
}),
negative: Some(TonicBuckets {
offset: dp.negative_bucket.offset,
bucket_counts: dp.negative_bucket.counts.clone(),
offset: dp.negative_bucket().offset(),
bucket_counts: dp.negative_bucket().counts().collect(),

Check warning on line 257 in opentelemetry-proto/src/transform/metrics.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-proto/src/transform/metrics.rs#L256-L257

Added lines #L256 - L257 were not covered by tests
}),
flags: TonicDataPointFlags::default() as u32,
exemplars: dp.exemplars().map(Into::into).collect(),
min: dp.min.map(Numeric::into_f64),
max: dp.max.map(Numeric::into_f64),
zero_threshold: dp.zero_threshold,
min: dp.min().map(Numeric::into_f64),
max: dp.max().map(Numeric::into_f64),
zero_threshold: dp.zero_threshold(),

Check warning on line 263 in opentelemetry-proto/src/transform/metrics.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-proto/src/transform/metrics.rs#L261-L263

Added lines #L261 - L263 were not covered by tests
})
.collect(),
aggregation_temporality: TonicTemporality::from(hist.temporality).into(),
aggregation_temporality: TonicTemporality::from(hist.temporality()).into(),

Check warning on line 266 in opentelemetry-proto/src/transform/metrics.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-proto/src/transform/metrics.rs#L266

Added line #L266 was not covered by tests
}
}
}
Expand All @@ -278,15 +278,15 @@
.data_points()
.map(|dp| TonicNumberDataPoint {
attributes: dp.attributes().map(Into::into).collect(),
start_time_unix_nano: to_nanos(sum.start_time),
time_unix_nano: to_nanos(sum.time),
start_time_unix_nano: to_nanos(sum.start_time()),
time_unix_nano: to_nanos(sum.time()),

Check warning on line 282 in opentelemetry-proto/src/transform/metrics.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-proto/src/transform/metrics.rs#L281-L282

Added lines #L281 - L282 were not covered by tests
exemplars: dp.exemplars().map(Into::into).collect(),
flags: TonicDataPointFlags::default() as u32,
value: Some(dp.value.into()),
value: Some(dp.value().into()),

Check warning on line 285 in opentelemetry-proto/src/transform/metrics.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-proto/src/transform/metrics.rs#L285

Added line #L285 was not covered by tests
})
.collect(),
aggregation_temporality: TonicTemporality::from(sum.temporality).into(),
is_monotonic: sum.is_monotonic,
aggregation_temporality: TonicTemporality::from(sum.temporality()).into(),
is_monotonic: sum.is_monotonic(),

Check warning on line 289 in opentelemetry-proto/src/transform/metrics.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-proto/src/transform/metrics.rs#L288-L289

Added lines #L288 - L289 were not covered by tests
}
}
}
Expand All @@ -301,11 +301,11 @@
.data_points()
.map(|dp| TonicNumberDataPoint {
attributes: dp.attributes().map(Into::into).collect(),
start_time_unix_nano: gauge.start_time.map(to_nanos).unwrap_or_default(),
time_unix_nano: to_nanos(gauge.time),
start_time_unix_nano: gauge.start_time().map(to_nanos).unwrap_or_default(),
time_unix_nano: to_nanos(gauge.time()),

Check warning on line 305 in opentelemetry-proto/src/transform/metrics.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-proto/src/transform/metrics.rs#L304-L305

Added lines #L304 - L305 were not covered by tests
exemplars: dp.exemplars().map(Into::into).collect(),
flags: TonicDataPointFlags::default() as u32,
value: Some(dp.value.into()),
value: Some(dp.value().into()),

Check warning on line 308 in opentelemetry-proto/src/transform/metrics.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-proto/src/transform/metrics.rs#L308

Added line #L308 was not covered by tests
})
.collect(),
}
Expand All @@ -322,9 +322,9 @@
.filtered_attributes()
.map(|kv| (&kv.key, &kv.value).into())
.collect(),
time_unix_nano: to_nanos(ex.time),
span_id: ex.span_id.into(),
trace_id: ex.trace_id.into(),
time_unix_nano: to_nanos(ex.time()),
span_id: ex.span_id().into(),
trace_id: ex.trace_id().into(),

Check warning on line 327 in opentelemetry-proto/src/transform/metrics.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-proto/src/transform/metrics.rs#L325-L327

Added lines #L325 - L327 were not covered by tests
value: Some(ex.value.into()),
}
}
Expand Down
Loading