[翻译]squbs官网之14 运行时监控Actor

概述

squbs-actormonitor 模块在actor系统中为每一个actor进行监控。对于大量的actor,这可能会引起干扰。通过application.conf可以配置监控的actor数目。在生产中使用附加此模块的判断。此模块没有用户 API。

依赖

在build.sbt 或Scala构建文件添加如下依赖:

"org.squbs" %% "squbs-actormonitor" % squbsVersion

监控

每一个actor都有一个相关的JMXBean(org.squbs.unicomplex:type=ActorMonitor,name=%actorPath)来公开actor信息:

 trait ActorMonitorMXBean {
  def getActor: String
  def getClassName: String
  def getRouteConfig : String
  def getParent: String
  def getChildren: String
  def getDispatcher : String
  def getMailBoxSize : String
}

配置

下面是squbs-actormonitor的配置项:

squbs-actormonitor = {
  maxActorCount = 500
  maxChildrenDisplay = 20
}

JMX Beanorg.squbs.unicomplex:type=ActorMonitor公开了Actor监控的配置。JMX Bean是只读的。

trait ActorMonitorConfigMXBean {
  def getCount : Int                //Count of JMX bean has been created 
  def getMaxCount: Int              //Maximum JMX bean can be created
  def getMaxChildrenDisplay: Int        //Per each actor, maximum children can be exposed 
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容