Skip to content

Commit 069181e

Browse files
author
Mindaugas Vinkelis
committed
Add comments in which temporality mode specific collect functions should be used
1 parent 8d56bd2 commit 069181e

File tree

1 file changed

+3
-1
lines changed
  • opentelemetry-sdk/src/metrics/internal

1 file changed

+3
-1
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ where
141141
}
142142

143143
/// Iterate through all attribute sets and populate `DataPoints` in readonly mode.
144+
/// This is used in Cumulative temporality mode, where [`ValueMap`] is not cleared.
144145
pub(crate) fn collect_readonly<Res, MapFn>(&self, dest: &mut Vec<Res>, mut map_fn: MapFn)
145146
where
146147
MapFn: FnMut(Vec<KeyValue>, &A) -> Res,
@@ -162,7 +163,8 @@ where
162163
}
163164
}
164165

165-
/// Iterate through all attribute sets, populate `DataPoints` and and reset.
166+
/// Iterate through all attribute sets, populate `DataPoints` and reset.
167+
/// This is used in Delta temporality mode, where [`ValueMap`] is reset after collection.
166168
pub(crate) fn collect_and_reset<Res, MapFn>(&self, dest: &mut Vec<Res>, mut map_fn: MapFn)
167169
where
168170
MapFn: FnMut(Vec<KeyValue>, A) -> Res,

0 commit comments

Comments
 (0)