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 Details

    • METRIC_NAMESPACE

      public static final String METRIC_NAMESPACE
      See Also:
    • TARGET_METRIC_NAME

      public static final String TARGET_METRIC_NAME
      See Also:
    • STEP_METRIC_NAME

      public static final String STEP_METRIC_NAME
      See Also:
    • SCALE_METRIC

      public static final String SCALE_METRIC
      See Also:
    • WORKER_COUNT_METRIC

      public static final String 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

      protected final List<software.amazon.awssdk.services.cloudwatch.model.Dimension> dimensions
    • stepMetric

      protected final boolean stepMetric
    • targetMetric

      protected final boolean targetMetric
  • Constructor Details

    • ScaleScheduledReporter

      public ScaleScheduledReporter(String awsConfigurationId, String tag, boolean stepMetric, boolean targetMetric, io.dropwizard.metrics5.MetricRegistry registry)
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class io.dropwizard.metrics5.ScheduledReporter
    • getDimensions

      protected List<software.amazon.awssdk.services.cloudwatch.model.Dimension> getDimensions(String tag)
    • 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 class io.dropwizard.metrics5.ScheduledReporter
    • convertToTargetMetric

      protected Double convertToTargetMetric(int currentNodes, int diff)