概述
java性能采集工具。可采集进度内部的内存(堆,非堆,直接),cpu,句柄数,gc,日志(logback日志,分等级采集),也支持采集自定义指标,并提供http方法访问数据。http服务
/ runtime:运行时参数
/ metrics:prometheus采集数据
/ threads:线程线程
/ logs / recent:最近日志
/ logs / error:最近的错误日志通话方式
约会包com.dtstackcatcher0.0.1-SNAPSHOT启动服务
String address = "localhost:19222";//自定义端口ip
NetServer server = new NetServer(address);
server.start();关闭服务
server.stop();如果需要采集日志,logback.xml的appender中加入LogFilter"STDOUT" <filter class="com.dtstack.catcher.monitor.log.LogFilter"/> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <charset>${LOG_CHARSET}charset> <pattern>${LOG_PATTERN}pattern> encoder>appender>
如果需要采集自定义指标,目前支持prometheus的计数器方式和计量方式
(1)柜台方式
CounterMonitor.increase(String name, String labelNames, String labelValues, long delta);
(2)量规方式
GaugeMonitor.set(String name, String labelNames, String labelValues, long value);【文章来源】:
https://github.com/DTStack/catcher
推荐文章++++
![e3fe44eff36b0bd079b767e658750b4e.png](https://img-blog.csdnimg.cn/img_convert/e3fe44eff36b0bd079b767e658750b4e.png)
*Pythem – Python网络/渗透测试工具
*reko - 通用反编译工具
*dnsub一款好用的子域名扫描工具