public interface MetricsListener extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
default void |
close() |
void |
onEntryAdded()
Called when an entry is added to the batch.
|
void |
onFlushFinished(long elapsed,
int successfulEntriesCount,
int failedEntriesCount)
Called when a batch flush is finished.
|
void |
onFlushStarted(long elapsed,
int flushEntriesCount)
Called when a batch flush is not empty and starts the process to persist entries in the database, eventually
after waiting for other flush operations to finish.
|
void |
onFlushTriggered()
Called when a batch flush is triggered.
|
void onEntryAdded()
void onFlushTriggered()
The batch may be empty, in which case it will skip the persistence to database.
void onFlushStarted(long elapsed,
int flushEntriesCount)
elapsed - The time elapsed (in milliseconds) since the batch flush was triggered.flushEntriesCount - The number of entries to be flushed.void onFlushFinished(long elapsed,
int successfulEntriesCount,
int failedEntriesCount)
This should be called for all cases:
elapsed - The time elapsed (in milliseconds) since the batch flush was triggered.successfulEntriesCount - The number of entries flushed successfully.failedEntriesCount - The number of entries that failed to be flushed.default void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2023 Feedzai. All rights reserved.