public class MutableLongStats extends Object implements java.util.function.LongConsumer, SerializableStats<LongStats>
| Constructor and Description |
|---|
MutableLongStats(long... distribution)
Note: do not use distribution when
accept(long) frequency is in nanos ( <<< 1 millis). |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(long value) |
LongStats |
get() |
LongStats |
getValueForSerialization()
Returns the value that will be passed to Gson for serialising the stats.
|
void |
merge(LongStats longStats) |
void |
reset() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitandThenpublic MutableLongStats(long... distribution)
accept(long) frequency is in nanos ( <<< 1 millis).distribution - is a list of long values, which are used to create distribution ranges for the long values
consumed by this MutableLongStats via accept(long). For example::
if you pass in the following params: (1, 10, 100), the distributionStats map will contain
the following entries:
accept(long) long values in range: (-infinity, 1L]accept(long) long values in range: (1L, 10L]accept(long) long values in range: (10L, 100L]LongStats.MAX_DISTRIBUTION, value: counter of all accepted accept(long) long values in range: (100L, +infinity)public void accept(long value)
accept in interface java.util.function.LongConsumerpublic LongStats get()
public LongStats getValueForSerialization()
SerializableStatsgetValueForSerialization in interface SerializableStats<LongStats>public void reset()
public void merge(LongStats longStats)
Copyright © 2002-2024 Atlassian. All Rights Reserved.