Skip to content

Instantly share code, notes, and snippets.

@jkschneider
Created March 20, 2018 15:22
Show Gist options
  • Save jkschneider/9cb172883c9c8a53907022de13b47eca to your computer and use it in GitHub Desktop.
Save jkschneider/9cb172883c9c8a53907022de13b47eca to your computer and use it in GitHub Desktop.
public class Slack320 {
public static void main(String[] args) {
MeterRegistry registry = SampleRegistries.graphite();
Counter counter = registry.counter("serviceName", "client",
"token", "statistic", "timeout_connect");
RandomEngine r = new MersenneTwister64(0);
Normal dist = new Normal(0, 1, r);
Flux.interval(Duration.ofMillis(10))
.doOnEach(d -> {
if (dist.nextDouble() + 0.1 > 0) {
counter.increment();
}
})
.blockLast();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment