Class MetricUtils


  • public class MetricUtils
    extends Object
    Helper which prepares and filters Cloudwatch Metrics requests.
    • Method Detail

      • applyMetricConstraints

        protected static boolean applyMetricConstraints​(ConstraintEvaluator evaluator,
                                                        software.amazon.awssdk.services.cloudwatch.model.Metric metric,
                                                        String statistic)
        Filters metrics who have at least 1 metric dimension that matches DIMENSION_NAME_FIELD and DIMENSION_VALUE_FIELD filters. This is just an optimization and isn't fully correct. We depend on the calling engine to apply full constraints. Also filters metric name and namespace.
        Returns:
        True if the supplied metric contains at least 1 Dimension matching the evaluator.
      • pushDownPredicate

        protected static void pushDownPredicate​(Constraints constraints,
                                                software.amazon.awssdk.services.cloudwatch.model.ListMetricsRequest.Builder listMetricsRequest)
        Attempts to push the supplied predicate constraints onto the Cloudwatch Metrics request.
      • makeGetMetricDataRequest

        protected static software.amazon.awssdk.services.cloudwatch.model.GetMetricDataRequest makeGetMetricDataRequest​(ReadRecordsRequest readRecordsRequest)
        Creates a Cloudwatch Metrics sample data request from the provided inputs
        Parameters:
        readRecordsRequest - The RecordReadRequest to make into a Cloudwatch Metrics Data request.
        Returns:
        The Cloudwatch Metrics Data request that matches the requested read operation.