Class JmxMonitor
java.lang.Object
services.moleculer.monitor.Monitor
services.moleculer.monitor.JmxMonitor
JMX-based System Monitor (queries the "SystemCpuLoad" attribute of the
operating-system MXBean).
-
Field Summary
FieldsFields inherited from class Monitor
cachedCPU, cachedPID, cacheTimeout, cpuDetectedAt, invalidMonitor, logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected longReturns the system CPU usage, in percents, between 0 and 100.protected intReturns the system CPU usage, in percents, between 0 and 100.Methods inherited from class Monitor
getPID, getTotalCpuPercent
-
Field Details
-
server
-
name
-
-
Constructor Details
-
JmxMonitor
public JmxMonitor()
-
-
Method Details
-
detectTotalCpuPercent
Returns the system CPU usage, in percents, between 0 and 100.- Specified by:
detectTotalCpuPercentin classMonitor- Returns:
- total CPU usage of the current OS
- Throws:
Exception- any I/O or missing DLL exception
-
detectPID
-