File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -455,6 +455,14 @@ impl HistoricalBucketRangeTracker {
455
455
//
456
456
// In total, this allows us to track data for the last 8,000 or so payments across a given
457
457
// channel.
458
+ //
459
+ // These constants are a balance - we try to fit in 2 bytes per bucket to reduce overhead,
460
+ // and need to balance having more bits in the decimal part (to ensure decay isn't too
461
+ // step-wise) with having too few bits in the mantissa, causing us to not store very many
462
+ // datapoints.
463
+ //
464
+ // The constants were picked experimentally, selecting a decay amount that restricts us
465
+ // from overflowing buckets without having to cap them manually.
458
466
debug_assert ! ( bucket < 8 ) ;
459
467
if let Some ( v) = self . buckets . get_mut ( bucket as usize ) {
460
468
* v = v. saturating_add ( 32 ) ;
You can’t perform that action at this time.
0 commit comments