Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Akka - how to check how long a message was in inbox?

Tags:

scala

akka

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")
like image 920
mpr Avatar asked Oct 20 '22 13:10

mpr


1 Answers

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

like image 133
lutzh Avatar answered Oct 23 '22 01:10

lutzh