@PublicApi public class Statistics extends java.lang.Object
DataLoader
has performedConstructor and Description |
---|
Statistics()
Zero statistics
|
Statistics(long loadCount,
long loadErrorCount,
long batchInvokeCount,
long batchLoadCount,
long batchLoadExceptionCount,
long cacheHitCount) |
Modifier and Type | Method and Description |
---|---|
Statistics |
combine(Statistics other)
This will combine this set of statistics with another set of statistics so that they become the combined count of each
|
long |
getBatchInvokeCount() |
long |
getBatchLoadCount() |
long |
getBatchLoadExceptionCount() |
double |
getBatchLoadExceptionRatio() |
double |
getBatchLoadRatio() |
long |
getCacheHitCount() |
double |
getCacheHitRatio() |
long |
getCacheMissCount() |
long |
getLoadCount() |
long |
getLoadErrorCount() |
double |
getLoadErrorRatio() |
double |
ratio(long numerator,
long denominator)
A helper to divide two numbers and handle zero
|
java.util.Map<java.lang.String,java.lang.Number> |
toMap() |
java.lang.String |
toString() |
public Statistics()
public Statistics(long loadCount, long loadErrorCount, long batchInvokeCount, long batchLoadCount, long batchLoadExceptionCount, long cacheHitCount)
public double ratio(long numerator, long denominator)
numerator
- the top bitdenominator
- the bottom bitpublic long getLoadCount()
DataLoader.load(Object)
has been asked to loadpublic long getLoadErrorCount()
DataLoader
batch loader function return an specific object that was in errorpublic double getLoadErrorRatio()
public long getBatchInvokeCount()
DataLoader
batch loader function has been calledpublic long getBatchLoadCount()
DataLoader
batch loader function has been asked to loadpublic double getBatchLoadRatio()
public long getBatchLoadExceptionCount()
DataLoader
batch loader function throw an exception when trying to get any valuespublic double getBatchLoadExceptionRatio()
public long getCacheHitCount()
DataLoader.load(Object)
resulted in a cache hitpublic long getCacheMissCount()
DataLoader.load(Object)
public double getCacheHitRatio()
public Statistics combine(Statistics other)
other
- the other statistics to combinepublic java.util.Map<java.lang.String,java.lang.Number> toMap()
public java.lang.String toString()
toString
in class java.lang.Object