Class StorageMetricsStore
- java.lang.Object
-
- io.apicurio.registry.storage.metrics.StorageMetricsStore
-
@ApplicationScoped public class StorageMetricsStore extends Object
This class provides a set of per-tenant counters. Counters such as "number of artifacts" This counters have to be "distributed" or at least work in a clustered deployment. Currently this implementation usesCheckPeriodCachefor storing the counters, it's "auto-eviction" nature allows to re-initialize the counters with information from the database periodically, making it "useful" for clustered deployments. This implementation is far from perfect, ideally redis or some other externalized cache should be used, but for now this implementation could work, it's extremely simple and it does not require the deployment of external infrastructure.- Author:
- Fabian Martinez
-
-
Constructor Summary
Constructors Constructor Description StorageMetricsStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetOrInitializeArtifactsCounter()longgetOrInitializeArtifactVersionsCounter(String groupId, String artifactId)longgetOrInitializeTotalSchemasCounter()voidincrementArtifactsCounter()voidincrementArtifactVersionsCounter(String groupId, String artifactId)voidincrementTotalSchemasCounter()voidonStart(io.quarkus.runtime.StartupEvent ev)voidresetArtifactsCounter()voidresetArtifactVersionsCounter(String groupId, String artifactId)voidresetTotalSchemasCounter()
-
-
-
Method Detail
-
onStart
public void onStart(@Observes io.quarkus.runtime.StartupEvent ev)
-
getOrInitializeTotalSchemasCounter
public long getOrInitializeTotalSchemasCounter()
-
getOrInitializeArtifactsCounter
public long getOrInitializeArtifactsCounter()
-
getOrInitializeArtifactVersionsCounter
public long getOrInitializeArtifactVersionsCounter(String groupId, String artifactId)
-
incrementTotalSchemasCounter
public void incrementTotalSchemasCounter()
-
incrementArtifactsCounter
public void incrementArtifactsCounter()
-
incrementArtifactVersionsCounter
public void incrementArtifactVersionsCounter(String groupId, String artifactId)
-
resetTotalSchemasCounter
public void resetTotalSchemasCounter()
-
resetArtifactsCounter
public void resetArtifactsCounter()
-
-