Guest User

Untitled

a guest
Oct 21st, 2019
79
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. trait LatencyRecorderActor extends Actor with StrictLogging {
  2. val actorName: String = this.getClass.getSimpleName
  3.  
  4. abstract override def receive: Receive = {
  5. case recordableMessage: RecordableMessage =>
  6. Monitor.record("time-in-mailbox", actorName, recordableMessage.messageName,
  7. recordableMessage.dispatchTime)
  8. val start = System.currentTimeMillis()
  9. super.receive(recordableMessage)
  10. Monitor.record("processing-time", actorName, recordableMessage.messageName, start)
  11. case message => super.receive(message)
  12. }
  13. }
RAW Paste Data