Class BaseGenericObjectPool.StatsStore
- java.lang.Object
-
- org.datanucleus.store.rdbms.datasource.dbcp2.pool2.impl.BaseGenericObjectPool.StatsStore
-
- Enclosing class:
- BaseGenericObjectPool<T>
private class BaseGenericObjectPool.StatsStore extends java.lang.Object
Maintains a cache of values for a single metric and reports statistics on the cached values.
-
-
Constructor Summary
Constructors Constructor Description StatsStore(int size)
Create a StatsStore with the given cache size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(long value)
Adds a value to the cache.long
getMean()
Returns the mean of the cached values.java.lang.String
toString()
-
-
-
Method Detail
-
add
public void add(long value)
Adds a value to the cache. If the cache is full, one of the existing values is replaced by the new value.- Parameters:
value
- new value to add to the cache.
-
getMean
public long getMean()
Returns the mean of the cached values.- Returns:
- the mean of the cache, truncated to long
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-