Created
October 3, 2011 05:38
-
-
Save gseitz/1258500 to your computer and use it in GitHub Desktop.
Trait for exposing metrics for akka-actors.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.Actor | |
import com.yammer.metrics.Instrumented | |
// Useful for monitoring the mailbox size of actors. | |
// Just fire up your favorite JMX client and watch the pretty graph (which hopefully is a flatline at 0). | |
trait ActorMetrics extends Instrumented { actor: Actor => | |
metrics.gauge("mailbox size", self.id){actor.self.dispatcher.mailboxSize(actor.self)} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment