diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f1f81a..77e7157 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [1.1.0] - 2022-12-17 +- Lower influx time precision from milliseconds to seconds + - requires you to update server and clients to this version. +- Update *oshi* dependency (for AIX improvements). + + ## [1.0.24] - 2022-11-16 - Fix incorrect use of OSHI getDiskStores() - Update dashboards @@ -40,6 +46,7 @@ All notable changes to this project will be documented in this file. ### Changed - Updated 3rd party dependencies. +[1.1.0]: https://bitbucket.org/mnellemann/sysmon/branches/compare/v1.1.0%0Dv0.1.24 [1.0.24]: https://bitbucket.org/mnellemann/sysmon/branches/compare/v1.0.24%0Dv0.1.23 [1.0.23]: https://bitbucket.org/mnellemann/sysmon/branches/compare/v1.0.23%0Dv0.1.21 [1.0.21]: https://bitbucket.org/mnellemann/sysmon/branches/compare/v1.0.21%0Dv0.1.18 diff --git a/gradle.properties b/gradle.properties index 6d5273d..3ae92d7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,9 @@ -version = 1.0.25 +version = 1.1.0 pf4jVersion = 3.7.0 -slf4jVersion = 2.0.4 +slf4jVersion = 2.0.5 camelVersion = 3.14.5 groovyVersion = 3.0.13 picocliVersion = 4.7.0 -oshiVersion = 6.3.2 +oshiVersion = 6.4.0 spockVersion = 2.3-groovy-3.0 tomljVersion = 1.1.0 diff --git a/server/src/main/java/sysmon/server/ComboResultToPointProcessor.java b/server/src/main/java/sysmon/server/ComboResultToPointProcessor.java index b9c3eee..70d6928 100644 --- a/server/src/main/java/sysmon/server/ComboResultToPointProcessor.java +++ b/server/src/main/java/sysmon/server/ComboResultToPointProcessor.java @@ -26,14 +26,14 @@ public class ComboResultToPointProcessor implements Processor { BatchPoints.Builder batchPoints = BatchPoints .database(ComboResultToPointProcessor.influxDbName) - .precision(TimeUnit.MILLISECONDS); + .precision(TimeUnit.SECONDS); for(MetricResult metricResult : comboResult.getMetricResults()) { for(Measurement measurement : metricResult.getMeasurements()) { Point.Builder point = Point.measurement(metricResult.getName()) - .time(metricResult.getTimestamp(), TimeUnit.MILLISECONDS) + .time(metricResult.getTimestamp(), TimeUnit.SECONDS) .tag("hostname", metricResult.getHostname()) .tag(measurement.getTags()) .fields(measurement.getFields()); diff --git a/server/src/main/java/sysmon/server/MetricResultToPointProcessor.java b/server/src/main/java/sysmon/server/MetricResultToPointProcessor.java index 7798105..d95240e 100644 --- a/server/src/main/java/sysmon/server/MetricResultToPointProcessor.java +++ b/server/src/main/java/sysmon/server/MetricResultToPointProcessor.java @@ -29,46 +29,18 @@ public class MetricResultToPointProcessor implements Processor { BatchPoints.Builder batchPoints = BatchPoints .database(MetricResultToPointProcessor.influxDbName) - .precision(TimeUnit.MILLISECONDS) + .precision(TimeUnit.SECONDS) .tag("hostname", metricResult.getHostname()); for(Measurement measurement : measurementList) { Point.Builder point = Point.measurement(metricResult.getName()) - .time(metricResult.getTimestamp(), TimeUnit.MILLISECONDS) + .time(metricResult.getTimestamp(), TimeUnit.SECONDS) .fields(measurement.getFields()) .tag(measurement.getTags()); - /* - for (Map.Entry entry : measurement.getTags().entrySet()) { - //log.info("process() - tag: " + entry.getKey() + "=" + entry.getValue()); - point.tag(entry.getKey(), entry.getValue()); - }*/ - - /* - for (Map.Entry entry : measurement.getFields().entrySet()) { - //log.info("process() - field: " + entry.getKey() + "=" + entry.getValue()); - if(entry.getValue() instanceof Float) { - float num = (float) entry.getValue(); - point.addField(entry.getKey(), num); - } else if(entry.getValue() instanceof Long) { - long num = (long) entry.getValue(); - point.addField(entry.getKey(), num); - } else if(entry.getValue() instanceof Integer) { - int num = (int) entry.getValue(); - point.addField(entry.getKey(), num); - } else if(entry.getValue() instanceof Boolean) { - boolean bol = (Boolean) entry.getValue(); - point.addField(entry.getKey(), bol); - } else if(entry.getValue() instanceof Number) { - Number num = (Number) entry.getValue(); - point.addField(entry.getKey(), num); - } else { - String str = (String) entry.getValue(); - point.addField(entry.getKey(), str); - } - }*/ batchPoints.point(point.build()); + } exchange.getIn().setBody(batchPoints.build()); diff --git a/shared/src/main/java/sysmon/shared/MetricResult.java b/shared/src/main/java/sysmon/shared/MetricResult.java index 3d0d0a3..8df2f6d 100644 --- a/shared/src/main/java/sysmon/shared/MetricResult.java +++ b/shared/src/main/java/sysmon/shared/MetricResult.java @@ -10,7 +10,7 @@ public class MetricResult implements Serializable { private String name; private String hostname; - private Long timestamp; // epoch milli + private Long timestamp; // epoch seconds private ArrayList measurements; public MetricResult() { @@ -18,12 +18,12 @@ public class MetricResult implements Serializable { public MetricResult(String name) { this.name = name; - this.timestamp = Instant.now().toEpochMilli(); + this.timestamp = Instant.now().getEpochSecond(); } public MetricResult(String name, Measurement measurement) { this.name = name; - this.timestamp = Instant.now().toEpochMilli(); + this.timestamp = Instant.now().getEpochSecond(); this.measurements = new ArrayList() {{ add(measurement); }}; @@ -31,7 +31,7 @@ public class MetricResult implements Serializable { public MetricResult(String name, ArrayList measurements) { this.name = name; - this.timestamp = Instant.now().toEpochMilli(); + this.timestamp = Instant.now().getEpochSecond(); this.measurements = measurements; } @@ -85,5 +85,5 @@ public class MetricResult implements Serializable { return sb.toString(); } - + }