Class PredefinedMetricTransformer

    • Constructor Detail

      • PredefinedMetricTransformer

        public PredefinedMetricTransformer()
    • Method Detail

      • toMetricData

        public List<MetricDatum> toMetricData​(MetricType metricType,
                                              Request<?> request,
                                              Response<?> response)
        Returns a non-null list of metric datum for the metrics collected for the given request/response.
        Parameters:
        metricType - the request metric type
      • latencyMetricOf

        protected List<MetricDatum> latencyMetricOf​(MetricType metricType,
                                                    Request<?> req,
                                                    Object response,
                                                    boolean includesRequestType)
        Returns all the latency metric data recorded for the specified metric event type; or an empty list if there is none. The number of metric datum in the returned list should be exactly one when there is no retries, or more than one when there are retries.
        Parameters:
        includesRequestType - true iff the "request" dimension is to be included;
      • counterMetricOf

        protected List<MetricDatum> counterMetricOf​(MetricType type,
                                                    Request<?> req,
                                                    Object resp,
                                                    boolean includesRequestType)
        Returns a list of metric datum recorded for the specified counter metric type; or an empty list if there is none.
        Parameters:
        includesRequestType - true iff an additional metric datum is to be created that includes the "request" dimension