Package org.nuxeo.runtime.aws.cloudwatch
Class ScaleScheduledReporter
java.lang.Object
io.dropwizard.metrics5.ScheduledReporter
org.nuxeo.runtime.aws.cloudwatch.ScaleScheduledReporter
- All Implemented Interfaces:
io.dropwizard.metrics5.Reporter
,Closeable
,AutoCloseable
public class ScaleScheduledReporter
extends io.dropwizard.metrics5.ScheduledReporter
Reports nuxeo.streams.scale.metric as a CloudWatch metric: Nuxeo/Stream Scale, simulating CPU utilization with a
target value of 50%.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final software.amazon.awssdk.services.cloudwatch.CloudWatchClient
protected final List
<software.amazon.awssdk.services.cloudwatch.model.Dimension> static final String
static final String
protected static final io.dropwizard.metrics5.MetricFilter
static final String
protected final boolean
static final String
static final int
protected final boolean
static final String
-
Constructor Summary
ConstructorsConstructorDescriptionScaleScheduledReporter
(String awsConfigurationId, String tag, boolean stepMetric, boolean targetMetric, io.dropwizard.metrics5.MetricRegistry registry) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected Double
convertToTargetMetric
(int currentNodes, int diff) protected List
<software.amazon.awssdk.services.cloudwatch.model.Dimension> getDimensions
(String tag) void
report
(SortedMap<io.dropwizard.metrics5.MetricName, io.dropwizard.metrics5.Gauge> gauges, SortedMap<io.dropwizard.metrics5.MetricName, io.dropwizard.metrics5.Counter> counters, SortedMap<io.dropwizard.metrics5.MetricName, io.dropwizard.metrics5.Histogram> histograms, SortedMap<io.dropwizard.metrics5.MetricName, io.dropwizard.metrics5.Meter> meters, SortedMap<io.dropwizard.metrics5.MetricName, io.dropwizard.metrics5.Timer> timers) Methods inherited from class io.dropwizard.metrics5.ScheduledReporter
convertDuration, convertRate, getDisabledMetricAttributes, getDurationUnit, getRateUnit, isShutdownExecutorOnStop, report, start, start, stop
-
Field Details
-
METRIC_NAMESPACE
- See Also:
-
TARGET_METRIC_NAME
- See Also:
-
STEP_METRIC_NAME
- See Also:
-
SCALE_METRIC
- See Also:
-
WORKER_COUNT_METRIC
- See Also:
-
TARGET_VALUE
public static final int TARGET_VALUE- See Also:
-
SCALE_METRIC_FILTER
protected static final io.dropwizard.metrics5.MetricFilter SCALE_METRIC_FILTER -
cloudWatchClient
protected final software.amazon.awssdk.services.cloudwatch.CloudWatchClient cloudWatchClient -
dimensions
-
stepMetric
protected final boolean stepMetric -
targetMetric
protected final boolean targetMetric
-
-
Constructor Details
-
ScaleScheduledReporter
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classio.dropwizard.metrics5.ScheduledReporter
-
getDimensions
-
report
public void report(SortedMap<io.dropwizard.metrics5.MetricName, io.dropwizard.metrics5.Gauge> gauges, SortedMap<io.dropwizard.metrics5.MetricName, io.dropwizard.metrics5.Counter> counters, SortedMap<io.dropwizard.metrics5.MetricName, io.dropwizard.metrics5.Histogram> histograms, SortedMap<io.dropwizard.metrics5.MetricName, io.dropwizard.metrics5.Meter> meters, SortedMap<io.dropwizard.metrics5.MetricName, io.dropwizard.metrics5.Timer> timers) - Specified by:
report
in classio.dropwizard.metrics5.ScheduledReporter
-
convertToTargetMetric
-