From db5e38f4e87e71bdec4217b768319da3c03aa7a7 Mon Sep 17 00:00:00 2001 From: alexcardell <29524087+alexcardell@users.noreply.github.com> Date: Wed, 11 Jan 2023 19:11:05 +0000 Subject: [PATCH] Format PrometheusMetricsCollector --- .../PrometheusMetricsCollector.java | 58 ++++++------------- 1 file changed, 18 insertions(+), 40 deletions(-) diff --git a/prometheus/src/main/java/com/itv/bucky/prometheus/PrometheusMetricsCollector.java b/prometheus/src/main/java/com/itv/bucky/prometheus/PrometheusMetricsCollector.java index 8e32674..4ec6f49 100644 --- a/prometheus/src/main/java/com/itv/bucky/prometheus/PrometheusMetricsCollector.java +++ b/prometheus/src/main/java/com/itv/bucky/prometheus/PrometheusMetricsCollector.java @@ -38,64 +38,42 @@ public PrometheusMetricsCollector(final CollectorRegistry registry) { } public PrometheusMetricsCollector(final CollectorRegistry registry, final String prefix) { - this.connections = Gauge.build() - .name(prefix + "_connections") - .help("Current connections") - .create(); + this.connections = Gauge.build().name(prefix + "_connections").help("Current connections").create(); registry.register(this.connections); - this.channels = Gauge.build() - .name(prefix + "_channels") - .help("Current channels") - .create(); + this.channels = Gauge.build().name(prefix + "_channels").help("Current channels").create(); registry.register(this.channels); - this.publishedMessages = Counter.build() - .name(prefix + "_published_messages") - .help("Count of published messages") - .create(); + this.publishedMessages = Counter.build().name(prefix + "_published_messages") + .help("Count of published messages").create(); registry.register(this.publishedMessages); - this.failedToPublishMessages = Counter.build() - .name(prefix + "_failed_to_publish_messages") - .help("Count of failed to publish messages") - .create(); + this.failedToPublishMessages = Counter.build().name(prefix + "_failed_to_publish_messages") + .help("Count of failed to publish messages").create(); registry.register(failedToPublishMessages); - this.ackedPublishedMessages = Counter.build() - .name(prefix + "_acked_published_messages") - .help("Count of acknowledged publish messages") - .create(); + this.ackedPublishedMessages = Counter.build().name(prefix + "_acked_published_messages") + .help("Count of acknowledged publish messages").create(); registry.register(ackedPublishedMessages); - this.nackedPublishedMessages = Counter.build() - .name(prefix + "_nacked_published_messages") - .help("Count of not acknowledged publish messages") - .create(); + this.nackedPublishedMessages = Counter.build().name(prefix + "_nacked_published_messages") + .help("Count of not acknowledged publish messages").create(); registry.register(nackedPublishedMessages); - this.unroutedPublishedMessages = Counter.build() - .name(prefix + "_unrouted_published_messages") - .help("Count of unrouted publish messages") - .create(); + this.unroutedPublishedMessages = Counter.build().name(prefix + "_unrouted_published_messages") + .help("Count of unrouted publish messages").create(); registry.register(unroutedPublishedMessages); - this.consumedMessages = Counter.build() - .name(prefix + "_consumed_messages") - .help("Count of consumed messages") - .create(); + this.consumedMessages = Counter.build().name(prefix + "_consumed_messages").help("Count of consumed messages") + .create(); registry.register(consumedMessages); - this.acknowledgedMessages = Counter.build() - .name(prefix + "_acknowledged_messages") - .help("Count of acknowledged consumed messages") - .create(); + this.acknowledgedMessages = Counter.build().name(prefix + "_acknowledged_messages") + .help("Count of acknowledged consumed messages").create(); registry.register(acknowledgedMessages); - this.rejectedMessages = Counter.build() - .name(prefix + "_rejected_messages") - .help("Count of rejected consumed messages") - .create(); + this.rejectedMessages = Counter.build().name(prefix + "_rejected_messages") + .help("Count of rejected consumed messages").create(); registry.register(rejectedMessages); }