diff --git a/doc/monitoring-eye-svgrepo-com.png b/doc/monitoring-eye-svgrepo-com.png new file mode 100644 index 0000000..8c022ed Binary files /dev/null and b/doc/monitoring-eye-svgrepo-com.png differ diff --git a/doc/monitoring-eye-svgrepo-com.svg b/doc/monitoring-eye-svgrepo-com.svg new file mode 100644 index 0000000..afac18f --- /dev/null +++ b/doc/monitoring-eye-svgrepo-com.svg @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/main/java/sysmon/server/Application.java b/server/src/main/java/sysmon/server/Application.java index 1b4c8e7..e95b5e7 100644 --- a/server/src/main/java/sysmon/server/Application.java +++ b/server/src/main/java/sysmon/server/Application.java @@ -32,7 +32,7 @@ public class Application implements Callable { private Integer listenPort = 9925; @CommandLine.Option(names = { "-t", "--threads" }, description = "Threads for processing inbound metrics(default: ${DEFAULT-VALUE}).", paramLabel = "") - private Integer threads = 5; + private Integer threads = 1; @CommandLine.Option(names = { "-d", "--debug" }, description = "Enable debugging (default: ${DEFAULT_VALUE}).") private boolean enableDebug = false; diff --git a/server/src/main/java/sysmon/server/ComboResultToPointProcessor.java b/server/src/main/java/sysmon/server/ComboResultToPointProcessor.java index 5cbfbd6..a8c4f33 100644 --- a/server/src/main/java/sysmon/server/ComboResultToPointProcessor.java +++ b/server/src/main/java/sysmon/server/ComboResultToPointProcessor.java @@ -4,19 +4,15 @@ import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.influxdb.dto.BatchPoints; import org.influxdb.dto.Point; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import sysmon.shared.ComboResult; import sysmon.shared.Measurement; import sysmon.shared.MetricResult; -import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; public class ComboResultToPointProcessor implements Processor { - private static final Logger log = LoggerFactory.getLogger(ComboResultToPointProcessor.class); private static String influxDbName; ComboResultToPointProcessor(String influxDbName) { @@ -24,22 +20,17 @@ public class ComboResultToPointProcessor implements Processor { } @Override - public void process(Exchange exchange) throws Exception { + public void process(Exchange exchange) { ComboResult comboResult = exchange.getIn().getBody(ComboResult.class); - //MetricResult metricResult = exchange.getIn().getBody(MetricResult.class); - - //log.info("Size of measurements: " + measurementList.size()); BatchPoints.Builder batchPoints = BatchPoints .database(ComboResultToPointProcessor.influxDbName) .precision(TimeUnit.MILLISECONDS); - List results = comboResult.getMetricResults(); - for(MetricResult metricResult : results) { + for(MetricResult metricResult : comboResult.getMetricResults()) { - List measurementList = metricResult.getMeasurements(); - for(Measurement measurement : measurementList) { + for(Measurement measurement : metricResult.getMeasurements()) { Point.Builder point = Point.measurement(metricResult.getName()) .time(metricResult.getTimestamp(), TimeUnit.MILLISECONDS) @@ -65,6 +56,7 @@ public class ComboResultToPointProcessor implements Processor { } batchPoints.point(point.build()); } + } exchange.getIn().setBody(batchPoints.build()); diff --git a/server/src/main/java/sysmon/server/MetricResultToPointProcessor.java b/server/src/main/java/sysmon/server/MetricResultToPointProcessor.java index 7afafd0..70216f5 100644 --- a/server/src/main/java/sysmon/server/MetricResultToPointProcessor.java +++ b/server/src/main/java/sysmon/server/MetricResultToPointProcessor.java @@ -4,8 +4,6 @@ import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.influxdb.dto.BatchPoints; import org.influxdb.dto.Point; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import sysmon.shared.Measurement; import sysmon.shared.MetricResult; @@ -15,7 +13,6 @@ import java.util.concurrent.TimeUnit; public class MetricResultToPointProcessor implements Processor { - private static final Logger log = LoggerFactory.getLogger(MetricResultToPointProcessor.class); private static String influxDbName; MetricResultToPointProcessor(String influxDbName) {