All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dataloader.stats.NoOpStatisticsCollector Maven / Gradle / Ivy

There is a newer version: 2022-09-12T23-25-35-08559ba
Show newest version
package org.dataloader.stats;

import org.dataloader.stats.context.IncrementBatchLoadCountByStatisticsContext;
import org.dataloader.stats.context.IncrementBatchLoadExceptionCountStatisticsContext;
import org.dataloader.stats.context.IncrementCacheHitCountStatisticsContext;
import org.dataloader.stats.context.IncrementLoadCountStatisticsContext;
import org.dataloader.stats.context.IncrementLoadErrorCountStatisticsContext;

/**
 * A statistics collector that does nothing
 */
public class NoOpStatisticsCollector implements StatisticsCollector {

    private static final Statistics ZERO_STATS = new Statistics();

    @Override
    public  long incrementLoadCount(IncrementLoadCountStatisticsContext context) {
        return 0;
    }

    @Deprecated
    @Override
    public long incrementLoadCount() {
        return incrementLoadCount(null);
    }

    @Override
    public  long incrementLoadErrorCount(IncrementLoadErrorCountStatisticsContext context) {
        return 0;
    }

    @Deprecated
    @Override
    public long incrementLoadErrorCount() {
        return incrementLoadErrorCount(null);
    }

    @Override
    public  long incrementBatchLoadCountBy(long delta, IncrementBatchLoadCountByStatisticsContext context) {
        return 0;
    }

    @Deprecated
    @Override
    public long incrementBatchLoadCountBy(long delta) {
        return incrementBatchLoadCountBy(delta, null);
    }

    @Override
    public  long incrementBatchLoadExceptionCount(IncrementBatchLoadExceptionCountStatisticsContext context) {
        return 0;
    }

    @Deprecated
    @Override
    public long incrementBatchLoadExceptionCount() {
        return incrementBatchLoadExceptionCount(null);
    }

    @Override
    public  long incrementCacheHitCount(IncrementCacheHitCountStatisticsContext context) {
        return 0;
    }

    @Deprecated
    @Override
    public long incrementCacheHitCount() {
        return incrementCacheHitCount(null);
    }

    @Override
    public Statistics getStatistics() {
        return ZERO_STATS;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy