Search in sources :

Example 1 with ProcessProbe

use of org.opensearch.monitor.process.ProcessProbe in project fess by codelibs.

the class SystemMonitorTarget method appendProcessStats.

private void appendProcessStats(final StringBuilder buf) {
    buf.append("\"process\":{");
    final ProcessProbe processProbe = ProcessProbe.getInstance();
    buf.append("\"file_descriptor\":{");
    append(buf, "open", () -> processProbe.getOpenFileDescriptorCount()).append(',');
    append(buf, "max", () -> processProbe.getMaxFileDescriptorCount());
    buf.append("},");
    buf.append("\"cpu\":{");
    append(buf, "percent", () -> processProbe.getProcessCpuPercent()).append(',');
    append(buf, "total", () -> processProbe.getProcessCpuTotalTime());
    buf.append("},");
    buf.append("\"virtual_memory\":{");
    append(buf, "total", () -> processProbe.getTotalVirtualMemorySize());
    buf.append('}');
    buf.append("},");
}
Also used : ProcessProbe(org.opensearch.monitor.process.ProcessProbe)

Aggregations

ProcessProbe (org.opensearch.monitor.process.ProcessProbe)1