Skip to content

Commit

Permalink
Add comments in which temporality mode specific collect functions sho…
Browse files Browse the repository at this point in the history
…uld be used
  • Loading branch information
fraillt authored and Mindaugas Vinkelis committed Nov 3, 2024
1 parent 8d56bd2 commit 66cb25a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion opentelemetry-sdk/src/metrics/internal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ where
}

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

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

0 comments on commit 66cb25a

Please sign in to comment.