-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Periodic storage consistency checks (#1885)
* add ability to perform periodic storage checks * add periodic consistency check spec * register gauge based on state object
- Loading branch information
Showing
5 changed files
with
158 additions
and
8 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
hermes-common/src/main/java/pl/allegro/tech/hermes/common/metric/ConsistencyMetrics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package pl.allegro.tech.hermes.common.metric; | ||
|
||
import io.micrometer.core.instrument.MeterRegistry; | ||
|
||
import java.util.function.ToDoubleFunction; | ||
|
||
|
||
public class ConsistencyMetrics { | ||
private final MeterRegistry meterRegistry; | ||
|
||
ConsistencyMetrics(MeterRegistry meterRegistry) { | ||
this.meterRegistry = meterRegistry; | ||
|
||
} | ||
|
||
public <T> void registerStorageConsistencyGauge(T stateObject, ToDoubleFunction<T> valueFunction) { | ||
meterRegistry.gauge("storage.consistency", stateObject, valueFunction); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters