Commit 43ea1d49 authored by Sören Henning's avatar Sören Henning

minor fixes

parent 62230c92
......@@ -54,6 +54,8 @@ public class AnomalyDetectionConfiguration extends Configuration {
super.connectPorts(anomalyDetector.getNewOutputPort(), printer.getInputPort());
super.connectPorts(anomalyDetector.getNewOutputPort(), jsonExporter.getInputPort());
// cluster.close();
}
}
......@@ -6,25 +6,26 @@ public class AnomalyDetectionTool {
public static void main(final String[] args) {
/*
* String ipAddress = "192.168.99.100";
* int port = 32770;
* String keyspace = "demo3";
*
* Cluster cluster = Cluster.builder().addContactPoint(ipAddress).withPort(port).build();
* Session session = cluster.connect(keyspace);
*
* CassandraDriver cassandraDriver = new CassandraDriver(session, "measurements");
* cassandraDriver.storeMeasurement("abc", new AnomalyScoredMeasurement(Instant.now(), 1200, 1100, 0.11));
* cassandraDriver.storeMeasurement("abc", new AnomalyScoredMeasurement(Instant.now(), 1150, 1000, 0.12));
* cassandraDriver.storeMeasurement("abc", new AnomalyScoredMeasurement(Instant.now(), 1150, 1200, 0.13));
* cassandraDriver.storeMeasurement("abc", new AnomalyScoredMeasurement(Instant.now(), 1200, 1100, 0.12));
*
* TimeSeries timeSeries = cassandraDriver.retrieveTimeSeries("abc", Instant.now().minusSeconds(60 * 60), Instant.now());
* System.out.println(timeSeries);
*
* session.close();
*/
// String ipAddress = "192.168.99.100";
// int port = 32770;
// String keyspace = "demo3";
//
// Cluster cluster = Cluster.builder().addContactPoint(ipAddress).withPort(port).build();
// Session session = cluster.connect(keyspace);
//
// CassandraDriver cassandraDriver = new CassandraDriver(session, "measurements");
// cassandraDriver.storeMeasurement("abc", new AnomalyScoredMeasurement(Instant.now(), 1200, 1100, 0.11));
// cassandraDriver.storeMeasurement("abc", new AnomalyScoredMeasurement(Instant.now(), 1150, 1000, 0.12));
// cassandraDriver.storeMeasurement("abc", new AnomalyScoredMeasurement(Instant.now(), 1150, 1200, 0.13));
// cassandraDriver.storeMeasurement("abc", new AnomalyScoredMeasurement(Instant.now(), 1200, 1100, 0.12));
//
// TimeSeries timeSeries = cassandraDriver.retrieveTimeSeries("abc", Instant.now().minusSeconds(60 * 60), Instant.now());
// System.out.println(timeSeries);
//
// cassandraDriver.storeMeasurement("abc", new AnomalyScoredMeasurement(Instant.now(), 1300, 1000, 0.14));
// cassandraDriver.storeMeasurement("abc", new AnomalyScoredMeasurement(Instant.now(), 1350, 1050, 0.13));
//
// session.close();
final AnomalyDetectionConfiguration configuration = new AnomalyDetectionConfiguration();
final Execution<AnomalyDetectionConfiguration> analysis = new Execution<AnomalyDetectionConfiguration>(configuration);
......
......@@ -12,8 +12,8 @@ public class StorableAnomalyDetectionStage extends AnomalyDetectionStage {
public StorableAnomalyDetectionStage(final Duration slidingWindowDuration, final Duration normalizationDuration, final Aggregator aggregator,
final Forecaster forecaster, final StorageDriver storageDriver) {
super(new BoundedTimeSeries(slidingWindowDuration, storageDriver.retrieveTimeSeries("abc", Instant.now().minus(slidingWindowDuration), Instant.now())),
normalizationDuration, aggregator, forecaster);
super(new BoundedTimeSeries(slidingWindowDuration, storageDriver.retrieveTimeSeries("temp", Instant.now().minus(slidingWindowDuration), Instant.now())),
normalizationDuration, aggregator, forecaster); // TODO temp seriesID
final StorageStage storageStage = new StorageStage(storageDriver);
super.connectPorts(super.getNewOutputPort(), storageStage.getInputPort());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment