SENDLINE open source

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, cumulative buckets) and labelValues take the definition, so a test cannot misspell a series.
  • series is the exposition as a map, keyed name{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