Package org.infinispan.extendedstats
Class CacheStatisticCollector
java.lang.Object
org.infinispan.extendedstats.CacheStatisticCollector
Collects and maintains all the statistics for a cache.
- Since:
- 6.0
- Author:
- Roberto Palmieri, Sebastiano Peluso, Diego Didona, Pedro Ruivo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddLocalValue(ExtendedStatistic stat, double value) Adds a value to a local statistic.final voidaddRemoteValue(ExtendedStatistic stat, double value) Adds a value to a remote statistic.static doubleconvertNanosToMicro(double nanos) static doubleconvertNanosToSeconds(double nanos) final voiddumpTo(PrintWriter writer) Prints the cache statistics values to aPrintStream.final voiddumpTo(StringBuilder builder) Dumps all the cache statistic values to aStringBuilderfinal doublefinal doublegetPercentile(PercentileStatistic stat, int percentile) final voidmerge(TransactionStatistics transactionStatistics) Merges a transaction statistics in this cache statistics.final voidreset()reset all the statistics collected so far.
-
Constructor Details
-
CacheStatisticCollector
-
-
Method Details
-
reset
public final void reset()reset all the statistics collected so far. -
merge
Merges a transaction statistics in this cache statistics. -
addLocalValue
Adds a value to a local statistic. This value is not associated with any transaction. -
addRemoteValue
Adds a value to a remote statistic. This value is not associated with any transaction. -
getPercentile
public final double getPercentile(PercentileStatistic stat, int percentile) throws IllegalArgumentException - Returns:
- the percentile og the statistic.
- Throws:
IllegalArgumentException- if the percentile request is not in the correct bounds (]0,100[)
-
getAttribute
- Returns:
- the current value of the statistic. If the statistic is not exported (via JMX), then the sum of the remote and local value is returned.
- Throws:
ExtendedStatisticNotFoundException- if the statistic is not found.
-
dumpTo
Dumps all the cache statistic values to aStringBuilder -
dumpTo
Prints the cache statistics values to aPrintStream. -
convertNanosToMicro
public static double convertNanosToMicro(double nanos) - Returns:
- the conversion of nanoseconds to microseconds without losing precision.
-
convertNanosToSeconds
public static double convertNanosToSeconds(double nanos) - Returns:
- the conversion of nanoseconds to seconds without losing precision.
-