public abstract class Stats extends Object implements IStats
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)
.
Modifier and Type | Class and Description |
---|---|
static interface |
Stats.IAlertListener
Callback for receiving Stats alerts.
|
static class |
Stats.LatencyManager
Class used to hold and compute and retrieve latencies statistics.
|
IStats.Counter, IStats.Gauge, IStats.Latencies, IStats.Series
Modifier and Type | Method and Description |
---|---|
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) . |
public final String getType()
getType()
.getType
in interface IStats
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.
IStats.getName()
,
StatsRegistry
public final String getName()
getName()
.getName
in interface IStats
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.
IStats.getType()
,
StatsRegistry
public final String getLogger()
getLogger()
.getLogger
in interface IStats
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.
public final void startPeriodicOutput(int interval)
startPeriodicOutput(int)
.startPeriodicOutput
in interface IStats
interval
- The periodic interval, in seconds, at which the
statistics information is output.public final void stopPeriodicOutput()
startPeriodicOutput(int)
.stopPeriodicOutput
in interface IStats
Copyright © 2019 Neeve Research, LLC. All Rights Reserved.