Skip to content

Commit

Permalink
netty直接内存监控
Browse files Browse the repository at this point in the history
  • Loading branch information
liuganghuan committed Jul 13, 2023
1 parent 69ba6f0 commit ab8bcb3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ proxy_out_rate{host="localhost",} 23967
# HELP proxy_in_rate 下行网速
# TYPE proxy_in_rate gauge
proxy_in_rate{host="localhost",} 5758
# HELP direct_memory_total netty直接内存 对于jdk9+,请增加-Dio.netty.tryReflectionSetAccessible=true,对应jdk16+,请增加--add-opens java.base/java.nio=ALL-UNNAMED
# HELP direct_memory_total netty直接内存 对于jdk9+,请增加-Dio.netty.tryReflectionSetAccessible=true,对于jdk16+,请增加--add-opens java.base/java.nio=ALL-UNNAMED
# TYPE direct_memory_total gauge
direct_memory_total{host="localhost",} 33554439
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public String metrics() {
metrics.add(new Metric<>(MetricType.counter, "下行流量", "proxy_in", GlobalTrafficMonitor.getInstance().inTotal).tag("host", hostname));
metrics.add(new Metric<>(MetricType.gauge, "上行网速", "proxy_out_rate", GlobalTrafficMonitor.getInstance().outRate).tag("host", hostname));
metrics.add(new Metric<>(MetricType.gauge, "下行网速", "proxy_in_rate", GlobalTrafficMonitor.getInstance().inRate).tag("host", hostname));
metrics.add(new Metric<>(MetricType.gauge, "netty直接内存 对于jdk9+,请增加-Dio.netty.tryReflectionSetAccessible=true,对应jdk16+,请增加--add-opens java.base/java.nio=ALL-UNNAMED", "direct_memory_total", nettyUsedDirectMemory()).tag("host", hostname));
metrics.add(new Metric<>(MetricType.gauge, "netty直接内存 对于jdk9+,请增加-Dio.netty.tryReflectionSetAccessible=true,对于jdk16+,请增加--add-opens java.base/java.nio=ALL-UNNAMED", "direct_memory_total", nettyUsedDirectMemory()).tag("host", hostname));
metrics.add(new Metric<>(MetricType.gauge, "堆内存使用量", "heap_memory_usage", heapMemoryUsage.getUsed()).tag("host", hostname));
metrics.add(new Metric<>(MetricType.gauge, "堆内存容量", "heap_memory_committed", heapMemoryUsage.getCommitted()).tag("host", hostname));
metrics.add(new Metric<>(MetricType.gauge, "非堆内存使用量", "nonheap_memory_usage", nonHeapMemoryUsage.getUsed()).tag("host", hostname));
Expand Down

0 comments on commit ab8bcb3

Please sign in to comment.