ruippeixotog / akka-stream-mon

Throughput and latency monitoring for Akka Streams
MIT License
25 stars 5 forks source link

How to implement a LatencyMonitor on a Flow which already features a ThroughputMonitor #2

Open schrepfler opened 6 years ago

schrepfler commented 6 years ago

The LatencyMonitor is a bit more difficult to implement in Java that the ThroughputMonitor, would be nice to show an example how to create one in Java and also perhaps show how to compose and create the Graph featuring both.

Flow.fromSinkAndSource(sink, src)
   .via(ThroughputMonitor.apply(FiniteDuration.create(15, TimeUnit.SECONDS), this::onStatsHandler);