Class CloudWatchMetricStreamer
- java.lang.Object
-
- com.elastisys.autoscaler.metricstreamers.cloudwatch.CloudWatchMetricStreamer
-
- All Implemented Interfaces:
com.elastisys.autoscaler.core.api.Configurable<CloudWatchMetricStreamerConfig>,com.elastisys.autoscaler.core.api.Service<CloudWatchMetricStreamerConfig>,com.elastisys.autoscaler.core.monitoring.metricstreamer.api.MetricStreamer<CloudWatchMetricStreamerConfig>
public class CloudWatchMetricStreamer extends java.lang.Object implements com.elastisys.autoscaler.core.monitoring.metricstreamer.api.MetricStreamer<CloudWatchMetricStreamerConfig>
Implementation ofMetricStreamerthat uses AWS CloudWatch as its back-end metric source.
-
-
Constructor Summary
Constructors Constructor Description CloudWatchMetricStreamer(org.slf4j.Logger logger, java.util.concurrent.ScheduledExecutorService executor, com.elastisys.scale.commons.eventbus.EventBus eventBus)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(CloudWatchMetricStreamerConfig configuration)voidfetch()CloudWatchMetricStreamerConfiggetConfiguration()java.lang.Class<CloudWatchMetricStreamerConfig>getConfigurationClass()com.elastisys.autoscaler.core.monitoring.metricstreamer.api.MetricStreamgetMetricStream(java.lang.String metricStreamId)java.util.List<com.elastisys.autoscaler.core.monitoring.metricstreamer.api.MetricStream>getMetricStreams()com.elastisys.autoscaler.core.api.types.ServiceStatusgetStatus()voidstart()voidstop()voidvalidate(CloudWatchMetricStreamerConfig configuration)
-
-
-
Constructor Detail
-
CloudWatchMetricStreamer
@Inject public CloudWatchMetricStreamer(org.slf4j.Logger logger, java.util.concurrent.ScheduledExecutorService executor, com.elastisys.scale.commons.eventbus.EventBus eventBus)Creates a new instance. The new instance will be in an unconfigured and stopped state.- Parameters:
logger-Loggerto use.executor- Task execution service for performing work in separate threads.eventBus- TheEventBuson which to send out collectedMetricValues.
-
-
Method Detail
-
validate
public void validate(CloudWatchMetricStreamerConfig configuration) throws java.lang.IllegalArgumentException
- Specified by:
validatein interfacecom.elastisys.autoscaler.core.api.Configurable<CloudWatchMetricStreamerConfig>- Throws:
java.lang.IllegalArgumentException
-
configure
public void configure(CloudWatchMetricStreamerConfig configuration) throws java.lang.IllegalArgumentException
- Specified by:
configurein interfacecom.elastisys.autoscaler.core.api.Configurable<CloudWatchMetricStreamerConfig>- Throws:
java.lang.IllegalArgumentException
-
getConfiguration
public CloudWatchMetricStreamerConfig getConfiguration()
- Specified by:
getConfigurationin interfacecom.elastisys.autoscaler.core.api.Configurable<CloudWatchMetricStreamerConfig>
-
start
public void start() throws java.lang.IllegalStateException- Specified by:
startin interfacecom.elastisys.autoscaler.core.api.Service<CloudWatchMetricStreamerConfig>- Throws:
java.lang.IllegalStateException
-
stop
public void stop()
- Specified by:
stopin interfacecom.elastisys.autoscaler.core.api.Service<CloudWatchMetricStreamerConfig>
-
getStatus
public com.elastisys.autoscaler.core.api.types.ServiceStatus getStatus()
- Specified by:
getStatusin interfacecom.elastisys.autoscaler.core.api.Service<CloudWatchMetricStreamerConfig>
-
getConfigurationClass
public java.lang.Class<CloudWatchMetricStreamerConfig> getConfigurationClass()
- Specified by:
getConfigurationClassin interfacecom.elastisys.autoscaler.core.api.Configurable<CloudWatchMetricStreamerConfig>
-
getMetricStreams
public java.util.List<com.elastisys.autoscaler.core.monitoring.metricstreamer.api.MetricStream> getMetricStreams()
- Specified by:
getMetricStreamsin interfacecom.elastisys.autoscaler.core.monitoring.metricstreamer.api.MetricStreamer<CloudWatchMetricStreamerConfig>
-
fetch
public void fetch() throws com.elastisys.autoscaler.core.monitoring.metricstreamer.api.MetricStreamException, java.lang.IllegalStateException- Specified by:
fetchin interfacecom.elastisys.autoscaler.core.monitoring.metricstreamer.api.MetricStreamer<CloudWatchMetricStreamerConfig>- Throws:
com.elastisys.autoscaler.core.monitoring.metricstreamer.api.MetricStreamExceptionjava.lang.IllegalStateException
-
getMetricStream
public com.elastisys.autoscaler.core.monitoring.metricstreamer.api.MetricStream getMetricStream(java.lang.String metricStreamId) throws java.lang.IllegalArgumentException- Specified by:
getMetricStreamin interfacecom.elastisys.autoscaler.core.monitoring.metricstreamer.api.MetricStreamer<CloudWatchMetricStreamerConfig>- Throws:
java.lang.IllegalArgumentException
-
-