Module io.github.bucket4j.core
Interface OptimizationListener
- All Known Implementing Classes:
DefaultOptimizationListener,NopeOptimizationListener
public interface OptimizationListener
Monitoring listener for applied optimizations
-
Method Summary
Modifier and TypeMethodDescriptionstatic OptimizationListenerCreates 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 Details
-
createDefault
Creates new instance ofDefaultOptimizationListener- Returns:
- new instance of
DefaultOptimizationListener - See Also:
-
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
-