Class 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 uses CheckPeriodCache for 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 Detail

      • StorageMetricsStore

        public StorageMetricsStore()
    • 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()
      • resetArtifactVersionsCounter

        public void resetArtifactVersionsCounter​(String groupId,
                                                 String artifactId)