Skip to content

Commit

Permalink
sch-UID2-4560-adding-gauge-for-number-of-request-processing-threads a…
Browse files Browse the repository at this point in the history
…dded gauge for event loop threads
  • Loading branch information
sophia-chen-ttd committed Dec 18, 2024
1 parent c3fafd1 commit a40e382
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/main/java/com/uid2/operator/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ private ICloudStorage wrapCloudStorageForOptOut(ICloudStorage cloudStorage) {
}

private void run() throws Exception {
this.createServiceInstancesMetric();
this.createVertxInstancesMetric();
this.createVertxEventLoopsMetric();
Supplier<Verticle> 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;
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit a40e382

Please sign in to comment.