com.neeve.stats
Class Stats.LatencyManager

java.lang.Object
  extended by com.neeve.stats.Stats.LatencyManager
All Implemented Interfaces:
IStats.Latencies, IStats.Series
Enclosing class:
Stats

public static final class Stats.LatencyManager
extends Object
implements IStats.Latencies

Class used to hold and compute and retrieve latencies statistics.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.neeve.stats.IStats.Series
IStats.Series.Collector, IStats.Series.Type
 
Field Summary
 
Fields inherited from interface com.neeve.stats.IStats.Latencies
PROP_LATENCY_MANAGER_SAMPLE_SIZE
 
Fields inherited from interface com.neeve.stats.IStats.Series
PROP_SERIES_SAMPLE_SIZE, PROP_SERIES_SAMPLE_SIZE_DEFAULT
 
Constructor Summary
Stats.LatencyManager(String name)
          Construct using name to describe the latencies stored
Stats.LatencyManager(String name, int sampleSize)
          Construct using name to describe the latencies stored
 
Method Summary
 long add(double val)
          Add a latency to the latency sample set
 void compute()
          Compute latency statistics.
 void compute(double multiplier)
          Compute latency statistics.
 long count()
          Get the number of latency entries added so far
 long get(IStats.Series.Collector collector, cern.colt.list.DoubleArrayList temp, long minSeqNo)
          Collects currently captured data points into the provide IStats.Series.Collector.
 void get(StringBuilder sb)
          Format stats for output
 void get(StringBuilder sb, boolean csv)
          Format stats for output
 void get(StringBuilder sb, NumberFormat format)
          Appends the counter value and any computed stats calculated by compute() to the provided StringBuilder.
 String getName()
          Gets statistic name.
 XString getNameAsRaw()
          Gets the stat's name as an XString.
 IStats.Series.Type getType()
          Gets the underlying type for the Series.
 double max()
          Implementation of IStats.Series.max()
 double mean()
          Implementation of IStats.Series.mean()
 double median()
          Implementation of IStats.Series.median()
 double min()
          Implementation of IStats.Series.min()
 double pct75()
          Implementation of IStats.Series.pct75()
 double pct90()
          Implementation of IStats.Series.pct90()
 double pct99()
          Implementation of IStats.Series.pct99()
 double pct999()
          Implementation of IStats.Series.pct999()
 double pct9999()
          Implementation of IStats.Series.pct9999()
 void reset()
          Reset the latency list.
 long sample()
          Implementation of IStats.Series.sample()
 long sequenceNumber()
          Gets the sequence number of the last recorded value.
 int size()
          Returns the maximum sample size of latencies that can be held.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Stats.LatencyManager

public Stats.LatencyManager(String name)
Construct using name to describe the latencies stored


Stats.LatencyManager

public Stats.LatencyManager(String name,
                            int sampleSize)
Construct using name to describe the latencies stored

Method Detail

getName

public final String getName()
Description copied from interface: IStats.Series
Gets statistic name.

Specified by:
getName in interface IStats.Series
Returns:
The statistic name

getNameAsRaw

public final XString getNameAsRaw()
Description copied from interface: IStats.Series
Gets the stat's name as an XString.

Specified by:
getNameAsRaw in interface IStats.Series
Returns:
The statistic name in raw form

getType

public final IStats.Series.Type getType()
Description copied from interface: IStats.Series
Gets the underlying type for the Series.

The IStats.Series.Type indicates what primitive types to which the values returned by the Series can be safely cast.

Specified by:
getType in interface IStats.Series
Returns:
The IStats.Series's IStats.Series.Type.

sequenceNumber

public final long sequenceNumber()
Description copied from interface: IStats.Series
Gets the sequence number of the last recorded value.

Specified by:
sequenceNumber in interface IStats.Series

add

public final long add(double val)
Add a latency to the latency sample set

Specified by:
add in interface IStats.Series
Parameters:
val - the sampled value to record.
Returns:
the sequence number of the element added.

compute

public final void compute()
Compute latency statistics.

Specified by:
compute in interface IStats.Series

compute

public final void compute(double multiplier)
Compute latency statistics.


count

public final long count()
Get the number of latency entries added so far


reset

public final void reset()
Reset the latency list.

Specified by:
reset in interface IStats.Series

get

public final void get(StringBuilder sb,
                      boolean csv)
Format stats for output


get

public final void get(StringBuilder sb)
Format stats for output


get

public final void get(StringBuilder sb,
                      NumberFormat format)
Appends the counter value and any computed stats calculated by compute() to the provided StringBuilder.

Specified by:
get in interface IStats.Series

size

public final int size()
Returns the maximum sample size of latencies that can be held.

Specified by:
size in interface IStats.Series
Returns:
The number of elements this latency manager can hold.

sample

public final long sample()
Implementation of IStats.Series.sample()

Specified by:
sample in interface IStats.Series
Returns:
The number of samples over which the current values have been computed.

min

public final double min()
Implementation of IStats.Series.min()

Specified by:
min in interface IStats.Series
Returns:
the minimum value captured.

max

public final double max()
Implementation of IStats.Series.max()

Specified by:
max in interface IStats.Series
Returns:
the maximum value captured.

mean

public final double mean()
Implementation of IStats.Series.mean()

Specified by:
mean in interface IStats.Series
Returns:
the mean value.

median

public final double median()
Implementation of IStats.Series.median()

Specified by:
median in interface IStats.Series
Returns:
the median latency.

pct75

public final double pct75()
Implementation of IStats.Series.pct75()

Specified by:
pct75 in interface IStats.Series
Returns:
the 75 percentile value.

pct90

public final double pct90()
Implementation of IStats.Series.pct90()

Specified by:
pct90 in interface IStats.Series
Returns:
the 90 percentile value.

pct99

public final double pct99()
Implementation of IStats.Series.pct99()

Specified by:
pct99 in interface IStats.Series
Returns:
the 99 percentile value.

pct999

public final double pct999()
Implementation of IStats.Series.pct999()

Specified by:
pct999 in interface IStats.Series
Returns:
the 99.9 percentile value.

pct9999

public final double pct9999()
Implementation of IStats.Series.pct9999()

Specified by:
pct9999 in interface IStats.Series
Returns:
the 99.99 percentile value.

get

public long get(IStats.Series.Collector collector,
                cern.colt.list.DoubleArrayList temp,
                long minSeqNo)
Description copied from interface: IStats.Series
Collects currently captured data points into the provide IStats.Series.Collector.

Specified by:
get in interface IStats.Series
Parameters:
collector - The collector to which values will be collected via IStats.Series.Collector.add(long, double)
temp - A temporary list into which collected values will be copied.
minSeqNo - The minimum sequence number (inclusive) to collect.
Returns:
the sequence number of the first element reported or -1 if minSequenceNumber is greater than the current series sequence number


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.