Module io.github.bucket4j.core
Class DefaultOptimizationListener
- java.lang.Object
-
- io.github.bucket4j.distributed.proxy.optimization.DefaultOptimizationListener
-
- All Implemented Interfaces:
OptimizationListener
public class DefaultOptimizationListener extends Object implements OptimizationListener
The simple listener that just stores all events as AtomicLong counters and provides getters for them.
-
-
Constructor Summary
Constructors Constructor Description DefaultOptimizationListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetMergeCount()longgetSkipCount()voidincrementMergeCount(int count)This method is invoked every time when several independent requests to the same bucket combined into a single one.voidincrementSkipCount(int count)This method is invoked every time when several requests were not propagated to external storage because optimization had decided that they can be served locally.
-
-
-
Method Detail
-
incrementMergeCount
public void incrementMergeCount(int count)
Description copied from interface:OptimizationListenerThis method is invoked every time when several independent requests to the same bucket combined into a single one.- Specified by:
incrementMergeCountin interfaceOptimizationListener- Parameters:
count- number of requests that were merged
-
incrementSkipCount
public void incrementSkipCount(int count)
Description copied from interface:OptimizationListenerThis method is invoked every time when several requests were not propagated to external storage because optimization had decided that they can be served locally.- Specified by:
incrementSkipCountin interfaceOptimizationListener- Parameters:
count- number of requests that were served locally without synchronization with external storage
-
getMergeCount
public long getMergeCount()
-
getSkipCount
public long getSkipCount()
-
-