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 void
addLocalValue
(ExtendedStatistic stat, double value) Adds a value to a local statistic.final void
addRemoteValue
(ExtendedStatistic stat, double value) Adds a value to a remote statistic.static double
convertNanosToMicro
(double nanos) static double
convertNanosToSeconds
(double nanos) final void
dumpTo
(PrintWriter writer) Prints the cache statistics values to aPrintStream
.final void
dumpTo
(StringBuilder builder) Dumps all the cache statistic values to aStringBuilder
final double
final double
getPercentile
(PercentileStatistic stat, int percentile) final void
merge
(TransactionStatistics transactionStatistics) Merges a transaction statistics in this cache statistics.final void
reset()
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.
-