如何在Akka中检查收件箱中的邮件有多长时间?如果邮件在收件箱中的时间过长,我想发送一条日志邮件。就像是:
override def receive: Receive = {
case Message =>
val timeInInbox = ...
if (timeInInbox > treshold) log.warn("bla bla bla the doom is coming")
最佳答案
有可用的度量标准/遥测库可以提供此信息。
一种是kamon.io(开源),它为您提供了“邮箱时间”指标,请参阅http://kamon.io/documentation/kamon-akka/0.6.6/actor-router-and-dispatcher-metrics/
另一个(非免费,封闭源代码)是“Lightbend Telemetry”,它称为“邮箱时间”,请参阅http://developer.lightbend.com/docs/monitoring/latest/instrumentations/akka/akka.html#actor-metrics
关于scala - Akka-如何检查收件箱中的邮件有多长时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29800432/