Module io.github.bucket4j.core
Interface OptimizationListener
-
- All Known Implementing Classes:
DefaultOptimizationListener,NopeOptimizationListener
public interface OptimizationListenerMonitoring listener for applied optimizations
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static OptimizationListenercreateDefault()Creates new instance ofDefaultOptimizationListenervoidincrementMergeCount(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
-
createDefault
static OptimizationListener createDefault()
Creates new instance ofDefaultOptimizationListener- Returns:
- new instance of
DefaultOptimizationListener - See Also:
DefaultOptimizationListener
-
incrementMergeCount
void incrementMergeCount(int count)
This method is invoked every time when several independent requests to the same bucket combined into a single one.- Parameters:
count- number of requests that were merged
-
incrementSkipCount
void incrementSkipCount(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.- Parameters:
count- number of requests that were served locally without synchronization with external storage
-
-