File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
moss-client/moss-client-2.x/src/main/java/org/xujin/moss/client/endpoint Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -53,19 +53,18 @@ public HaloMetricResponse HaloMetric() {
53
53
haloMetricResponse .setJvmMemoryUsedHeap (String .valueOf (jvmNemoryUsedHeap .getMeasurements ().get (0 ).getValue ()));
54
54
MetricResponse jvmNemoryUsedNonHeap =metric ("jvm.memory.used" , Arrays .asList ("area:nonheap" ) );
55
55
haloMetricResponse .setJvmMemoryUsedNonHeap (String .valueOf (jvmNemoryUsedNonHeap .getMeasurements ().get (0 ).getValue ()));
56
-
56
+ // 2.0 actuator/metrics 中没有这个key
57
57
MetricResponse systemLoadAverage =metric ("system.load.average.1m" , null );
58
- haloMetricResponse .setSystemloadAverage (String .valueOf (systemLoadAverage .getMeasurements ().get (0 ).getValue ()));
59
-
58
+ if (systemLoadAverage !=null ){
59
+ haloMetricResponse .setSystemloadAverage (String .valueOf (systemLoadAverage .getMeasurements ().get (0 ).getValue ()));
60
+ }
60
61
MetricResponse heapCommitted =metric ("jvm.memory.committed" , Arrays .asList ("area:heap" ) );
61
62
haloMetricResponse .setHeapCommitted (String .valueOf (heapCommitted .getMeasurements ().get (0 ).getValue ()));
62
63
MetricResponse nonheapCommitted =metric ("jvm.memory.committed" , Arrays .asList ("area:nonheap" ) );
63
64
haloMetricResponse .setNonheapCommitted (String .valueOf (nonheapCommitted .getMeasurements ().get (0 ).getValue ()));
64
65
65
66
MetricResponse heapMax =metric ("jvm.memory.max" , Arrays .asList ("area:heap" ) );
66
67
haloMetricResponse .setHeapMax (String .valueOf (heapMax .getMeasurements ().get (0 ).getValue ()));
67
-
68
-
69
68
getGcinfo (haloMetricResponse );
70
69
MemoryUsage memoryUsage = ManagementFactory .getMemoryMXBean ()
71
70
.getHeapMemoryUsage ();
You can’t perform that action at this time.
0 commit comments