{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.ProfilerConfigForUpdate where

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

-- | Configuration information for updating the Amazon SageMaker Debugger
-- profile parameters, system and framework metrics configurations, and
-- storage paths.
--
-- /See:/ 'newProfilerConfigForUpdate' smart constructor.
data ProfilerConfigForUpdate = ProfilerConfigForUpdate'
  { -- | To turn off Amazon SageMaker Debugger monitoring and profiling while a
    -- training job is in progress, set to @True@.
    ProfilerConfigForUpdate -> Maybe Bool
disableProfiler :: Prelude.Maybe Prelude.Bool,
    -- | 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,
    -- | 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
  }
  deriving (ProfilerConfigForUpdate -> ProfilerConfigForUpdate -> Bool
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]
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
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. 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:
--
-- 'disableProfiler', 'profilerConfigForUpdate_disableProfiler' - To turn off Amazon SageMaker Debugger monitoring and profiling while a
-- training job is in progress, set to @True@.
--
-- '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.
--
-- '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.
newProfilerConfigForUpdate ::
  ProfilerConfigForUpdate
newProfilerConfigForUpdate :: ProfilerConfigForUpdate
newProfilerConfigForUpdate =
  ProfilerConfigForUpdate'
    { $sel:disableProfiler:ProfilerConfigForUpdate' :: Maybe Bool
disableProfiler =
        forall a. Maybe a
Prelude.Nothing,
      $sel:profilingIntervalInMilliseconds:ProfilerConfigForUpdate' :: Maybe Integer
profilingIntervalInMilliseconds = forall a. Maybe a
Prelude.Nothing,
      $sel:profilingParameters:ProfilerConfigForUpdate' :: Maybe (HashMap Text Text)
profilingParameters = forall a. Maybe a
Prelude.Nothing,
      $sel:s3OutputPath:ProfilerConfigForUpdate' :: Maybe Text
s3OutputPath = forall a. Maybe a
Prelude.Nothing
    }

-- | To turn off Amazon SageMaker Debugger monitoring and profiling while a
-- training job is in progress, set to @True@.
profilerConfigForUpdate_disableProfiler :: Lens.Lens' ProfilerConfigForUpdate (Prelude.Maybe Prelude.Bool)
profilerConfigForUpdate_disableProfiler :: Lens' ProfilerConfigForUpdate (Maybe Bool)
profilerConfigForUpdate_disableProfiler = 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)

-- | 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 :: Lens' ProfilerConfigForUpdate (Maybe Integer)
profilerConfigForUpdate_profilingIntervalInMilliseconds = 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)

-- | 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 :: Lens' ProfilerConfigForUpdate (Maybe (HashMap Text Text))
profilerConfigForUpdate_profilingParameters = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' ProfilerConfigForUpdate (Maybe Text)
profilerConfigForUpdate_s3OutputPath = 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)

instance Prelude.Hashable ProfilerConfigForUpdate where
  hashWithSalt :: Int -> ProfilerConfigForUpdate -> Int
hashWithSalt Int
_salt ProfilerConfigForUpdate' {Maybe Bool
Maybe Integer
Maybe Text
Maybe (HashMap Text Text)
s3OutputPath :: Maybe Text
profilingParameters :: Maybe (HashMap Text Text)
profilingIntervalInMilliseconds :: Maybe Integer
disableProfiler :: Maybe Bool
$sel:s3OutputPath:ProfilerConfigForUpdate' :: ProfilerConfigForUpdate -> Maybe Text
$sel:profilingParameters:ProfilerConfigForUpdate' :: ProfilerConfigForUpdate -> Maybe (HashMap Text Text)
$sel:profilingIntervalInMilliseconds:ProfilerConfigForUpdate' :: ProfilerConfigForUpdate -> Maybe Integer
$sel:disableProfiler:ProfilerConfigForUpdate' :: ProfilerConfigForUpdate -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
disableProfiler
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
profilingIntervalInMilliseconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
profilingParameters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3OutputPath

instance Prelude.NFData ProfilerConfigForUpdate where
  rnf :: ProfilerConfigForUpdate -> ()
rnf ProfilerConfigForUpdate' {Maybe Bool
Maybe Integer
Maybe Text
Maybe (HashMap Text Text)
s3OutputPath :: Maybe Text
profilingParameters :: Maybe (HashMap Text Text)
profilingIntervalInMilliseconds :: Maybe Integer
disableProfiler :: Maybe Bool
$sel:s3OutputPath:ProfilerConfigForUpdate' :: ProfilerConfigForUpdate -> Maybe Text
$sel:profilingParameters:ProfilerConfigForUpdate' :: ProfilerConfigForUpdate -> Maybe (HashMap Text Text)
$sel:profilingIntervalInMilliseconds:ProfilerConfigForUpdate' :: ProfilerConfigForUpdate -> Maybe Integer
$sel:disableProfiler:ProfilerConfigForUpdate' :: ProfilerConfigForUpdate -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
disableProfiler
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
profilingIntervalInMilliseconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
profilingParameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3OutputPath

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