How to check in akka how long a message was in inbox? I want to make a log message if message was in inbox for too long. Something like:
override def receive: Receive = {
case Message =>
val timeInInbox = ...
if (timeInInbox > treshold) log.warn("bla bla bla the doom is coming")
There are metrics / telemetry libraries available that can provide this information. One is kamon.io (open source), which gives you a "time-in-mailbox" metric, see http://kamon.io/documentation/kamon-akka/0.6.6/actor-router-and-dispatcher-metrics/
Another one (non-free, closed source) is "Lightbend Telemetry", which calls it "mailbox time", see http://developer.lightbend.com/docs/monitoring/latest/instrumentations/akka/akka.html#actor-metrics
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With