From b8eaafad7e3fd443bfc7f44bc9f34b860d13d04b Mon Sep 17 00:00:00 2001 From: Mark Nellemann Date: Mon, 6 Sep 2021 12:41:17 +0200 Subject: [PATCH] Cleanup and version bump. --- client/build.gradle | 1 + gradle.properties | 4 ++-- .../plugins/os_base/BaseProcessExtension.java | 14 ++++++++------ server/build.gradle | 3 +-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/client/build.gradle b/client/build.gradle index 2f4edf6..e7f062e 100644 --- a/client/build.gradle +++ b/client/build.gradle @@ -37,6 +37,7 @@ def projectName = "sysmon-client" application { // Define the main class for the application. mainClass.set('sysmon.client.Application') + applicationDefaultJvmArgs = [ "-server", "-Xms32m", "-Xmx32m" ] } run { diff --git a/gradle.properties b/gradle.properties index 73e8f63..6d784a9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ -version=0.0.7 +version=0.0.8 pf4jVersion=3.6.0 slf4jVersion=1.7.32 -camelVersion=3.11.0 +camelVersion=3.11.1 picocliVersion=4.6.1 oshiVersion=5.8.1 \ No newline at end of file diff --git a/plugins/os-base/src/main/java/sysmon/plugins/os_base/BaseProcessExtension.java b/plugins/os-base/src/main/java/sysmon/plugins/os_base/BaseProcessExtension.java index 94b05ea..2612486 100644 --- a/plugins/os-base/src/main/java/sysmon/plugins/os_base/BaseProcessExtension.java +++ b/plugins/os-base/src/main/java/sysmon/plugins/os_base/BaseProcessExtension.java @@ -18,9 +18,15 @@ public class BaseProcessExtension implements MetricExtension { private static final Logger log = LoggerFactory.getLogger(BaseProcessorExtension.class); + // TODO: configurable include-list and/or exclude-list of process names private final List includeList = new ArrayList() {{ add("java"); + add("nginx"); add("influxd"); + add("dockerd"); + add("containerd"); + add("mysqld"); + add("postgres"); add("grafana-server"); }}; @@ -51,8 +57,6 @@ public class BaseProcessExtension implements MetricExtension { @Override public MetricResult getMetrics() { - // TODO: include-list and/or exclude-list of process names - ArrayList measurementList = new ArrayList<>(); List processList = systemInfo.getOperatingSystem().getProcesses(); @@ -67,17 +71,15 @@ public class BaseProcessExtension implements MetricExtension { if(!includeList.contains(name)) { continue; } - log.info("pid: " + p.getProcessID() + ", name: " + name + ", virt: " + p.getVirtualSize() + " rss: " + p.getResidentSetSize()); - - //log.info(p.getProcessID() + " (" + p.getParentProcessID() + ") " + p.getName() + " " + p.getPath()); + log.debug("pid: " + p.getProcessID() + ", name: " + name + ", virt: " + p.getVirtualSize() + " rss: " + p.getResidentSetSize()); HashMap tagsMap = new HashMap<>(); HashMap fieldsMap = new HashMap<>(); tagsMap.put("pid", String.valueOf(p.getProcessID())); tagsMap.put("name", name); + //tagsMap.put("path", p.getPath()); - fieldsMap.put("path", p.getPath()); fieldsMap.put("mem_rss", p.getResidentSetSize()); fieldsMap.put("mem_virt", p.getVirtualSize()); fieldsMap.put("kernel_time", p.getKernelTime()); diff --git a/server/build.gradle b/server/build.gradle index ffa0468..5a6ecaa 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -18,8 +18,6 @@ dependencies { implementation group: 'org.apache.camel', name: 'camel-core', version: camelVersion implementation group: 'org.apache.camel', name: 'camel-main', version: camelVersion implementation group: 'org.apache.camel', name: 'camel-rest', version: camelVersion - //implementation group: 'org.apache.camel', name: 'camel-jetty', version: camelVersion - //implementation group: 'org.apache.camel', name: 'camel-stream', version: camelVersion implementation group: 'org.apache.camel', name: 'camel-jackson', version: camelVersion implementation group: 'org.apache.camel', name: 'camel-influxdb', version: camelVersion implementation group: 'org.apache.camel', name: 'camel-netty-http', version: camelVersion @@ -30,6 +28,7 @@ def projectName = "sysmon-server" application { // Define the main class for the application. mainClass.set('sysmon.server.Application') + applicationDefaultJvmArgs = [ "-server", "-Xms128m", "-Xmx128m" ] } tasks.named('test') {