open source / metrics4s / testing
Testing
Tests read real values from a real registry:
scala
val testkit = MetricsTestkit()
given Metrics[IO] = testkit.metrics[IO]
for
counter <- Metrics[IO].register(ProcessorMetrics.processed)
_ <- counter.inc(Outcome.Ok)
yield
testkit.value(ProcessorMetrics.processed, Outcome.Ok) shouldBe Some(1.0)
testkit.value(ProcessorMetrics.processed, Outcome.Error) shouldBe Some(0.0)value,histogram(...)(count,sum, cumulativebuckets) andlabelValuestake the definition, so a test cannot misspell a series.seriesis the exposition as a map, keyedname{a="x",b="y"}the way the dashboards read it.missingSeries(dashboard)lists every series a dashboard queries that the registry does not export.
built from README.md at v0.2.0
edit this page on GitHub