{-# 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 #-}
module Amazonka.SageMaker.Types.RecommendationMetrics 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
data RecommendationMetrics = RecommendationMetrics'
{
RecommendationMetrics -> Double
costPerHour :: Prelude.Double,
RecommendationMetrics -> Double
costPerInference :: Prelude.Double,
RecommendationMetrics -> Int
maxInvocations :: Prelude.Int,
RecommendationMetrics -> Int
modelLatency :: Prelude.Int
}
deriving (RecommendationMetrics -> RecommendationMetrics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecommendationMetrics -> RecommendationMetrics -> Bool
$c/= :: RecommendationMetrics -> RecommendationMetrics -> Bool
== :: RecommendationMetrics -> RecommendationMetrics -> Bool
$c== :: RecommendationMetrics -> RecommendationMetrics -> Bool
Prelude.Eq, ReadPrec [RecommendationMetrics]
ReadPrec RecommendationMetrics
Int -> ReadS RecommendationMetrics
ReadS [RecommendationMetrics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecommendationMetrics]
$creadListPrec :: ReadPrec [RecommendationMetrics]
readPrec :: ReadPrec RecommendationMetrics
$creadPrec :: ReadPrec RecommendationMetrics
readList :: ReadS [RecommendationMetrics]
$creadList :: ReadS [RecommendationMetrics]
readsPrec :: Int -> ReadS RecommendationMetrics
$creadsPrec :: Int -> ReadS RecommendationMetrics
Prelude.Read, Int -> RecommendationMetrics -> ShowS
[RecommendationMetrics] -> ShowS
RecommendationMetrics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecommendationMetrics] -> ShowS
$cshowList :: [RecommendationMetrics] -> ShowS
show :: RecommendationMetrics -> String
$cshow :: RecommendationMetrics -> String
showsPrec :: Int -> RecommendationMetrics -> ShowS
$cshowsPrec :: Int -> RecommendationMetrics -> ShowS
Prelude.Show, forall x. Rep RecommendationMetrics x -> RecommendationMetrics
forall x. RecommendationMetrics -> Rep RecommendationMetrics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RecommendationMetrics x -> RecommendationMetrics
$cfrom :: forall x. RecommendationMetrics -> Rep RecommendationMetrics x
Prelude.Generic)
newRecommendationMetrics ::
Prelude.Double ->
Prelude.Double ->
Prelude.Int ->
Prelude.Int ->
RecommendationMetrics
newRecommendationMetrics :: Double -> Double -> Int -> Int -> RecommendationMetrics
newRecommendationMetrics
Double
pCostPerHour_
Double
pCostPerInference_
Int
pMaxInvocations_
Int
pModelLatency_ =
RecommendationMetrics'
{ $sel:costPerHour:RecommendationMetrics' :: Double
costPerHour = Double
pCostPerHour_,
$sel:costPerInference:RecommendationMetrics' :: Double
costPerInference = Double
pCostPerInference_,
$sel:maxInvocations:RecommendationMetrics' :: Int
maxInvocations = Int
pMaxInvocations_,
$sel:modelLatency:RecommendationMetrics' :: Int
modelLatency = Int
pModelLatency_
}
recommendationMetrics_costPerHour :: Lens.Lens' RecommendationMetrics Prelude.Double
recommendationMetrics_costPerHour :: Lens' RecommendationMetrics Double
recommendationMetrics_costPerHour = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationMetrics' {Double
costPerHour :: Double
$sel:costPerHour:RecommendationMetrics' :: RecommendationMetrics -> Double
costPerHour} -> Double
costPerHour) (\s :: RecommendationMetrics
s@RecommendationMetrics' {} Double
a -> RecommendationMetrics
s {$sel:costPerHour:RecommendationMetrics' :: Double
costPerHour = Double
a} :: RecommendationMetrics)
recommendationMetrics_costPerInference :: Lens.Lens' RecommendationMetrics Prelude.Double
recommendationMetrics_costPerInference :: Lens' RecommendationMetrics Double
recommendationMetrics_costPerInference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationMetrics' {Double
costPerInference :: Double
$sel:costPerInference:RecommendationMetrics' :: RecommendationMetrics -> Double
costPerInference} -> Double
costPerInference) (\s :: RecommendationMetrics
s@RecommendationMetrics' {} Double
a -> RecommendationMetrics
s {$sel:costPerInference:RecommendationMetrics' :: Double
costPerInference = Double
a} :: RecommendationMetrics)
recommendationMetrics_maxInvocations :: Lens.Lens' RecommendationMetrics Prelude.Int
recommendationMetrics_maxInvocations :: Lens' RecommendationMetrics Int
recommendationMetrics_maxInvocations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationMetrics' {Int
maxInvocations :: Int
$sel:maxInvocations:RecommendationMetrics' :: RecommendationMetrics -> Int
maxInvocations} -> Int
maxInvocations) (\s :: RecommendationMetrics
s@RecommendationMetrics' {} Int
a -> RecommendationMetrics
s {$sel:maxInvocations:RecommendationMetrics' :: Int
maxInvocations = Int
a} :: RecommendationMetrics)
recommendationMetrics_modelLatency :: Lens.Lens' RecommendationMetrics Prelude.Int
recommendationMetrics_modelLatency :: Lens' RecommendationMetrics Int
recommendationMetrics_modelLatency = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationMetrics' {Int
modelLatency :: Int
$sel:modelLatency:RecommendationMetrics' :: RecommendationMetrics -> Int
modelLatency} -> Int
modelLatency) (\s :: RecommendationMetrics
s@RecommendationMetrics' {} Int
a -> RecommendationMetrics
s {$sel:modelLatency:RecommendationMetrics' :: Int
modelLatency = Int
a} :: RecommendationMetrics)
instance Data.FromJSON RecommendationMetrics where
parseJSON :: Value -> Parser RecommendationMetrics
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RecommendationMetrics"
( \Object
x ->
Double -> Double -> Int -> Int -> RecommendationMetrics
RecommendationMetrics'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"CostPerHour")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"CostPerInference")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"MaxInvocations")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ModelLatency")
)
instance Prelude.Hashable RecommendationMetrics where
hashWithSalt :: Int -> RecommendationMetrics -> Int
hashWithSalt Int
_salt RecommendationMetrics' {Double
Int
modelLatency :: Int
maxInvocations :: Int
costPerInference :: Double
costPerHour :: Double
$sel:modelLatency:RecommendationMetrics' :: RecommendationMetrics -> Int
$sel:maxInvocations:RecommendationMetrics' :: RecommendationMetrics -> Int
$sel:costPerInference:RecommendationMetrics' :: RecommendationMetrics -> Double
$sel:costPerHour:RecommendationMetrics' :: RecommendationMetrics -> Double
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
costPerHour
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
costPerInference
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
maxInvocations
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
modelLatency
instance Prelude.NFData RecommendationMetrics where
rnf :: RecommendationMetrics -> ()
rnf RecommendationMetrics' {Double
Int
modelLatency :: Int
maxInvocations :: Int
costPerInference :: Double
costPerHour :: Double
$sel:modelLatency:RecommendationMetrics' :: RecommendationMetrics -> Int
$sel:maxInvocations:RecommendationMetrics' :: RecommendationMetrics -> Int
$sel:costPerInference:RecommendationMetrics' :: RecommendationMetrics -> Double
$sel:costPerHour:RecommendationMetrics' :: RecommendationMetrics -> Double
..} =
forall a. NFData a => a -> ()
Prelude.rnf Double
costPerHour
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Double
costPerInference
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
maxInvocations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
modelLatency