加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

scala – Akka – 如何检查邮件在收件箱中的时长?

发布时间:2020-12-16 18:36:24 所属栏目:安全 来源:网络整理
导读:如何检查akka收件箱中的邮件有多长?如果邮件在收件箱中的时间太长,我想发一条日志消息.就像是: override def receive: Receive = { case Message = val timeInInbox = ... if (timeInInbox treshold) log.warn("bla bla bla the doom is coming") 解决方法
如何检查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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读