{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AutoScalingPlans.Types.CustomizedLoadMetricSpecification
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.AutoScalingPlans.Types.CustomizedLoadMetricSpecification where

import Amazonka.AutoScalingPlans.Types.MetricDimension
import Amazonka.AutoScalingPlans.Types.MetricStatistic
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents a CloudWatch metric of your choosing that can be used for
-- predictive scaling.
--
-- For predictive scaling to work with a customized load metric
-- specification, AWS Auto Scaling needs access to the @Sum@ and @Average@
-- statistics that CloudWatch computes from metric data.
--
-- When you choose a load metric, make sure that the required @Sum@ and
-- @Average@ statistics for your metric are available in CloudWatch and
-- that they provide relevant data for predictive scaling. The @Sum@
-- statistic must represent the total load on the resource, and the
-- @Average@ statistic must represent the average load per capacity unit of
-- the resource. For example, there is a metric that counts the number of
-- requests processed by your Auto Scaling group. If the @Sum@ statistic
-- represents the total request count processed by the group, then the
-- @Average@ statistic for the specified metric must represent the average
-- request count processed by each instance of the group.
--
-- If you publish your own metrics, you can aggregate the data points at a
-- given interval and then publish the aggregated data points to
-- CloudWatch. Before AWS Auto Scaling generates the forecast, it sums up
-- all the metric data points that occurred within each hour to match the
-- granularity period that is used in the forecast (60 minutes).
--
-- For information about terminology, available metrics, or how to publish
-- new metrics, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html Amazon CloudWatch Concepts>
-- in the /Amazon CloudWatch User Guide/.
--
-- After creating your scaling plan, you can use the AWS Auto Scaling
-- console to visualize forecasts for the specified metric. For more
-- information, see
-- <https://docs.aws.amazon.com/autoscaling/plans/userguide/gs-create-scaling-plan.html#gs-view-resource View Scaling Information for a Resource>
-- in the /AWS Auto Scaling User Guide/.
--
-- /See:/ 'newCustomizedLoadMetricSpecification' smart constructor.
data CustomizedLoadMetricSpecification = CustomizedLoadMetricSpecification'
  { -- | The dimensions of the metric.
    --
    -- Conditional: If you published your metric with dimensions, you must
    -- specify the same dimensions in your customized load metric
    -- specification.
    CustomizedLoadMetricSpecification -> Maybe [MetricDimension]
dimensions :: Prelude.Maybe [MetricDimension],
    -- | The unit of the metric.
    CustomizedLoadMetricSpecification -> Maybe Text
unit :: Prelude.Maybe Prelude.Text,
    -- | The name of the metric.
    CustomizedLoadMetricSpecification -> Text
metricName :: Prelude.Text,
    -- | The namespace of the metric.
    CustomizedLoadMetricSpecification -> Text
namespace :: Prelude.Text,
    -- | The statistic of the metric. The only valid value is @Sum@.
    CustomizedLoadMetricSpecification -> MetricStatistic
statistic :: MetricStatistic
  }
  deriving (CustomizedLoadMetricSpecification
-> CustomizedLoadMetricSpecification -> Bool
(CustomizedLoadMetricSpecification
 -> CustomizedLoadMetricSpecification -> Bool)
-> (CustomizedLoadMetricSpecification
    -> CustomizedLoadMetricSpecification -> Bool)
-> Eq CustomizedLoadMetricSpecification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomizedLoadMetricSpecification
-> CustomizedLoadMetricSpecification -> Bool
$c/= :: CustomizedLoadMetricSpecification
-> CustomizedLoadMetricSpecification -> Bool
== :: CustomizedLoadMetricSpecification
-> CustomizedLoadMetricSpecification -> Bool
$c== :: CustomizedLoadMetricSpecification
-> CustomizedLoadMetricSpecification -> Bool
Prelude.Eq, ReadPrec [CustomizedLoadMetricSpecification]
ReadPrec CustomizedLoadMetricSpecification
Int -> ReadS CustomizedLoadMetricSpecification
ReadS [CustomizedLoadMetricSpecification]
(Int -> ReadS CustomizedLoadMetricSpecification)
-> ReadS [CustomizedLoadMetricSpecification]
-> ReadPrec CustomizedLoadMetricSpecification
-> ReadPrec [CustomizedLoadMetricSpecification]
-> Read CustomizedLoadMetricSpecification
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomizedLoadMetricSpecification]
$creadListPrec :: ReadPrec [CustomizedLoadMetricSpecification]
readPrec :: ReadPrec CustomizedLoadMetricSpecification
$creadPrec :: ReadPrec CustomizedLoadMetricSpecification
readList :: ReadS [CustomizedLoadMetricSpecification]
$creadList :: ReadS [CustomizedLoadMetricSpecification]
readsPrec :: Int -> ReadS CustomizedLoadMetricSpecification
$creadsPrec :: Int -> ReadS CustomizedLoadMetricSpecification
Prelude.Read, Int -> CustomizedLoadMetricSpecification -> ShowS
[CustomizedLoadMetricSpecification] -> ShowS
CustomizedLoadMetricSpecification -> String
(Int -> CustomizedLoadMetricSpecification -> ShowS)
-> (CustomizedLoadMetricSpecification -> String)
-> ([CustomizedLoadMetricSpecification] -> ShowS)
-> Show CustomizedLoadMetricSpecification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomizedLoadMetricSpecification] -> ShowS
$cshowList :: [CustomizedLoadMetricSpecification] -> ShowS
show :: CustomizedLoadMetricSpecification -> String
$cshow :: CustomizedLoadMetricSpecification -> String
showsPrec :: Int -> CustomizedLoadMetricSpecification -> ShowS
$cshowsPrec :: Int -> CustomizedLoadMetricSpecification -> ShowS
Prelude.Show, (forall x.
 CustomizedLoadMetricSpecification
 -> Rep CustomizedLoadMetricSpecification x)
-> (forall x.
    Rep CustomizedLoadMetricSpecification x
    -> CustomizedLoadMetricSpecification)
-> Generic CustomizedLoadMetricSpecification
forall x.
Rep CustomizedLoadMetricSpecification x
-> CustomizedLoadMetricSpecification
forall x.
CustomizedLoadMetricSpecification
-> Rep CustomizedLoadMetricSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CustomizedLoadMetricSpecification x
-> CustomizedLoadMetricSpecification
$cfrom :: forall x.
CustomizedLoadMetricSpecification
-> Rep CustomizedLoadMetricSpecification x
Prelude.Generic)

-- |
-- Create a value of 'CustomizedLoadMetricSpecification' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'dimensions', 'customizedLoadMetricSpecification_dimensions' - The dimensions of the metric.
--
-- Conditional: If you published your metric with dimensions, you must
-- specify the same dimensions in your customized load metric
-- specification.
--
-- 'unit', 'customizedLoadMetricSpecification_unit' - The unit of the metric.
--
-- 'metricName', 'customizedLoadMetricSpecification_metricName' - The name of the metric.
--
-- 'namespace', 'customizedLoadMetricSpecification_namespace' - The namespace of the metric.
--
-- 'statistic', 'customizedLoadMetricSpecification_statistic' - The statistic of the metric. The only valid value is @Sum@.
newCustomizedLoadMetricSpecification ::
  -- | 'metricName'
  Prelude.Text ->
  -- | 'namespace'
  Prelude.Text ->
  -- | 'statistic'
  MetricStatistic ->
  CustomizedLoadMetricSpecification
newCustomizedLoadMetricSpecification :: Text
-> Text -> MetricStatistic -> CustomizedLoadMetricSpecification
newCustomizedLoadMetricSpecification
  Text
pMetricName_
  Text
pNamespace_
  MetricStatistic
pStatistic_ =
    CustomizedLoadMetricSpecification' :: Maybe [MetricDimension]
-> Maybe Text
-> Text
-> Text
-> MetricStatistic
-> CustomizedLoadMetricSpecification
CustomizedLoadMetricSpecification'
      { $sel:dimensions:CustomizedLoadMetricSpecification' :: Maybe [MetricDimension]
dimensions =
          Maybe [MetricDimension]
forall a. Maybe a
Prelude.Nothing,
        $sel:unit:CustomizedLoadMetricSpecification' :: Maybe Text
unit = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:metricName:CustomizedLoadMetricSpecification' :: Text
metricName = Text
pMetricName_,
        $sel:namespace:CustomizedLoadMetricSpecification' :: Text
namespace = Text
pNamespace_,
        $sel:statistic:CustomizedLoadMetricSpecification' :: MetricStatistic
statistic = MetricStatistic
pStatistic_
      }

-- | The dimensions of the metric.
--
-- Conditional: If you published your metric with dimensions, you must
-- specify the same dimensions in your customized load metric
-- specification.
customizedLoadMetricSpecification_dimensions :: Lens.Lens' CustomizedLoadMetricSpecification (Prelude.Maybe [MetricDimension])
customizedLoadMetricSpecification_dimensions :: (Maybe [MetricDimension] -> f (Maybe [MetricDimension]))
-> CustomizedLoadMetricSpecification
-> f CustomizedLoadMetricSpecification
customizedLoadMetricSpecification_dimensions = (CustomizedLoadMetricSpecification -> Maybe [MetricDimension])
-> (CustomizedLoadMetricSpecification
    -> Maybe [MetricDimension] -> CustomizedLoadMetricSpecification)
-> Lens
     CustomizedLoadMetricSpecification
     CustomizedLoadMetricSpecification
     (Maybe [MetricDimension])
     (Maybe [MetricDimension])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomizedLoadMetricSpecification' {Maybe [MetricDimension]
dimensions :: Maybe [MetricDimension]
$sel:dimensions:CustomizedLoadMetricSpecification' :: CustomizedLoadMetricSpecification -> Maybe [MetricDimension]
dimensions} -> Maybe [MetricDimension]
dimensions) (\s :: CustomizedLoadMetricSpecification
s@CustomizedLoadMetricSpecification' {} Maybe [MetricDimension]
a -> CustomizedLoadMetricSpecification
s {$sel:dimensions:CustomizedLoadMetricSpecification' :: Maybe [MetricDimension]
dimensions = Maybe [MetricDimension]
a} :: CustomizedLoadMetricSpecification) ((Maybe [MetricDimension] -> f (Maybe [MetricDimension]))
 -> CustomizedLoadMetricSpecification
 -> f CustomizedLoadMetricSpecification)
-> ((Maybe [MetricDimension] -> f (Maybe [MetricDimension]))
    -> Maybe [MetricDimension] -> f (Maybe [MetricDimension]))
-> (Maybe [MetricDimension] -> f (Maybe [MetricDimension]))
-> CustomizedLoadMetricSpecification
-> f CustomizedLoadMetricSpecification
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MetricDimension]
  [MetricDimension]
  [MetricDimension]
  [MetricDimension]
-> Iso
     (Maybe [MetricDimension])
     (Maybe [MetricDimension])
     (Maybe [MetricDimension])
     (Maybe [MetricDimension])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [MetricDimension]
  [MetricDimension]
  [MetricDimension]
  [MetricDimension]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The unit of the metric.
customizedLoadMetricSpecification_unit :: Lens.Lens' CustomizedLoadMetricSpecification (Prelude.Maybe Prelude.Text)
customizedLoadMetricSpecification_unit :: (Maybe Text -> f (Maybe Text))
-> CustomizedLoadMetricSpecification
-> f CustomizedLoadMetricSpecification
customizedLoadMetricSpecification_unit = (CustomizedLoadMetricSpecification -> Maybe Text)
-> (CustomizedLoadMetricSpecification
    -> Maybe Text -> CustomizedLoadMetricSpecification)
-> Lens
     CustomizedLoadMetricSpecification
     CustomizedLoadMetricSpecification
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomizedLoadMetricSpecification' {Maybe Text
unit :: Maybe Text
$sel:unit:CustomizedLoadMetricSpecification' :: CustomizedLoadMetricSpecification -> Maybe Text
unit} -> Maybe Text
unit) (\s :: CustomizedLoadMetricSpecification
s@CustomizedLoadMetricSpecification' {} Maybe Text
a -> CustomizedLoadMetricSpecification
s {$sel:unit:CustomizedLoadMetricSpecification' :: Maybe Text
unit = Maybe Text
a} :: CustomizedLoadMetricSpecification)

-- | The name of the metric.
customizedLoadMetricSpecification_metricName :: Lens.Lens' CustomizedLoadMetricSpecification Prelude.Text
customizedLoadMetricSpecification_metricName :: (Text -> f Text)
-> CustomizedLoadMetricSpecification
-> f CustomizedLoadMetricSpecification
customizedLoadMetricSpecification_metricName = (CustomizedLoadMetricSpecification -> Text)
-> (CustomizedLoadMetricSpecification
    -> Text -> CustomizedLoadMetricSpecification)
-> Lens
     CustomizedLoadMetricSpecification
     CustomizedLoadMetricSpecification
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomizedLoadMetricSpecification' {Text
metricName :: Text
$sel:metricName:CustomizedLoadMetricSpecification' :: CustomizedLoadMetricSpecification -> Text
metricName} -> Text
metricName) (\s :: CustomizedLoadMetricSpecification
s@CustomizedLoadMetricSpecification' {} Text
a -> CustomizedLoadMetricSpecification
s {$sel:metricName:CustomizedLoadMetricSpecification' :: Text
metricName = Text
a} :: CustomizedLoadMetricSpecification)

-- | The namespace of the metric.
customizedLoadMetricSpecification_namespace :: Lens.Lens' CustomizedLoadMetricSpecification Prelude.Text
customizedLoadMetricSpecification_namespace :: (Text -> f Text)
-> CustomizedLoadMetricSpecification
-> f CustomizedLoadMetricSpecification
customizedLoadMetricSpecification_namespace = (CustomizedLoadMetricSpecification -> Text)
-> (CustomizedLoadMetricSpecification
    -> Text -> CustomizedLoadMetricSpecification)
-> Lens
     CustomizedLoadMetricSpecification
     CustomizedLoadMetricSpecification
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomizedLoadMetricSpecification' {Text
namespace :: Text
$sel:namespace:CustomizedLoadMetricSpecification' :: CustomizedLoadMetricSpecification -> Text
namespace} -> Text
namespace) (\s :: CustomizedLoadMetricSpecification
s@CustomizedLoadMetricSpecification' {} Text
a -> CustomizedLoadMetricSpecification
s {$sel:namespace:CustomizedLoadMetricSpecification' :: Text
namespace = Text
a} :: CustomizedLoadMetricSpecification)

-- | The statistic of the metric. The only valid value is @Sum@.
customizedLoadMetricSpecification_statistic :: Lens.Lens' CustomizedLoadMetricSpecification MetricStatistic
customizedLoadMetricSpecification_statistic :: (MetricStatistic -> f MetricStatistic)
-> CustomizedLoadMetricSpecification
-> f CustomizedLoadMetricSpecification
customizedLoadMetricSpecification_statistic = (CustomizedLoadMetricSpecification -> MetricStatistic)
-> (CustomizedLoadMetricSpecification
    -> MetricStatistic -> CustomizedLoadMetricSpecification)
-> Lens
     CustomizedLoadMetricSpecification
     CustomizedLoadMetricSpecification
     MetricStatistic
     MetricStatistic
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomizedLoadMetricSpecification' {MetricStatistic
statistic :: MetricStatistic
$sel:statistic:CustomizedLoadMetricSpecification' :: CustomizedLoadMetricSpecification -> MetricStatistic
statistic} -> MetricStatistic
statistic) (\s :: CustomizedLoadMetricSpecification
s@CustomizedLoadMetricSpecification' {} MetricStatistic
a -> CustomizedLoadMetricSpecification
s {$sel:statistic:CustomizedLoadMetricSpecification' :: MetricStatistic
statistic = MetricStatistic
a} :: CustomizedLoadMetricSpecification)

instance
  Core.FromJSON
    CustomizedLoadMetricSpecification
  where
  parseJSON :: Value -> Parser CustomizedLoadMetricSpecification
parseJSON =
    String
-> (Object -> Parser CustomizedLoadMetricSpecification)
-> Value
-> Parser CustomizedLoadMetricSpecification
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CustomizedLoadMetricSpecification"
      ( \Object
x ->
          Maybe [MetricDimension]
-> Maybe Text
-> Text
-> Text
-> MetricStatistic
-> CustomizedLoadMetricSpecification
CustomizedLoadMetricSpecification'
            (Maybe [MetricDimension]
 -> Maybe Text
 -> Text
 -> Text
 -> MetricStatistic
 -> CustomizedLoadMetricSpecification)
-> Parser (Maybe [MetricDimension])
-> Parser
     (Maybe Text
      -> Text
      -> Text
      -> MetricStatistic
      -> CustomizedLoadMetricSpecification)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [MetricDimension]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Dimensions" Parser (Maybe (Maybe [MetricDimension]))
-> Maybe [MetricDimension] -> Parser (Maybe [MetricDimension])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [MetricDimension]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Text
   -> Text
   -> MetricStatistic
   -> CustomizedLoadMetricSpecification)
-> Parser (Maybe Text)
-> Parser
     (Text
      -> Text -> MetricStatistic -> CustomizedLoadMetricSpecification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Unit")
            Parser
  (Text
   -> Text -> MetricStatistic -> CustomizedLoadMetricSpecification)
-> Parser Text
-> Parser
     (Text -> MetricStatistic -> CustomizedLoadMetricSpecification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"MetricName")
            Parser
  (Text -> MetricStatistic -> CustomizedLoadMetricSpecification)
-> Parser Text
-> Parser (MetricStatistic -> CustomizedLoadMetricSpecification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Namespace")
            Parser (MetricStatistic -> CustomizedLoadMetricSpecification)
-> Parser MetricStatistic
-> Parser CustomizedLoadMetricSpecification
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser MetricStatistic
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Statistic")
      )

instance
  Prelude.Hashable
    CustomizedLoadMetricSpecification

instance
  Prelude.NFData
    CustomizedLoadMetricSpecification

instance
  Core.ToJSON
    CustomizedLoadMetricSpecification
  where
  toJSON :: CustomizedLoadMetricSpecification -> Value
toJSON CustomizedLoadMetricSpecification' {Maybe [MetricDimension]
Maybe Text
Text
MetricStatistic
statistic :: MetricStatistic
namespace :: Text
metricName :: Text
unit :: Maybe Text
dimensions :: Maybe [MetricDimension]
$sel:statistic:CustomizedLoadMetricSpecification' :: CustomizedLoadMetricSpecification -> MetricStatistic
$sel:namespace:CustomizedLoadMetricSpecification' :: CustomizedLoadMetricSpecification -> Text
$sel:metricName:CustomizedLoadMetricSpecification' :: CustomizedLoadMetricSpecification -> Text
$sel:unit:CustomizedLoadMetricSpecification' :: CustomizedLoadMetricSpecification -> Maybe Text
$sel:dimensions:CustomizedLoadMetricSpecification' :: CustomizedLoadMetricSpecification -> Maybe [MetricDimension]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Dimensions" Text -> [MetricDimension] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([MetricDimension] -> Pair)
-> Maybe [MetricDimension] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MetricDimension]
dimensions,
            (Text
"Unit" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
unit,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"MetricName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
metricName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Namespace" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
namespace),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Statistic" Text -> MetricStatistic -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= MetricStatistic
statistic)
          ]
      )