From 6e98ebe67609063d3851f3c700d961805d07ddec Mon Sep 17 00:00:00 2001 From: Manu Date: Mon, 22 Aug 2016 10:04:27 +0200 Subject: [PATCH] Added Scheduler API support, Frequency and typo fix --- .../openstack-ceilometer/config/openstack-ceilometer.conf | 2 +- .../src/main/java/ch/icclab/cyclops/application/Main.java | 2 +- .../src/main/java/ch/icclab/cyclops/application/Service.java | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/collectors/openstack-ceilometer/config/openstack-ceilometer.conf b/collectors/openstack-ceilometer/config/openstack-ceilometer.conf index 41120cb..fc908ad 100644 --- a/collectors/openstack-ceilometer/config/openstack-ceilometer.conf +++ b/collectors/openstack-ceilometer/config/openstack-ceilometer.conf @@ -19,7 +19,7 @@ PublisherUsername=guest PublisherPassword=guest PublisherPort=5672 PublisherVirtualHost=/ -PublisherBroadcastExchange=cylops.ceilometer.collector.broadcast +PublisherBroadcastExchange=cyclops.ceilometer.collector.broadcast PublisherDispatchExchange=cyclops.ceilometer.collector.dispatch # Hibernate connection credentials diff --git a/collectors/openstack-ceilometer/src/main/java/ch/icclab/cyclops/application/Main.java b/collectors/openstack-ceilometer/src/main/java/ch/icclab/cyclops/application/Main.java index c71f948..cc5eee3 100644 --- a/collectors/openstack-ceilometer/src/main/java/ch/icclab/cyclops/application/Main.java +++ b/collectors/openstack-ceilometer/src/main/java/ch/icclab/cyclops/application/Main.java @@ -289,7 +289,7 @@ private static void checkAndStartServer(Component component) { // also start collection immediately Scheduler scheduler = Scheduler.getInstance(); int frequency = Loader.getSettings().getSchedulerSettings().getFrequency(); - scheduler.addRunner(new OpenStackCeilometerClient(), 0, 600, TimeUnit.SECONDS); + scheduler.addRunner(new OpenStackCeilometerClient(), 0, frequency, TimeUnit.SECONDS); scheduler.start(); outputProgressBar(NO_EMPTY_LINE, EMPTY_LINE); diff --git a/collectors/openstack-ceilometer/src/main/java/ch/icclab/cyclops/application/Service.java b/collectors/openstack-ceilometer/src/main/java/ch/icclab/cyclops/application/Service.java index f3beee2..7e6c82f 100644 --- a/collectors/openstack-ceilometer/src/main/java/ch/icclab/cyclops/application/Service.java +++ b/collectors/openstack-ceilometer/src/main/java/ch/icclab/cyclops/application/Service.java @@ -1,6 +1,7 @@ package ch.icclab.cyclops.application; import ch.icclab.cyclops.endpoint.RootEndpoint; +import ch.icclab.cyclops.endpoint.SchedulerEndpoint; import ch.icclab.cyclops.endpoint.StatusEndpoint; import ch.icclab.cyclops.load.Loader; import ch.icclab.cyclops.load.Settings; @@ -72,6 +73,9 @@ public Restlet createInboundRoot() { router.attach(StatusEndpoint.ENDPOINT, StatusEndpoint.class); counter.registerEndpointWithoutCounting(StatusEndpoint.ENDPOINT); + router.attach(SchedulerEndpoint.ENDPOINT, SchedulerEndpoint.class); + counter.registerEndpoint(SchedulerEndpoint.ENDPOINT); + logger.trace("Routes for OpenStack collector microservice successfully created");