Skip to content

Commit 3b71146

Browse files
authored
feat(metrics-util): Add sum() method to Summary (#650)
Signed-off-by: Michel Heily <[email protected]>
1 parent 9a889d0 commit 3b71146

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

metrics-util/src/storage/summary.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ impl Summary {
145145
self.sketch.count()
146146
}
147147

148+
/// Returns the sum of values seen, or None if empty
149+
pub fn sum(&self) -> Option<f64> {
150+
self.sketch.sum()
151+
}
152+
148153
/// Gets the estimized size of this summary, in bytes.
149154
///
150155
/// In practice, this value should be very close to the actual size, but will not be entirely

0 commit comments

Comments
 (0)