File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -344,6 +344,11 @@ impl<T: Counter> Histogram<T> {
344
344
self . bucket_count
345
345
}
346
346
347
+ /// Returns true if this histogram is currently able to auto-resize as new samples are recorded.
348
+ pub fn is_auto_resize ( & self ) -> bool {
349
+ self . auto_resize
350
+ }
351
+
347
352
// ********************************************************************************************
348
353
// Methods for looking up the count for a given value/index
349
354
// ********************************************************************************************
Original file line number Diff line number Diff line change @@ -48,3 +48,12 @@ fn autosizing_across_continuous_range() {
48
48
histogram += i;
49
49
}
50
50
}
51
+
52
+ #[ test]
53
+ fn can_acess_autoresize_setting ( ) {
54
+ let mut histogram = Histogram :: < u64 > :: new ( 2 ) . unwrap ( ) ;
55
+ assert ! ( histogram. is_auto_resize( ) ) ;
56
+
57
+ histogram. auto ( false ) ;
58
+ assert ! ( !histogram. is_auto_resize( ) ) ;
59
+ }
You can’t perform that action at this time.
0 commit comments