From a40e3821df227a28c04177fe1578a80f0eddd6d5 Mon Sep 17 00:00:00 2001 From: Sophia Chen Date: Wed, 18 Dec 2024 16:02:10 +1100 Subject: [PATCH] sch-UID2-4560-adding-gauge-for-number-of-request-processing-threads added gauge for event loop threads --- src/main/java/com/uid2/operator/Main.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/uid2/operator/Main.java b/src/main/java/com/uid2/operator/Main.java index 51c7bef6c..9ca0c27a7 100644 --- a/src/main/java/com/uid2/operator/Main.java +++ b/src/main/java/com/uid2/operator/Main.java @@ -265,7 +265,8 @@ private ICloudStorage wrapCloudStorageForOptOut(ICloudStorage cloudStorage) { } private void run() throws Exception { - this.createServiceInstancesMetric(); + this.createVertxInstancesMetric(); + this.createVertxEventLoopsMetric(); Supplier operatorVerticleSupplier = () -> { UIDOperatorVerticle verticle = new UIDOperatorVerticle(config, this.clientSideTokenGenerate, siteProvider, clientKeyProvider, clientSideKeypairProvider, getKeyManager(), saltProvider, optOutStore, Clock.systemUTC(), _statsCollectorQueue, new SecureLinkValidatorService(this.serviceLinkProvider, this.serviceProvider), this.shutdownHandler::handleSaltRetrievalResponse); return verticle; @@ -468,9 +469,15 @@ public DistributionStatisticConfig configure(Meter.Id id, DistributionStatisticC .register(globalRegistry); } - private void createServiceInstancesMetric() { + private void createVertxInstancesMetric() { Gauge.builder("uid2.operator.vertx_service_instances", () -> config.getInteger("service_instances")) - .description("gauge for number of request processing threads") + .description("gauge for number of vertx service instances requested") + .register(Metrics.globalRegistry); + } + + private void createVertxEventLoopsMetric() { + Gauge.builder("uid2.operator.vertx_event_loop_threads", () -> VertxOptions.DEFAULT_EVENT_LOOP_POOL_SIZE) + .description("gauge for number of vertx event loop threads") .register(Metrics.globalRegistry); }