Package io.split.client.metrics
Class LogarithmicSearchLatencyTracker
- java.lang.Object
-
- io.split.client.metrics.LogarithmicSearchLatencyTracker
-
- All Implemented Interfaces:
ILatencyTracker
public class LogarithmicSearchLatencyTracker extends Object implements ILatencyTracker
Tracks latencies pero bucket of time. Each bucket represent a latency greater than the one before and each number within each bucket is a number of calls in the range. (1) 1.00 (2) 1.50 (3) 2.25 (4) 3.38 (5) 5.06 (6) 7.59 (7) 11.39 (8) 17.09 (9) 25.63 (10) 38.44 (11) 57.67 (12) 86.50 (13) 129.75 (14) 194.62 (15) 291.93 (16) 437.89 (17) 656.84 (18) 985.26 (19) 1,477.89 (20) 2,216.84 (21) 3,325.26 (22) 4,987.89 (23) 7,481.83 Thread-safety: This class is not thread safe. Created by patricioe on 2/10/16.
-
-
Constructor Summary
Constructors Constructor Description LogarithmicSearchLatencyTracker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLatencyMicros(long micros)Increment the internal counter for the bucket this latency falls into.voidaddLatencyMillis(long millis)Increment the internal counter for the bucket this latency falls into.voidclear()longgetBucketForLatencyMicros(long latency)Returns the counts in the bucket this latency falls into.longgetBucketForLatencyMillis(long latency)Returns the counts in the bucket this latency falls into.long[]getLatencies()Returns the list of latencies buckets as an array.longgetLatency(int index)
-
-
-
Method Detail
-
addLatencyMillis
public void addLatencyMillis(long millis)
Increment the internal counter for the bucket this latency falls into.- Specified by:
addLatencyMillisin interfaceILatencyTracker- Parameters:
millis-
-
addLatencyMicros
public void addLatencyMicros(long micros)
Increment the internal counter for the bucket this latency falls into.- Specified by:
addLatencyMicrosin interfaceILatencyTracker- Parameters:
micros-
-
getLatencies
public long[] getLatencies()
Returns the list of latencies buckets as an array.- Specified by:
getLatenciesin interfaceILatencyTracker- Returns:
- the list of latencies buckets as an array.
-
getLatency
public long getLatency(int index)
- Specified by:
getLatencyin interfaceILatencyTracker
-
clear
public void clear()
- Specified by:
clearin interfaceILatencyTracker
-
getBucketForLatencyMillis
public long getBucketForLatencyMillis(long latency)
Returns the counts in the bucket this latency falls into. The latencies will no be updated.- Specified by:
getBucketForLatencyMillisin interfaceILatencyTracker- Parameters:
latency-- Returns:
- the bucket content for the latency.
-
getBucketForLatencyMicros
public long getBucketForLatencyMicros(long latency)
Returns the counts in the bucket this latency falls into. The latencies will no be updated.- Specified by:
getBucketForLatencyMicrosin interfaceILatencyTracker- Parameters:
latency-- Returns:
- the bucket content for the latency.
-
-