|
@@ -14,14 +14,14 @@ import net.p0f.openshift.metrics.model.SysstatMeasurement;
|
|
@ApplicationScoped
|
|
@ApplicationScoped
|
|
@Named("sysstatMetrics")
|
|
@Named("sysstatMetrics")
|
|
public class SysstatMetrics {
|
|
public class SysstatMetrics {
|
|
- static final Logger LOG = Logger.getLogger(SysstatMeasurement.class.getName());
|
|
|
|
|
|
+ static final Logger LOG = Logger.getLogger(SysstatMetrics.class.getName());
|
|
|
|
|
|
@Inject
|
|
@Inject
|
|
MeterRegistry mr;
|
|
MeterRegistry mr;
|
|
|
|
|
|
SysstatMeasurement lastMeasurement = null;
|
|
SysstatMeasurement lastMeasurement = null;
|
|
|
|
|
|
- public boolean isRecordValid(SysstatMeasurement sm) {
|
|
|
|
|
|
+ public static boolean isRecordValid(SysstatMeasurement sm) {
|
|
LOG.fine("Checking record validity of " + sm);
|
|
LOG.fine("Checking record validity of " + sm);
|
|
|
|
|
|
String nullMetrics = "";
|
|
String nullMetrics = "";
|
|
@@ -66,12 +66,7 @@ public class SysstatMetrics {
|
|
nullMetrics.replaceFirst(", $", "");
|
|
nullMetrics.replaceFirst(", $", "");
|
|
LOG.fine("Validity check result: \"" + nullMetrics + "\"");
|
|
LOG.fine("Validity check result: \"" + nullMetrics + "\"");
|
|
|
|
|
|
- if (nullMetrics.length() != 0) {
|
|
|
|
- LOG.severe("Null sysstat fields, rejecting record: " + nullMetrics);
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return true;
|
|
|
|
|
|
+ return nullMetrics.length() == 0;
|
|
}
|
|
}
|
|
|
|
|
|
public void processMetricRecord(SysstatMeasurement sm) {
|
|
public void processMetricRecord(SysstatMeasurement sm) {
|