{-# 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.SageMaker.Types.ProfilerConfigForUpdate
-- 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.SageMaker.Types.ProfilerConfigForUpdate where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Configuration information for updating the Debugger profile parameters,
-- system and framework metrics configurations, and storage paths.
--
-- /See:/ 'newProfilerConfigForUpdate' smart constructor.
data ProfilerConfigForUpdate = ProfilerConfigForUpdate'
  { -- | Configuration information for capturing framework metrics. Available key
    -- strings for different profiling options are @DetailedProfilingConfig@,
    -- @PythonProfilingConfig@, and @DataLoaderProfilingConfig@. The following
    -- codes are configuration structures for the @ProfilingParameters@
    -- parameter. To learn more about how to configure the
    -- @ProfilingParameters@ parameter, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/debugger-createtrainingjob-api.html Use the SageMaker and Debugger Configuration API Operations to Create, Update, and Debug Your Training Job>.
    ProfilerConfigForUpdate -> Maybe (HashMap Text Text)
profilingParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Path to Amazon S3 storage location for system and framework metrics.
    ProfilerConfigForUpdate -> Maybe Text
s3OutputPath :: Prelude.Maybe Prelude.Text,
    -- | A time interval for capturing system metrics in milliseconds. Available
    -- values are 100, 200, 500, 1000 (1 second), 5000 (5 seconds), and 60000
    -- (1 minute) milliseconds. The default value is 500 milliseconds.
    ProfilerConfigForUpdate -> Maybe Integer
profilingIntervalInMilliseconds :: Prelude.Maybe Prelude.Integer,
    -- | To disable Debugger monitoring and profiling, set to @True@.
    ProfilerConfigForUpdate -> Maybe Bool
disableProfiler :: Prelude.Maybe Prelude.Bool
  }
  deriving (ProfilerConfigForUpdate -> ProfilerConfigForUpdate -> Bool
(ProfilerConfigForUpdate -> ProfilerConfigForUpdate -> Bool)
-> (ProfilerConfigForUpdate -> ProfilerConfigForUpdate -> Bool)
-> Eq ProfilerConfigForUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProfilerConfigForUpdate -> ProfilerConfigForUpdate -> Bool
$c/= :: ProfilerConfigForUpdate -> ProfilerConfigForUpdate -> Bool
== :: ProfilerConfigForUpdate -> ProfilerConfigForUpdate -> Bool
$c== :: ProfilerConfigForUpdate -> ProfilerConfigForUpdate -> Bool
Prelude.Eq, ReadPrec [ProfilerConfigForUpdate]
ReadPrec ProfilerConfigForUpdate
Int -> ReadS ProfilerConfigForUpdate
ReadS [ProfilerConfigForUpdate]
(Int -> ReadS ProfilerConfigForUpdate)
-> ReadS [ProfilerConfigForUpdate]
-> ReadPrec ProfilerConfigForUpdate
-> ReadPrec [ProfilerConfigForUpdate]
-> Read ProfilerConfigForUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProfilerConfigForUpdate]
$creadListPrec :: ReadPrec [ProfilerConfigForUpdate]
readPrec :: ReadPrec ProfilerConfigForUpdate
$creadPrec :: ReadPrec ProfilerConfigForUpdate
readList :: ReadS [ProfilerConfigForUpdate]
$creadList :: ReadS [ProfilerConfigForUpdate]
readsPrec :: Int -> ReadS ProfilerConfigForUpdate
$creadsPrec :: Int -> ReadS ProfilerConfigForUpdate
Prelude.Read, Int -> ProfilerConfigForUpdate -> ShowS
[ProfilerConfigForUpdate] -> ShowS
ProfilerConfigForUpdate -> String
(Int -> ProfilerConfigForUpdate -> ShowS)
-> (ProfilerConfigForUpdate -> String)
-> ([ProfilerConfigForUpdate] -> ShowS)
-> Show ProfilerConfigForUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProfilerConfigForUpdate] -> ShowS
$cshowList :: [ProfilerConfigForUpdate] -> ShowS
show :: ProfilerConfigForUpdate -> String
$cshow :: ProfilerConfigForUpdate -> String
showsPrec :: Int -> ProfilerConfigForUpdate -> ShowS
$cshowsPrec :: Int -> ProfilerConfigForUpdate -> ShowS
Prelude.Show, (forall x.
 ProfilerConfigForUpdate -> Rep ProfilerConfigForUpdate x)
-> (forall x.
    Rep ProfilerConfigForUpdate x -> ProfilerConfigForUpdate)
-> Generic ProfilerConfigForUpdate
forall x. Rep ProfilerConfigForUpdate x -> ProfilerConfigForUpdate
forall x. ProfilerConfigForUpdate -> Rep ProfilerConfigForUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProfilerConfigForUpdate x -> ProfilerConfigForUpdate
$cfrom :: forall x. ProfilerConfigForUpdate -> Rep ProfilerConfigForUpdate x
Prelude.Generic)

-- |
-- Create a value of 'ProfilerConfigForUpdate' 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:
--
-- 'profilingParameters', 'profilerConfigForUpdate_profilingParameters' - Configuration information for capturing framework metrics. Available key
-- strings for different profiling options are @DetailedProfilingConfig@,
-- @PythonProfilingConfig@, and @DataLoaderProfilingConfig@. The following
-- codes are configuration structures for the @ProfilingParameters@
-- parameter. To learn more about how to configure the
-- @ProfilingParameters@ parameter, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/debugger-createtrainingjob-api.html Use the SageMaker and Debugger Configuration API Operations to Create, Update, and Debug Your Training Job>.
--
-- 's3OutputPath', 'profilerConfigForUpdate_s3OutputPath' - Path to Amazon S3 storage location for system and framework metrics.
--
-- 'profilingIntervalInMilliseconds', 'profilerConfigForUpdate_profilingIntervalInMilliseconds' - A time interval for capturing system metrics in milliseconds. Available
-- values are 100, 200, 500, 1000 (1 second), 5000 (5 seconds), and 60000
-- (1 minute) milliseconds. The default value is 500 milliseconds.
--
-- 'disableProfiler', 'profilerConfigForUpdate_disableProfiler' - To disable Debugger monitoring and profiling, set to @True@.
newProfilerConfigForUpdate ::
  ProfilerConfigForUpdate
newProfilerConfigForUpdate :: ProfilerConfigForUpdate
newProfilerConfigForUpdate =
  ProfilerConfigForUpdate' :: Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Integer
-> Maybe Bool
-> ProfilerConfigForUpdate
ProfilerConfigForUpdate'
    { $sel:profilingParameters:ProfilerConfigForUpdate' :: Maybe (HashMap Text Text)
profilingParameters =
        Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:s3OutputPath:ProfilerConfigForUpdate' :: Maybe Text
s3OutputPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:profilingIntervalInMilliseconds:ProfilerConfigForUpdate' :: Maybe Integer
profilingIntervalInMilliseconds = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:disableProfiler:ProfilerConfigForUpdate' :: Maybe Bool
disableProfiler = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | Configuration information for capturing framework metrics. Available key
-- strings for different profiling options are @DetailedProfilingConfig@,
-- @PythonProfilingConfig@, and @DataLoaderProfilingConfig@. The following
-- codes are configuration structures for the @ProfilingParameters@
-- parameter. To learn more about how to configure the
-- @ProfilingParameters@ parameter, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/debugger-createtrainingjob-api.html Use the SageMaker and Debugger Configuration API Operations to Create, Update, and Debug Your Training Job>.
profilerConfigForUpdate_profilingParameters :: Lens.Lens' ProfilerConfigForUpdate (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
profilerConfigForUpdate_profilingParameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ProfilerConfigForUpdate -> f ProfilerConfigForUpdate
profilerConfigForUpdate_profilingParameters = (ProfilerConfigForUpdate -> Maybe (HashMap Text Text))
-> (ProfilerConfigForUpdate
    -> Maybe (HashMap Text Text) -> ProfilerConfigForUpdate)
-> Lens
     ProfilerConfigForUpdate
     ProfilerConfigForUpdate
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfilerConfigForUpdate' {Maybe (HashMap Text Text)
profilingParameters :: Maybe (HashMap Text Text)
$sel:profilingParameters:ProfilerConfigForUpdate' :: ProfilerConfigForUpdate -> Maybe (HashMap Text Text)
profilingParameters} -> Maybe (HashMap Text Text)
profilingParameters) (\s :: ProfilerConfigForUpdate
s@ProfilerConfigForUpdate' {} Maybe (HashMap Text Text)
a -> ProfilerConfigForUpdate
s {$sel:profilingParameters:ProfilerConfigForUpdate' :: Maybe (HashMap Text Text)
profilingParameters = Maybe (HashMap Text Text)
a} :: ProfilerConfigForUpdate) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> ProfilerConfigForUpdate -> f ProfilerConfigForUpdate)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ProfilerConfigForUpdate
-> f ProfilerConfigForUpdate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Path to Amazon S3 storage location for system and framework metrics.
profilerConfigForUpdate_s3OutputPath :: Lens.Lens' ProfilerConfigForUpdate (Prelude.Maybe Prelude.Text)
profilerConfigForUpdate_s3OutputPath :: (Maybe Text -> f (Maybe Text))
-> ProfilerConfigForUpdate -> f ProfilerConfigForUpdate
profilerConfigForUpdate_s3OutputPath = (ProfilerConfigForUpdate -> Maybe Text)
-> (ProfilerConfigForUpdate
    -> Maybe Text -> ProfilerConfigForUpdate)
-> Lens
     ProfilerConfigForUpdate
     ProfilerConfigForUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfilerConfigForUpdate' {Maybe Text
s3OutputPath :: Maybe Text
$sel:s3OutputPath:ProfilerConfigForUpdate' :: ProfilerConfigForUpdate -> Maybe Text
s3OutputPath} -> Maybe Text
s3OutputPath) (\s :: ProfilerConfigForUpdate
s@ProfilerConfigForUpdate' {} Maybe Text
a -> ProfilerConfigForUpdate
s {$sel:s3OutputPath:ProfilerConfigForUpdate' :: Maybe Text
s3OutputPath = Maybe Text
a} :: ProfilerConfigForUpdate)

-- | A time interval for capturing system metrics in milliseconds. Available
-- values are 100, 200, 500, 1000 (1 second), 5000 (5 seconds), and 60000
-- (1 minute) milliseconds. The default value is 500 milliseconds.
profilerConfigForUpdate_profilingIntervalInMilliseconds :: Lens.Lens' ProfilerConfigForUpdate (Prelude.Maybe Prelude.Integer)
profilerConfigForUpdate_profilingIntervalInMilliseconds :: (Maybe Integer -> f (Maybe Integer))
-> ProfilerConfigForUpdate -> f ProfilerConfigForUpdate
profilerConfigForUpdate_profilingIntervalInMilliseconds = (ProfilerConfigForUpdate -> Maybe Integer)
-> (ProfilerConfigForUpdate
    -> Maybe Integer -> ProfilerConfigForUpdate)
-> Lens
     ProfilerConfigForUpdate
     ProfilerConfigForUpdate
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfilerConfigForUpdate' {Maybe Integer
profilingIntervalInMilliseconds :: Maybe Integer
$sel:profilingIntervalInMilliseconds:ProfilerConfigForUpdate' :: ProfilerConfigForUpdate -> Maybe Integer
profilingIntervalInMilliseconds} -> Maybe Integer
profilingIntervalInMilliseconds) (\s :: ProfilerConfigForUpdate
s@ProfilerConfigForUpdate' {} Maybe Integer
a -> ProfilerConfigForUpdate
s {$sel:profilingIntervalInMilliseconds:ProfilerConfigForUpdate' :: Maybe Integer
profilingIntervalInMilliseconds = Maybe Integer
a} :: ProfilerConfigForUpdate)

-- | To disable Debugger monitoring and profiling, set to @True@.
profilerConfigForUpdate_disableProfiler :: Lens.Lens' ProfilerConfigForUpdate (Prelude.Maybe Prelude.Bool)
profilerConfigForUpdate_disableProfiler :: (Maybe Bool -> f (Maybe Bool))
-> ProfilerConfigForUpdate -> f ProfilerConfigForUpdate
profilerConfigForUpdate_disableProfiler = (ProfilerConfigForUpdate -> Maybe Bool)
-> (ProfilerConfigForUpdate
    -> Maybe Bool -> ProfilerConfigForUpdate)
-> Lens
     ProfilerConfigForUpdate
     ProfilerConfigForUpdate
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfilerConfigForUpdate' {Maybe Bool
disableProfiler :: Maybe Bool
$sel:disableProfiler:ProfilerConfigForUpdate' :: ProfilerConfigForUpdate -> Maybe Bool
disableProfiler} -> Maybe Bool
disableProfiler) (\s :: ProfilerConfigForUpdate
s@ProfilerConfigForUpdate' {} Maybe Bool
a -> ProfilerConfigForUpdate
s {$sel:disableProfiler:ProfilerConfigForUpdate' :: Maybe Bool
disableProfiler = Maybe Bool
a} :: ProfilerConfigForUpdate)

instance Prelude.Hashable ProfilerConfigForUpdate

instance Prelude.NFData ProfilerConfigForUpdate

instance Core.ToJSON ProfilerConfigForUpdate where
  toJSON :: ProfilerConfigForUpdate -> Value
toJSON ProfilerConfigForUpdate' {Maybe Bool
Maybe Integer
Maybe Text
Maybe (HashMap Text Text)
disableProfiler :: Maybe Bool
profilingIntervalInMilliseconds :: Maybe Integer
s3OutputPath :: Maybe Text
profilingParameters :: Maybe (HashMap Text Text)
$sel:disableProfiler:ProfilerConfigForUpdate' :: ProfilerConfigForUpdate -> Maybe Bool
$sel:profilingIntervalInMilliseconds:ProfilerConfigForUpdate' :: ProfilerConfigForUpdate -> Maybe Integer
$sel:s3OutputPath:ProfilerConfigForUpdate' :: ProfilerConfigForUpdate -> Maybe Text
$sel:profilingParameters:ProfilerConfigForUpdate' :: ProfilerConfigForUpdate -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ProfilingParameters" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
profilingParameters,
            (Text
"S3OutputPath" 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
s3OutputPath,
            (Text
"ProfilingIntervalInMilliseconds" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
profilingIntervalInMilliseconds,
            (Text
"DisableProfiler" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
disableProfiler
          ]
      )