当前位置: 软件>java软件
Netflix Servo
本文导语: Netflix Servo 用Java语言,提供暴露、发布应用运行指标的简单接口,主要满足的需求包括:使用JMX、简单、灵活发布。 示例代码: public class Server { @MonitorId private final String id; @Monitor(name="Status", type=INFORMATIONAL) priv...
Netflix Servo 用Java语言,提供暴露、发布应用运行指标的简单接口,主要满足的需求包括:使用JMX、简单、灵活发布。
示例代码:
public class Server {
@MonitorId
private final String id;
@Monitor(name="Status", type=INFORMATIONAL)
private AtomicReference status = new AtomicReference("UP");
@Monitor(name="CurrentConnections", type=GAUGE)
private AtomicInteger currentConnections = new AtomicInteger(0);
@Monitor(name="TotalConnections", type=COUNTER)
private AtomicInteger totalConnections = new AtomicInteger(0);
@Monitor(name="BytesIn", type=COUNTER)
private AtomicLong bytesIn = new AtomicLong(0L);
@Monitor(name="BytesOut", type=COUNTER)
private AtomicLong bytesOut = new AtomicLong(0L);
public Server(String id) {
this.id = id;
}
// ...
}
Server s1 = new Server("s1");
DefaultMonitorRegistry.getInstance().registerObject(s1);
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。