Skip to content

Commit d1e0826

Browse files
Merge pull request #1215 from IABTechLab/sch-UID2-4560-adding-gauge-for-number-of-request-processing-threads
sch-UID2-4560 add gauge for number of processing request threads
2 parents b792232 + a40e382 commit d1e0826

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/main/java/com/uid2/operator/Main.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ private ICloudStorage wrapCloudStorageForOptOut(ICloudStorage cloudStorage) {
265265
}
266266

267267
private void run() throws Exception {
268+
this.createVertxInstancesMetric();
269+
this.createVertxEventLoopsMetric();
268270
Supplier<Verticle> operatorVerticleSupplier = () -> {
269271
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);
270272
return verticle;
@@ -467,6 +469,18 @@ public DistributionStatisticConfig configure(Meter.Id id, DistributionStatisticC
467469
.register(globalRegistry);
468470
}
469471

472+
private void createVertxInstancesMetric() {
473+
Gauge.builder("uid2.operator.vertx_service_instances", () -> config.getInteger("service_instances"))
474+
.description("gauge for number of vertx service instances requested")
475+
.register(Metrics.globalRegistry);
476+
}
477+
478+
private void createVertxEventLoopsMetric() {
479+
Gauge.builder("uid2.operator.vertx_event_loop_threads", () -> VertxOptions.DEFAULT_EVENT_LOOP_POOL_SIZE)
480+
.description("gauge for number of vertx event loop threads")
481+
.register(Metrics.globalRegistry);
482+
}
483+
470484
private Map.Entry<UidCoreClient, UidOptOutClient> createUidClients(Vertx vertx, String attestationUrl, String clientApiToken, Handler<Pair<AttestationResponseCode, String>> responseWatcher) throws Exception {
471485
AttestationResponseHandler attestationResponseHandler = getAttestationTokenRetriever(vertx, attestationUrl, clientApiToken, responseWatcher);
472486
UidCoreClient coreClient = new UidCoreClient(clientApiToken, CloudUtils.defaultProxy, attestationResponseHandler);

0 commit comments

Comments
 (0)