From: David ‘Bombe’ Roden Date: Wed, 20 Nov 2019 15:45:51 +0000 (+0100) Subject: ✏️ Unify metric names X-Git-Tag: v81^2~32 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=a01e3b29a9dab0f8db0fbbdf718747229300781b;p=Sone.git ✏️ Unify metric names --- 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)) }