Package org.dataloader.stats
Class Statistics
java.lang.Object
org.dataloader.stats.Statistics
This holds statistics on how a
DataLoader
has performed-
Constructor Summary
ConstructorsConstructorDescriptionZero statisticsStatistics
(long loadCount, long loadErrorCount, long batchInvokeCount, long batchLoadCount, long batchLoadExceptionCount, long cacheHitCount) -
Method Summary
Modifier and TypeMethodDescriptioncombine
(Statistics other) This will combine this set of statistics with another set of statistics so that they become the combined count of eachlong
long
long
double
double
long
double
long
long
long
double
double
ratio
(long numerator, long denominator) A helper to divide two numbers and handle zerotoMap()
toString()
-
Constructor Details
-
Statistics
public Statistics()Zero statistics -
Statistics
public Statistics(long loadCount, long loadErrorCount, long batchInvokeCount, long batchLoadCount, long batchLoadExceptionCount, long cacheHitCount)
-
-
Method Details
-
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
DataLoader
batch 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
DataLoader
batch loader function has been called
-
getBatchLoadCount
public long getBatchLoadCount()- Returns:
- the number of objects that the
DataLoader
batch loader function has been asked to load
-
getBatchLoadRatio
public double getBatchLoadRatio()- Returns:
- batchLoadCount / loadCount
-
getBatchLoadExceptionCount
public long getBatchLoadExceptionCount()- Returns:
- the number of times the
DataLoader
batch 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
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
- Returns:
- a map representation of the statistics, perhaps to send over JSON or some such
-
toString
-