X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FMetricsPage.kt;h=837e2c89d6505f10131effc8c4dfb8dc59c1c7c7;hp=e097daffe0fe8a2404fa213f338c173f109a3bd4;hb=HEAD;hpb=7aa1997cc7aed40c12017c417ece3e03815e1d28 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/MetricsPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/MetricsPage.kt index e097daf..837e2c8 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/MetricsPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/MetricsPage.kt @@ -13,20 +13,7 @@ import javax.inject.* class MetricsPage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer, private val metricsRegistry: MetricRegistry) : SoneTemplatePage(webInterface, loaders, templateRenderer, "Page.Metrics.Title") { override fun handleRequest(soneRequest: SoneRequest, templateContext: TemplateContext) { - metricsRegistry.histogram("sone.parsing.duration").also { histogram -> - templateContext["soneParsingDurationCount"] = histogram.count - histogram.snapshot.also { snapshot -> - templateContext["soneParsingDurationMin"] = snapshot.min - templateContext["soneParsingDurationMax"] = snapshot.max - templateContext["soneParsingDurationMedian"] = snapshot.median - templateContext["soneParsingDurationMean"] = snapshot.mean - templateContext["soneParsingDurationPercentile75"] = snapshot.get75thPercentile() - templateContext["soneParsingDurationPercentile95"] = snapshot.get95thPercentile() - templateContext["soneParsingDurationPercentile98"] = snapshot.get98thPercentile() - templateContext["soneParsingDurationPercentile99"] = snapshot.get99thPercentile() - templateContext["soneParsingDurationPercentile999"] = snapshot.get999thPercentile() - } - } + templateContext["histograms"] = metricsRegistry.histograms } }