com.neeve.stats
Class Stats

java.lang.Object
  extended by com.neeve.stats.Stats
All Implemented Interfaces:
IStats
Direct Known Subclasses:
AepBusManagerStats

public abstract class Stats
extends Object
implements IStats

Root statistic class.

This class serves as the root class for all classes that export statistics information. This class implements the IStats interface that not only serves as the root interface for all interfaces used to gather statistical information but also specifies the interface used to start and stop the periodic output of statistical information.

The startPeriodicOutput(int) method starts a new thread that periodically invokes the IStats.get(java.lang.StringBuilder) abstract method to get output statistics that is output using a tracer object private to this class that is bound to a logger specified by the derived class during construction. stopPeriodicOutput() is used to stop the periodic out put of statistical info. It terminates the thread started by startPeriodicOutput(int).

Threading:
This class is not safe for concurrent access by multiple threads.

Nested Class Summary
static interface Stats.IAlertListener
          Callback for receiving Stats alerts.
static class Stats.LatencyManager
          Class used to hold and compute and retrieve latencies statistics.
 
Nested classes/interfaces inherited from interface com.neeve.stats.IStats
IStats.Counter, IStats.Gauge, IStats.Latencies, IStats.Series
 
Method Summary
 void close()
          Implementation of close().
 String getLogger()
          Implementation of getLogger().
 String getName()
          Implementation of getName().
 String getType()
          Implementation of getType().
 void startPeriodicOutput(int interval)
          Implementation of startPeriodicOutput(int).
 void stopPeriodicOutput()
          Implementation of startPeriodicOutput(int).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.neeve.stats.IStats
get
 

Method Detail

getType

public final String getType()
Implementation of getType().

Specified by:
getType in interface IStats
Returns:
Returns the type of the statistics object.

Each statistics object in a Neeve application is of a specific type Objects of the same type export the same statistics information and can be accessed using the same interface. This method returns the type of a statistics object. A statistics objects name and type are used to construct the name that uniquely identifies the object in the statistics registry.

See Also:
IStats.getName(), StatsRegistry

getName

public final String getName()
Implementation of getName().

Specified by:
getName in interface IStats
Returns:
Returns the name of the statistics object.

Each statistics object in a Neeve application is uniquely identified by a name within its type. This method returns the name of a statistics object. A statistics objects name and type are used to construct the name that uniquely identifies the object in the statistics registry.

See Also:
IStats.getType(), StatsRegistry

getLogger

public final String getLogger()
Implementation of getLogger().

Specified by:
getLogger in interface IStats
Returns:
Returns the name of the logger.

Each statistics object contains a tracer object used by the outputter thread started by IStats.startPeriodicOutput(int). The tracer object is bound to the logger whose name is returned by this method. The user can configure the logger with the name returned from this method to redirect the statistics output to a destination of choice.


startPeriodicOutput

public final void startPeriodicOutput(int interval)
Implementation of startPeriodicOutput(int).

Specified by:
startPeriodicOutput in interface IStats
Parameters:
interval - The periodic interval, in seconds, at which the statistics information is output.

stopPeriodicOutput

public final void stopPeriodicOutput()
Implementation of startPeriodicOutput(int).

Specified by:
stopPeriodicOutput in interface IStats

close

public final void close()
Implementation of close().

Specified by:
close in interface IStats


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