Package org.dataloader.stats
Class Statistics
- java.lang.Object
-
- org.dataloader.stats.Statistics
-
@PublicApi public class Statistics extends java.lang.Object
This holds statistics on how aDataLoaderhas performed
-
-
Constructor Summary
Constructors Constructor Description Statistics()Zero statisticsStatistics(long loadCount, long loadErrorCount, long batchInvokeCount, long batchLoadCount, long batchLoadExceptionCount, long cacheHitCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Statisticscombine(Statistics other)This will combine this set of statistics with another set of statistics so that they become the combined count of eachlonggetBatchInvokeCount()longgetBatchLoadCount()longgetBatchLoadExceptionCount()doublegetBatchLoadExceptionRatio()doublegetBatchLoadRatio()longgetCacheHitCount()doublegetCacheHitRatio()longgetCacheMissCount()longgetLoadCount()longgetLoadErrorCount()doublegetLoadErrorRatio()doubleratio(long numerator, long denominator)A helper to divide two numbers and handle zerojava.util.Map<java.lang.String,java.lang.Number>toMap()java.lang.StringtoString()
-
-
-
Method Detail
-
ratio
public double ratio(long numerator, long denominator)A helper to divide two numbers and handle zero- Parameters:
numerator- the top bitdenominator- the bottom bit- Returns:
- numerator / denominator returning zero when denominator is zero
-
getLoadCount
public long getLoadCount()
- Returns:
- the number of objects
DataLoader.load(Object)has been asked to load
-
getLoadErrorCount
public long getLoadErrorCount()
- Returns:
- the number of times the
DataLoaderbatch loader function return a specific object that was in error
-
getLoadErrorRatio
public double getLoadErrorRatio()
- Returns:
- loadErrorCount / loadCount
-
getBatchInvokeCount
public long getBatchInvokeCount()
- Returns:
- the number of times the
DataLoaderbatch loader function has been called
-
getBatchLoadCount
public long getBatchLoadCount()
- Returns:
- the number of objects that the
DataLoaderbatch loader function has been asked to load
-
getBatchLoadRatio
public double getBatchLoadRatio()
- Returns:
- batchLoadCount / loadCount
-
getBatchLoadExceptionCount
public long getBatchLoadExceptionCount()
- Returns:
- the number of times the
DataLoaderbatch loader function throw an exception when trying to get any values
-
getBatchLoadExceptionRatio
public double getBatchLoadExceptionRatio()
- Returns:
- batchLoadExceptionCount / loadCount
-
getCacheHitCount
public long getCacheHitCount()
- Returns:
- the number of times
DataLoader.load(Object)resulted in a cache hit
-
getCacheMissCount
public long getCacheMissCount()
- Returns:
- then number of times we missed the cache during
DataLoader.load(Object)
-
getCacheHitRatio
public double getCacheHitRatio()
- Returns:
- cacheHits / loadCount
-
combine
public 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- Parameters:
other- the other statistics to combine- Returns:
- a new statistics object of the combined counts
-
toMap
public java.util.Map<java.lang.String,java.lang.Number> toMap()
- Returns:
- a map representation of the statistics, perhaps to send over JSON or some such
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-