From a01e3b29a9dab0f8db0fbbdf718747229300781b Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 20 Nov 2019 16:45:51 +0100 Subject: [PATCH] =?utf8?q?=E2=9C=8F=EF=B8=8F=20Unify=20metric=20names?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/core/SoneParser.java | 2 +- src/main/resources/i18n/sone.en.properties | 2 +- src/test/kotlin/net/pterodactylus/sone/core/SoneParserTest.kt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/core/SoneParser.java b/src/main/java/net/pterodactylus/sone/core/SoneParser.java index d82dab5..e1fd9ff 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneParser.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneParser.java @@ -33,7 +33,7 @@ public class SoneParser { @Inject public SoneParser(Database database, MetricRegistry metricRegistry) { this.database = database; - this.soneParsingDurationHistogram = metricRegistry.histogram("sone.parsing.duration", () -> new Histogram(new ExponentiallyDecayingReservoir(3000, 0))); + this.soneParsingDurationHistogram = metricRegistry.histogram("sone.parse.duration", () -> new Histogram(new ExponentiallyDecayingReservoir(3000, 0))); } @Nullable diff --git a/src/main/resources/i18n/sone.en.properties b/src/main/resources/i18n/sone.en.properties index ed3479a..a23730c 100644 --- a/src/main/resources/i18n/sone.en.properties +++ b/src/main/resources/i18n/sone.en.properties @@ -336,7 +336,7 @@ Page.Invalid.Text=An invalid action was performed, or the action was valid but t Page.Metrics.Title=Metrics Page.Metrics.Page.Title=Metrics Page.Metrics.SoneInsertDuration.Title=Sone Insert Duration -Page.Metrics.SoneParsingDuration.Title=Sone Parsing Duration +Page.Metrics.SoneParseDuration.Title=Sone Parse Duration Page.Metrics.ConfigurationSaveDuration.Title=Configuration Save Duration View.Search.Button.Search=Search diff --git a/src/test/kotlin/net/pterodactylus/sone/core/SoneParserTest.kt b/src/test/kotlin/net/pterodactylus/sone/core/SoneParserTest.kt index 6d9d4b8..336d855 100644 --- a/src/test/kotlin/net/pterodactylus/sone/core/SoneParserTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/core/SoneParserTest.kt @@ -401,7 +401,7 @@ class SoneParserTest { fun `unsuccessful parsing does not add a histogram entry`() { val inputStream = javaClass.getResourceAsStream("sone-parser-with-invalid-image-height.xml") assertThat(soneParser.parseSone(sone, inputStream), nullValue()) - val histogram = metricRegistry.histogram("sone.parsing.duration") + val histogram = metricRegistry.histogram("sone.parse.duration") assertThat(histogram.count, equalTo(0L)) } @@ -409,7 +409,7 @@ class SoneParserTest { fun `successful parsing adds histogram entry`() { val inputStream = javaClass.getResourceAsStream("sone-parser-without-images.xml") assertThat(soneParser.parseSone(sone, inputStream), notNullValue()) - val histogram = metricRegistry.histogram("sone.parsing.duration") + val histogram = metricRegistry.histogram("sone.parse.duration") assertThat(histogram.count, equalTo(1L)) } -- 2.7.4