Skip to content

Commit 4631eae

Browse files
committed
sum
1 parent c111744 commit 4631eae

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

opentelemetry-sdk/src/metrics/data/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ pub struct SumDataPoint<T> {
228228
/// time series.
229229
pub(crate) attributes: Vec<KeyValue>,
230230
/// The value of this data point.
231-
pub value: T,
231+
pub(crate) value: T,
232232
/// The sampled [Exemplar]s collected during the time series.
233233
pub(crate) exemplars: Vec<Exemplar<T>>,
234234
}

opentelemetry-stdout/src/metrics/exporter.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ fn print_metrics<'a>(metrics: impl Iterator<Item = &'a ScopeMetrics>) {
135135
}
136136
}
137137

138-
fn print_sum<T: Debug>(sum: &Sum<T>) {
138+
fn print_sum<T: Debug + Copy>(sum: &Sum<T>) {
139139
println!("\t\tSum DataPoints");
140140
println!("\t\tMonotonic : {}", sum.is_monotonic());
141141
if sum.temporality() == Temporality::Cumulative {
@@ -193,12 +193,12 @@ fn print_histogram<T: Debug + Copy>(histogram: &Histogram<T>) {
193193
print_hist_data_points(histogram.data_points());
194194
}
195195

196-
fn print_sum_data_points<'a, T: Debug + 'a>(
196+
fn print_sum_data_points<'a, T: Debug + Copy + 'a>(
197197
data_points: impl Iterator<Item = &'a SumDataPoint<T>>,
198198
) {
199199
for (i, data_point) in data_points.enumerate() {
200200
println!("\t\tDataPoint #{}", i);
201-
println!("\t\t\tValue : {:#?}", data_point.value);
201+
println!("\t\t\tValue : {:#?}", data_point.value());
202202
println!("\t\t\tAttributes :");
203203
for kv in data_point.attributes() {
204204
println!("\t\t\t\t -> {}: {}", kv.key, kv.value.as_str());

0 commit comments

Comments
 (0)