com.neeve.stats
Class StatsFactory

java.lang.Object
  extended by com.neeve.stats.StatsFactory

public class StatsFactory
extends Object

Factory class for creating IStats.


Constructor Summary
StatsFactory()
           
 
Method Summary
static IStats.Counter createCounterStat(String name)
          Creates a new IStats.Counter stat collector.
static IStats.Latencies createLatencyStat(String name)
          Creates a new IStats.Latencies stat collector.
static IStats.Latencies createLatencyStat(String name, int maxSampleSize)
          Creates a new IStats.Latencies stat collector that can accomodate up to maxSampleSize recorded latencies per sample without loss of information.
static IStats.Series createSeriesStat(String name)
          Creates a new IStats.Series stat collector.
static IStats.Series createSeriesStat(String name, int maxSampleSize)
          Creates a new IStats.Series stat collector that can accomodate up to maxSampleSize recorded values per sample without loss of information.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatsFactory

public StatsFactory()
Method Detail

createLatencyStat

public static final IStats.Latencies createLatencyStat(String name)
Creates a new IStats.Latencies stat collector. The maximum sample size of the collected latencies is governed by the environment paramater IStats.Latencies.PROP_LATENCY_MANAGER_SAMPLE_SIZE. When not set the default then it is governed by IStats.Series.PROP_SERIES_SAMPLE_SIZE.

This call is equivalent to call createLatencyStat(String, int) with a maxSampleSize of XRuntime.getValue(String) with a value of IStats.Latencies.PROP_LATENCY_MANAGER_SAMPLE_SIZE

Parameters:
name - The name of the latency stat.
Returns:
A IStats.Latencies collector with the default maximum sample size.

createLatencyStat

public static final IStats.Latencies createLatencyStat(String name,
                                                       int maxSampleSize)
Creates a new IStats.Latencies stat collector that can accomodate up to maxSampleSize recorded latencies per sample without loss of information. To record latencies at a rate of R samples per second and a sampling interval of S seconds without loss the sample size must be R * S. For example, if recording message latencies where the peak rate is expected to be 2000 messages per second and the stats sampling interval is 4 seconds, then a maxSampleSize of 8000 should be used to hold all of the recorded latencies.

The returned Latencies stat can accept a max value of of Integer.MAX_VALUE.

Parameters:
name - The name of the latency stat.
maxSampleSize - The maximum sample size.
Returns:
A IStats.Latencies collector with the provided maximum sample size.

createSeriesStat

public static final IStats.Series createSeriesStat(String name)
Creates a new IStats.Series stat collector. The maximum sample size of the collected latencies is governed by the environment paramater IStats.Series.PROP_SERIES_SAMPLE_SIZE.

Parameters:
name - The name of the latency stat.
Returns:
A IStats.Latencies collector with the default maximum sample size.

createSeriesStat

public static final IStats.Series createSeriesStat(String name,
                                                   int maxSampleSize)
Creates a new IStats.Series stat collector that can accomodate up to maxSampleSize recorded values per sample without loss of information. To record data points at a rate of R samples per second and a sampling interval of S seconds without loss, the sample size must be R * S. For example, if recording message sizes where the peak rate is expected to be 2000 messages per second and the stats sampling interval is 4 seconds, then a maxSampleSize of 8000 should be used to hold all of the recorded size.

Parameters:
name - The name of the series stat.
maxSampleSize - The maximum sample size.
Returns:
A IStats.Series collector with the provided maximum sample size.

createCounterStat

public static final IStats.Counter createCounterStat(String name)
Creates a new IStats.Counter stat collector. A counter stat holds a monotonically increase count that can be collected. A counter can be used to track a simple count or to compute derivitive stats sucha as a rate based on delta values over time.



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