@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
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
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))
}
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))
}