Package org.dataloader.stats
Class DelegatingStatisticsCollector
- java.lang.Object
-
- org.dataloader.stats.DelegatingStatisticsCollector
-
- All Implemented Interfaces:
StatisticsCollector
public class DelegatingStatisticsCollector extends java.lang.Object implements StatisticsCollector
This statistics collector keeps dataloader statistics AND also calls the delegate collector at the same time. This allows you to keep a specific set of statistics and also delegate the calls onto another collector.
-
-
Constructor Summary
Constructors Constructor Description DelegatingStatisticsCollector(StatisticsCollector delegateCollector)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StatisticsgetDelegateStatistics()StatisticsgetStatistics()longincrementBatchLoadCountBy(long delta)Deprecated.<K> longincrementBatchLoadCountBy(long delta, IncrementBatchLoadCountByStatisticsContext<K> context)Called to increment the number of batch loadslongincrementBatchLoadExceptionCount()Deprecated.<K> longincrementBatchLoadExceptionCount(IncrementBatchLoadExceptionCountStatisticsContext<K> context)Called to increment the number of batch loads exceptionslongincrementCacheHitCount()Deprecated.<K> longincrementCacheHitCount(IncrementCacheHitCountStatisticsContext<K> context)Called to increment the number of cache hitslongincrementLoadCount()Deprecated.<K> longincrementLoadCount(IncrementLoadCountStatisticsContext<K> context)Called to increment the number of loadslongincrementLoadErrorCount()Deprecated.<K> longincrementLoadErrorCount(IncrementLoadErrorCountStatisticsContext<K> context)Called to increment the number of loads that resulted in an object deemed in error
-
-
-
Constructor Detail
-
DelegatingStatisticsCollector
public DelegatingStatisticsCollector(StatisticsCollector delegateCollector)
- Parameters:
delegateCollector- a non null delegate collector
-
-
Method Detail
-
incrementLoadCount
public <K> long incrementLoadCount(IncrementLoadCountStatisticsContext<K> context)
Description copied from interface:StatisticsCollectorCalled to increment the number of loads- Specified by:
incrementLoadCountin interfaceStatisticsCollector- Type Parameters:
K- the class of the key in the data loader- Parameters:
context- the context containing metadata of the data loader invocation- Returns:
- the current value after increment
-
incrementLoadCount
@Deprecated public long incrementLoadCount()
Deprecated.Description copied from interface:StatisticsCollectorCalled to increment the number of loads- Specified by:
incrementLoadCountin interfaceStatisticsCollector- Returns:
- the current value after increment
-
incrementLoadErrorCount
public <K> long incrementLoadErrorCount(IncrementLoadErrorCountStatisticsContext<K> context)
Description copied from interface:StatisticsCollectorCalled to increment the number of loads that resulted in an object deemed in error- Specified by:
incrementLoadErrorCountin interfaceStatisticsCollector- Type Parameters:
K- the class of the key in the data loader- Parameters:
context- the context containing metadata of the data loader invocation- Returns:
- the current value after increment
-
incrementLoadErrorCount
@Deprecated public long incrementLoadErrorCount()
Deprecated.Description copied from interface:StatisticsCollectorCalled to increment the number of loads that resulted in an object deemed in error- Specified by:
incrementLoadErrorCountin interfaceStatisticsCollector- Returns:
- the current value after increment
-
incrementBatchLoadCountBy
public <K> long incrementBatchLoadCountBy(long delta, IncrementBatchLoadCountByStatisticsContext<K> context)Description copied from interface:StatisticsCollectorCalled to increment the number of batch loads- Specified by:
incrementBatchLoadCountByin interfaceStatisticsCollector- Type Parameters:
K- the class of the key in the data loader- Parameters:
delta- how much to add to the countcontext- the context containing metadata of the data loader invocation- Returns:
- the current value after increment
-
incrementBatchLoadCountBy
@Deprecated public long incrementBatchLoadCountBy(long delta)
Deprecated.Description copied from interface:StatisticsCollectorCalled to increment the number of batch loads- Specified by:
incrementBatchLoadCountByin interfaceStatisticsCollector- Parameters:
delta- how much to add to the count- Returns:
- the current value after increment
-
incrementBatchLoadExceptionCount
public <K> long incrementBatchLoadExceptionCount(IncrementBatchLoadExceptionCountStatisticsContext<K> context)
Description copied from interface:StatisticsCollectorCalled to increment the number of batch loads exceptions- Specified by:
incrementBatchLoadExceptionCountin interfaceStatisticsCollector- Type Parameters:
K- the class of the key in the data loader- Parameters:
context- the context containing metadata of the data loader invocation- Returns:
- the current value after increment
-
incrementBatchLoadExceptionCount
@Deprecated public long incrementBatchLoadExceptionCount()
Deprecated.Description copied from interface:StatisticsCollectorCalled to increment the number of batch loads exceptions- Specified by:
incrementBatchLoadExceptionCountin interfaceStatisticsCollector- Returns:
- the current value after increment
-
incrementCacheHitCount
public <K> long incrementCacheHitCount(IncrementCacheHitCountStatisticsContext<K> context)
Description copied from interface:StatisticsCollectorCalled to increment the number of cache hits- Specified by:
incrementCacheHitCountin interfaceStatisticsCollector- Type Parameters:
K- the class of the key in the data loader- Parameters:
context- the context containing metadata of the data loader invocation- Returns:
- the current value after increment
-
incrementCacheHitCount
@Deprecated public long incrementCacheHitCount()
Deprecated.Description copied from interface:StatisticsCollectorCalled to increment the number of cache hits- Specified by:
incrementCacheHitCountin interfaceStatisticsCollector- Returns:
- the current value after increment
-
getStatistics
public Statistics getStatistics()
- Specified by:
getStatisticsin interfaceStatisticsCollector- Returns:
- the statistics of the collector (and not its delegate)
-
getDelegateStatistics
public Statistics getDelegateStatistics()
- Returns:
- the statistics of the delegate
-
-