From 4243a7f5eea20345c61731c51e9eeb734b9f2552 Mon Sep 17 00:00:00 2001 From: Mark Nellemann Date: Tue, 14 Sep 2021 09:00:34 +0200 Subject: [PATCH] In base-process - skip short-lived processed to not clutter the influx database. --- .../java/sysmon/plugins/os_base/BaseProcessExtension.java | 7 +++++++ 1 file changed, 7 insertions(+) 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 e6e9317..cfdf84a 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 @@ -30,8 +30,10 @@ public class BaseProcessExtension implements MetricExtension { add("influxd"); }}; + private final long minUptimeInSeconds = 300; private SystemInfo systemInfo; + @Override public boolean isEnabled() { return enabled; @@ -82,6 +84,11 @@ public class BaseProcessExtension implements MetricExtension { continue; } + // Skip short-lived processes + if(p.getUpTime() < (minUptimeInSeconds * 1000)) { + continue; + } + String name = p.getName(); if(!includeList.contains(name)) { continue;