In base-process - skip short-lived processed to not clutter the influx database.

This commit is contained in:
Mark Nellemann 2021-09-14 09:00:34 +02:00
parent ea5d17bc5c
commit 4243a7f5ee

View file

@ -30,8 +30,10 @@ public class BaseProcessExtension implements MetricExtension {
add("influxd"); add("influxd");
}}; }};
private final long minUptimeInSeconds = 300;
private SystemInfo systemInfo; private SystemInfo systemInfo;
@Override @Override
public boolean isEnabled() { public boolean isEnabled() {
return enabled; return enabled;
@ -82,6 +84,11 @@ public class BaseProcessExtension implements MetricExtension {
continue; continue;
} }
// Skip short-lived processes
if(p.getUpTime() < (minUptimeInSeconds * 1000)) {
continue;
}
String name = p.getName(); String name = p.getName();
if(!includeList.contains(name)) { if(!includeList.contains(name)) {
continue; continue;