This class is *not thread-safe*, safe consumption in a multi-threaded environment will require some form of external locking.
| Modifier and Type | Field and Description |
|---|---|
| private long[] | |
| private static final long[] | |
| private final double | |
| private int[] | |
| private long | |
| private final int | |
| private long | |
| private final long |
| Access | Constructor and Description |
|---|---|
| public | ExponentialHistogram(double
fractional accuracy epsilon, long sliding window size window)Creates an exponential histogram maintaining a count over |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| private long[] | |
| private void | |
| public double | |
| public long | |
| private void | |
| public void | |
| public void | |
| private static int[] | |
| private long[] | |
| private int | |
| public void | merge(ExponentialHistogram
histogram to merge b)Merge the supplied ExponentialHistogram in to this one. |
| private void | |
| private static long[] | |
| private int | |
| private long[] | |
| private static int | |
| private static int | |
| public ExponentialHistogram | Returns: the new histogramsplitting fraction fraction)Split an exponential histogram off this one. |
| private static int[] | |
| public String | |
| private void |
| boxes | back to summary |
|---|---|
| private long[] boxes | |
| EMPTY_LONG_ARRAY | back to summary |
|---|---|
| private static final long[] EMPTY_LONG_ARRAY | |
| epsilon | back to summary |
|---|---|
| private final double epsilon | |
| insert | back to summary |
|---|---|
| private int[] insert | |
| last | back to summary |
|---|---|
| private long last | |
| mergeThreshold | back to summary |
|---|---|
| private final int mergeThreshold | |
| total | back to summary |
|---|---|
| private long total | |
| window | back to summary |
|---|---|
| private final long window | |
| ExponentialHistogram | back to summary |
|---|---|
| public ExponentialHistogram(double epsilon, long window) Creates an exponential histogram maintaining a count over
| |
| ExponentialHistogram | back to summary |
|---|---|
| private ExponentialHistogram(double epsilon, int mergeThreshold, long window, int initialSize) | |
| count | back to summary |
|---|---|
| public long count() Returns the approximate current count.
| |
| doubleUp | back to summary |
|---|---|
| private long[] doubleUp(long[] a) | |
| ensureCapacity | back to summary |
|---|---|
| private void ensureCapacity(int logSize) | |
| epsilon | back to summary |
|---|---|
| public double epsilon() Return the fractional accuracy of this exponential histogram
| |
| expire | back to summary |
|---|---|
| public long expire(long time) Expire old events.
| |
| initializeArrays | back to summary |
|---|---|
| private void initializeArrays(int logMax) | |
| insert | back to summary |
|---|---|
| public void insert(long time, long count) throws IllegalArgumentException Bulk insert
| |
| insert | back to summary |
|---|---|
| public void insert(long time) Insert a single event at
| |
| lCanonical | back to summary |
|---|---|
| private static int[] lCanonical(int l, long count) | |
| makeBoxes | back to summary |
|---|---|
| private long[] makeBoxes(long time, long count) | |
| max_l | back to summary |
|---|---|
| private int max_l(int logSize) | |
| merge | back to summary |
|---|---|
| public void merge(ExponentialHistogram b) Merge the supplied ExponentialHistogram in to this one.
| |
| merge | back to summary |
|---|---|
| private void merge(long[] bBoxes, long bTotal) | |
| merge | back to summary |
|---|---|
| private static long[] merge(long[] a, long[] b, int min, int max, long[] c) | |
| min_l | back to summary |
|---|---|
| private int min_l(int logSize) | |
| pull | back to summary |
|---|---|
| private long[] pull(long[] originalBoxes, int logSize, int count) | |
| reverseSort | back to summary |
|---|---|
| private static int reverseSort(long[] a) | |
| reverseSort | back to summary |
|---|---|
| private static int reverseSort(long[] a, int fromIndex, int toIndex) | |
| split | back to summary |
|---|---|
| public ExponentialHistogram split(double fraction) Split an exponential histogram off this one. The returned histogram will contain {code fraction} of the events in this one.
| |
| tailedLCanonical | back to summary |
|---|---|
| private static int[] tailedLCanonical(int l, long count) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| transfer | back to summary |
|---|---|
| private void transfer(long[] originalBoxes, long[] targetBoxes, int logSize, int count) | |