{-# 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.XRay.Types.ServiceStatistics 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
import Amazonka.XRay.Types.ErrorStatistics
import Amazonka.XRay.Types.FaultStatistics
data ServiceStatistics = ServiceStatistics'
{
ServiceStatistics -> Maybe ErrorStatistics
errorStatistics :: Prelude.Maybe ErrorStatistics,
ServiceStatistics -> Maybe FaultStatistics
faultStatistics :: Prelude.Maybe FaultStatistics,
ServiceStatistics -> Maybe Integer
okCount :: Prelude.Maybe Prelude.Integer,
ServiceStatistics -> Maybe Integer
totalCount :: Prelude.Maybe Prelude.Integer,
ServiceStatistics -> Maybe Double
totalResponseTime :: Prelude.Maybe Prelude.Double
}
deriving (ServiceStatistics -> ServiceStatistics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceStatistics -> ServiceStatistics -> Bool
$c/= :: ServiceStatistics -> ServiceStatistics -> Bool
== :: ServiceStatistics -> ServiceStatistics -> Bool
$c== :: ServiceStatistics -> ServiceStatistics -> Bool
Prelude.Eq, ReadPrec [ServiceStatistics]
ReadPrec ServiceStatistics
Int -> ReadS ServiceStatistics
ReadS [ServiceStatistics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceStatistics]
$creadListPrec :: ReadPrec [ServiceStatistics]
readPrec :: ReadPrec ServiceStatistics
$creadPrec :: ReadPrec ServiceStatistics
readList :: ReadS [ServiceStatistics]
$creadList :: ReadS [ServiceStatistics]
readsPrec :: Int -> ReadS ServiceStatistics
$creadsPrec :: Int -> ReadS ServiceStatistics
Prelude.Read, Int -> ServiceStatistics -> ShowS
[ServiceStatistics] -> ShowS
ServiceStatistics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceStatistics] -> ShowS
$cshowList :: [ServiceStatistics] -> ShowS
show :: ServiceStatistics -> String
$cshow :: ServiceStatistics -> String
showsPrec :: Int -> ServiceStatistics -> ShowS
$cshowsPrec :: Int -> ServiceStatistics -> ShowS
Prelude.Show, forall x. Rep ServiceStatistics x -> ServiceStatistics
forall x. ServiceStatistics -> Rep ServiceStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceStatistics x -> ServiceStatistics
$cfrom :: forall x. ServiceStatistics -> Rep ServiceStatistics x
Prelude.Generic)
newServiceStatistics ::
ServiceStatistics
newServiceStatistics :: ServiceStatistics
newServiceStatistics =
ServiceStatistics'
{ $sel:errorStatistics:ServiceStatistics' :: Maybe ErrorStatistics
errorStatistics =
forall a. Maybe a
Prelude.Nothing,
$sel:faultStatistics:ServiceStatistics' :: Maybe FaultStatistics
faultStatistics = forall a. Maybe a
Prelude.Nothing,
$sel:okCount:ServiceStatistics' :: Maybe Integer
okCount = forall a. Maybe a
Prelude.Nothing,
$sel:totalCount:ServiceStatistics' :: Maybe Integer
totalCount = forall a. Maybe a
Prelude.Nothing,
$sel:totalResponseTime:ServiceStatistics' :: Maybe Double
totalResponseTime = forall a. Maybe a
Prelude.Nothing
}
serviceStatistics_errorStatistics :: Lens.Lens' ServiceStatistics (Prelude.Maybe ErrorStatistics)
serviceStatistics_errorStatistics :: Lens' ServiceStatistics (Maybe ErrorStatistics)
serviceStatistics_errorStatistics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceStatistics' {Maybe ErrorStatistics
errorStatistics :: Maybe ErrorStatistics
$sel:errorStatistics:ServiceStatistics' :: ServiceStatistics -> Maybe ErrorStatistics
errorStatistics} -> Maybe ErrorStatistics
errorStatistics) (\s :: ServiceStatistics
s@ServiceStatistics' {} Maybe ErrorStatistics
a -> ServiceStatistics
s {$sel:errorStatistics:ServiceStatistics' :: Maybe ErrorStatistics
errorStatistics = Maybe ErrorStatistics
a} :: ServiceStatistics)
serviceStatistics_faultStatistics :: Lens.Lens' ServiceStatistics (Prelude.Maybe FaultStatistics)
serviceStatistics_faultStatistics :: Lens' ServiceStatistics (Maybe FaultStatistics)
serviceStatistics_faultStatistics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceStatistics' {Maybe FaultStatistics
faultStatistics :: Maybe FaultStatistics
$sel:faultStatistics:ServiceStatistics' :: ServiceStatistics -> Maybe FaultStatistics
faultStatistics} -> Maybe FaultStatistics
faultStatistics) (\s :: ServiceStatistics
s@ServiceStatistics' {} Maybe FaultStatistics
a -> ServiceStatistics
s {$sel:faultStatistics:ServiceStatistics' :: Maybe FaultStatistics
faultStatistics = Maybe FaultStatistics
a} :: ServiceStatistics)
serviceStatistics_okCount :: Lens.Lens' ServiceStatistics (Prelude.Maybe Prelude.Integer)
serviceStatistics_okCount :: Lens' ServiceStatistics (Maybe Integer)
serviceStatistics_okCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceStatistics' {Maybe Integer
okCount :: Maybe Integer
$sel:okCount:ServiceStatistics' :: ServiceStatistics -> Maybe Integer
okCount} -> Maybe Integer
okCount) (\s :: ServiceStatistics
s@ServiceStatistics' {} Maybe Integer
a -> ServiceStatistics
s {$sel:okCount:ServiceStatistics' :: Maybe Integer
okCount = Maybe Integer
a} :: ServiceStatistics)
serviceStatistics_totalCount :: Lens.Lens' ServiceStatistics (Prelude.Maybe Prelude.Integer)
serviceStatistics_totalCount :: Lens' ServiceStatistics (Maybe Integer)
serviceStatistics_totalCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceStatistics' {Maybe Integer
totalCount :: Maybe Integer
$sel:totalCount:ServiceStatistics' :: ServiceStatistics -> Maybe Integer
totalCount} -> Maybe Integer
totalCount) (\s :: ServiceStatistics
s@ServiceStatistics' {} Maybe Integer
a -> ServiceStatistics
s {$sel:totalCount:ServiceStatistics' :: Maybe Integer
totalCount = Maybe Integer
a} :: ServiceStatistics)
serviceStatistics_totalResponseTime :: Lens.Lens' ServiceStatistics (Prelude.Maybe Prelude.Double)
serviceStatistics_totalResponseTime :: Lens' ServiceStatistics (Maybe Double)
serviceStatistics_totalResponseTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceStatistics' {Maybe Double
totalResponseTime :: Maybe Double
$sel:totalResponseTime:ServiceStatistics' :: ServiceStatistics -> Maybe Double
totalResponseTime} -> Maybe Double
totalResponseTime) (\s :: ServiceStatistics
s@ServiceStatistics' {} Maybe Double
a -> ServiceStatistics
s {$sel:totalResponseTime:ServiceStatistics' :: Maybe Double
totalResponseTime = Maybe Double
a} :: ServiceStatistics)
instance Data.FromJSON ServiceStatistics where
parseJSON :: Value -> Parser ServiceStatistics
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ServiceStatistics"
( \Object
x ->
Maybe ErrorStatistics
-> Maybe FaultStatistics
-> Maybe Integer
-> Maybe Integer
-> Maybe Double
-> ServiceStatistics
ServiceStatistics'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ErrorStatistics")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"FaultStatistics")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OkCount")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"TotalCount")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"TotalResponseTime")
)
instance Prelude.Hashable ServiceStatistics where
hashWithSalt :: Int -> ServiceStatistics -> Int
hashWithSalt Int
_salt ServiceStatistics' {Maybe Double
Maybe Integer
Maybe ErrorStatistics
Maybe FaultStatistics
totalResponseTime :: Maybe Double
totalCount :: Maybe Integer
okCount :: Maybe Integer
faultStatistics :: Maybe FaultStatistics
errorStatistics :: Maybe ErrorStatistics
$sel:totalResponseTime:ServiceStatistics' :: ServiceStatistics -> Maybe Double
$sel:totalCount:ServiceStatistics' :: ServiceStatistics -> Maybe Integer
$sel:okCount:ServiceStatistics' :: ServiceStatistics -> Maybe Integer
$sel:faultStatistics:ServiceStatistics' :: ServiceStatistics -> Maybe FaultStatistics
$sel:errorStatistics:ServiceStatistics' :: ServiceStatistics -> Maybe ErrorStatistics
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ErrorStatistics
errorStatistics
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FaultStatistics
faultStatistics
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
okCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
totalCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
totalResponseTime
instance Prelude.NFData ServiceStatistics where
rnf :: ServiceStatistics -> ()
rnf ServiceStatistics' {Maybe Double
Maybe Integer
Maybe ErrorStatistics
Maybe FaultStatistics
totalResponseTime :: Maybe Double
totalCount :: Maybe Integer
okCount :: Maybe Integer
faultStatistics :: Maybe FaultStatistics
errorStatistics :: Maybe ErrorStatistics
$sel:totalResponseTime:ServiceStatistics' :: ServiceStatistics -> Maybe Double
$sel:totalCount:ServiceStatistics' :: ServiceStatistics -> Maybe Integer
$sel:okCount:ServiceStatistics' :: ServiceStatistics -> Maybe Integer
$sel:faultStatistics:ServiceStatistics' :: ServiceStatistics -> Maybe FaultStatistics
$sel:errorStatistics:ServiceStatistics' :: ServiceStatistics -> Maybe ErrorStatistics
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ErrorStatistics
errorStatistics
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FaultStatistics
faultStatistics
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
okCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
totalCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
totalResponseTime