✏️ Unify metric names
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 20 Nov 2019 15:45:51 +0000 (16:45 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 20 Nov 2019 15:45:51 +0000 (16:45 +0100)
src/main/java/net/pterodactylus/sone/core/SoneParser.java
src/main/resources/i18n/sone.en.properties
src/test/kotlin/net/pterodactylus/sone/core/SoneParserTest.kt

index d82dab5..e1fd9ff 100644 (file)
@@ -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
index ed3479a..a23730c 100644 (file)
@@ -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
index 6d9d4b8..336d855 100644 (file)
@@ -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))
        }