Package org.apache.jackrabbit.stats
Class TimeSeriesRecorder
- java.lang.Object
-
- org.apache.jackrabbit.stats.TimeSeriesRecorder
-
- All Implemented Interfaces:
TimeSeries
public class TimeSeriesRecorder extends Object implements TimeSeries
Recorder of a time series. An instance of this class records (and clears) the state of a givenAtomicLong
counter once every second and exposes the collected time series through theTimeSeries
interface.
-
-
Constructor Summary
Constructors Constructor Description TimeSeriesRecorder(boolean resetValueEachSecond)
Same asTimeSeriesRecorder(boolean, long)
passing long for the 2nd argumentTimeSeriesRecorder(boolean resetValueEachSecond, long missingValue)
TimeSeriesRecorder(RepositoryStatistics.Type type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AtomicLong
getCounter()
Returns theAtomicLong
instance used to measure the value for the time series.long
getMissingValue()
long[]
getValuePerHour()
long[]
getValuePerMinute()
long[]
getValuePerSecond()
long[]
getValuePerWeek()
void
recordOneSecond()
Records the number of measured values over the past second and resets the counter.
-
-
-
Constructor Detail
-
TimeSeriesRecorder
public TimeSeriesRecorder(RepositoryStatistics.Type type)
-
TimeSeriesRecorder
public TimeSeriesRecorder(boolean resetValueEachSecond)
Same asTimeSeriesRecorder(boolean, long)
passing long for the 2nd argument- Parameters:
resetValueEachSecond
- Whether to reset value each second
-
TimeSeriesRecorder
public TimeSeriesRecorder(boolean resetValueEachSecond, long missingValue)
- Parameters:
resetValueEachSecond
- Whether to reset value each secondmissingValue
- The value used to encode missing values
-
-
Method Detail
-
getCounter
public AtomicLong getCounter()
Returns theAtomicLong
instance used to measure the value for the time series.- Returns:
- value
-
recordOneSecond
public void recordOneSecond()
Records the number of measured values over the past second and resets the counter. This method should be scheduled to be called once per second.
-
getMissingValue
public long getMissingValue()
- Specified by:
getMissingValue
in interfaceTimeSeries
-
getValuePerSecond
public long[] getValuePerSecond()
- Specified by:
getValuePerSecond
in interfaceTimeSeries
-
getValuePerMinute
public long[] getValuePerMinute()
- Specified by:
getValuePerMinute
in interfaceTimeSeries
-
getValuePerHour
public long[] getValuePerHour()
- Specified by:
getValuePerHour
in interfaceTimeSeries
-
getValuePerWeek
public long[] getValuePerWeek()
- Specified by:
getValuePerWeek
in interfaceTimeSeries
-
-