{-# 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.LakeFormation.Types.PlanningStatistics
-- 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.LakeFormation.Types.PlanningStatistics 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

-- | Statistics related to the processing of a query statement.
--
-- /See:/ 'newPlanningStatistics' smart constructor.
data PlanningStatistics = PlanningStatistics'
  { -- | An estimate of the data that was scanned in bytes.
    PlanningStatistics -> Maybe Integer
estimatedDataToScanBytes :: Prelude.Maybe Prelude.Integer,
    -- | The time that it took to process the request.
    PlanningStatistics -> Maybe Integer
planningTimeMillis :: Prelude.Maybe Prelude.Integer,
    -- | The time the request was in queue to be processed.
    PlanningStatistics -> Maybe Integer
queueTimeMillis :: Prelude.Maybe Prelude.Integer,
    -- | The number of work units generated.
    PlanningStatistics -> Maybe Integer
workUnitsGeneratedCount :: Prelude.Maybe Prelude.Integer
  }
  deriving (PlanningStatistics -> PlanningStatistics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PlanningStatistics -> PlanningStatistics -> Bool
$c/= :: PlanningStatistics -> PlanningStatistics -> Bool
== :: PlanningStatistics -> PlanningStatistics -> Bool
$c== :: PlanningStatistics -> PlanningStatistics -> Bool
Prelude.Eq, ReadPrec [PlanningStatistics]
ReadPrec PlanningStatistics
Int -> ReadS PlanningStatistics
ReadS [PlanningStatistics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PlanningStatistics]
$creadListPrec :: ReadPrec [PlanningStatistics]
readPrec :: ReadPrec PlanningStatistics
$creadPrec :: ReadPrec PlanningStatistics
readList :: ReadS [PlanningStatistics]
$creadList :: ReadS [PlanningStatistics]
readsPrec :: Int -> ReadS PlanningStatistics
$creadsPrec :: Int -> ReadS PlanningStatistics
Prelude.Read, Int -> PlanningStatistics -> ShowS
[PlanningStatistics] -> ShowS
PlanningStatistics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PlanningStatistics] -> ShowS
$cshowList :: [PlanningStatistics] -> ShowS
show :: PlanningStatistics -> String
$cshow :: PlanningStatistics -> String
showsPrec :: Int -> PlanningStatistics -> ShowS
$cshowsPrec :: Int -> PlanningStatistics -> ShowS
Prelude.Show, forall x. Rep PlanningStatistics x -> PlanningStatistics
forall x. PlanningStatistics -> Rep PlanningStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PlanningStatistics x -> PlanningStatistics
$cfrom :: forall x. PlanningStatistics -> Rep PlanningStatistics x
Prelude.Generic)

-- |
-- Create a value of 'PlanningStatistics' 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:
--
-- 'estimatedDataToScanBytes', 'planningStatistics_estimatedDataToScanBytes' - An estimate of the data that was scanned in bytes.
--
-- 'planningTimeMillis', 'planningStatistics_planningTimeMillis' - The time that it took to process the request.
--
-- 'queueTimeMillis', 'planningStatistics_queueTimeMillis' - The time the request was in queue to be processed.
--
-- 'workUnitsGeneratedCount', 'planningStatistics_workUnitsGeneratedCount' - The number of work units generated.
newPlanningStatistics ::
  PlanningStatistics
newPlanningStatistics :: PlanningStatistics
newPlanningStatistics =
  PlanningStatistics'
    { $sel:estimatedDataToScanBytes:PlanningStatistics' :: Maybe Integer
estimatedDataToScanBytes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:planningTimeMillis:PlanningStatistics' :: Maybe Integer
planningTimeMillis = forall a. Maybe a
Prelude.Nothing,
      $sel:queueTimeMillis:PlanningStatistics' :: Maybe Integer
queueTimeMillis = forall a. Maybe a
Prelude.Nothing,
      $sel:workUnitsGeneratedCount:PlanningStatistics' :: Maybe Integer
workUnitsGeneratedCount = forall a. Maybe a
Prelude.Nothing
    }

-- | An estimate of the data that was scanned in bytes.
planningStatistics_estimatedDataToScanBytes :: Lens.Lens' PlanningStatistics (Prelude.Maybe Prelude.Integer)
planningStatistics_estimatedDataToScanBytes :: Lens' PlanningStatistics (Maybe Integer)
planningStatistics_estimatedDataToScanBytes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlanningStatistics' {Maybe Integer
estimatedDataToScanBytes :: Maybe Integer
$sel:estimatedDataToScanBytes:PlanningStatistics' :: PlanningStatistics -> Maybe Integer
estimatedDataToScanBytes} -> Maybe Integer
estimatedDataToScanBytes) (\s :: PlanningStatistics
s@PlanningStatistics' {} Maybe Integer
a -> PlanningStatistics
s {$sel:estimatedDataToScanBytes:PlanningStatistics' :: Maybe Integer
estimatedDataToScanBytes = Maybe Integer
a} :: PlanningStatistics)

-- | The time that it took to process the request.
planningStatistics_planningTimeMillis :: Lens.Lens' PlanningStatistics (Prelude.Maybe Prelude.Integer)
planningStatistics_planningTimeMillis :: Lens' PlanningStatistics (Maybe Integer)
planningStatistics_planningTimeMillis = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlanningStatistics' {Maybe Integer
planningTimeMillis :: Maybe Integer
$sel:planningTimeMillis:PlanningStatistics' :: PlanningStatistics -> Maybe Integer
planningTimeMillis} -> Maybe Integer
planningTimeMillis) (\s :: PlanningStatistics
s@PlanningStatistics' {} Maybe Integer
a -> PlanningStatistics
s {$sel:planningTimeMillis:PlanningStatistics' :: Maybe Integer
planningTimeMillis = Maybe Integer
a} :: PlanningStatistics)

-- | The time the request was in queue to be processed.
planningStatistics_queueTimeMillis :: Lens.Lens' PlanningStatistics (Prelude.Maybe Prelude.Integer)
planningStatistics_queueTimeMillis :: Lens' PlanningStatistics (Maybe Integer)
planningStatistics_queueTimeMillis = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlanningStatistics' {Maybe Integer
queueTimeMillis :: Maybe Integer
$sel:queueTimeMillis:PlanningStatistics' :: PlanningStatistics -> Maybe Integer
queueTimeMillis} -> Maybe Integer
queueTimeMillis) (\s :: PlanningStatistics
s@PlanningStatistics' {} Maybe Integer
a -> PlanningStatistics
s {$sel:queueTimeMillis:PlanningStatistics' :: Maybe Integer
queueTimeMillis = Maybe Integer
a} :: PlanningStatistics)

-- | The number of work units generated.
planningStatistics_workUnitsGeneratedCount :: Lens.Lens' PlanningStatistics (Prelude.Maybe Prelude.Integer)
planningStatistics_workUnitsGeneratedCount :: Lens' PlanningStatistics (Maybe Integer)
planningStatistics_workUnitsGeneratedCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlanningStatistics' {Maybe Integer
workUnitsGeneratedCount :: Maybe Integer
$sel:workUnitsGeneratedCount:PlanningStatistics' :: PlanningStatistics -> Maybe Integer
workUnitsGeneratedCount} -> Maybe Integer
workUnitsGeneratedCount) (\s :: PlanningStatistics
s@PlanningStatistics' {} Maybe Integer
a -> PlanningStatistics
s {$sel:workUnitsGeneratedCount:PlanningStatistics' :: Maybe Integer
workUnitsGeneratedCount = Maybe Integer
a} :: PlanningStatistics)

instance Data.FromJSON PlanningStatistics where
  parseJSON :: Value -> Parser PlanningStatistics
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PlanningStatistics"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> PlanningStatistics
PlanningStatistics'
            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
"EstimatedDataToScanBytes")
            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
"PlanningTimeMillis")
            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
"QueueTimeMillis")
            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
"WorkUnitsGeneratedCount")
      )

instance Prelude.Hashable PlanningStatistics where
  hashWithSalt :: Int -> PlanningStatistics -> Int
hashWithSalt Int
_salt PlanningStatistics' {Maybe Integer
workUnitsGeneratedCount :: Maybe Integer
queueTimeMillis :: Maybe Integer
planningTimeMillis :: Maybe Integer
estimatedDataToScanBytes :: Maybe Integer
$sel:workUnitsGeneratedCount:PlanningStatistics' :: PlanningStatistics -> Maybe Integer
$sel:queueTimeMillis:PlanningStatistics' :: PlanningStatistics -> Maybe Integer
$sel:planningTimeMillis:PlanningStatistics' :: PlanningStatistics -> Maybe Integer
$sel:estimatedDataToScanBytes:PlanningStatistics' :: PlanningStatistics -> Maybe Integer
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
estimatedDataToScanBytes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
planningTimeMillis
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
queueTimeMillis
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
workUnitsGeneratedCount

instance Prelude.NFData PlanningStatistics where
  rnf :: PlanningStatistics -> ()
rnf PlanningStatistics' {Maybe Integer
workUnitsGeneratedCount :: Maybe Integer
queueTimeMillis :: Maybe Integer
planningTimeMillis :: Maybe Integer
estimatedDataToScanBytes :: Maybe Integer
$sel:workUnitsGeneratedCount:PlanningStatistics' :: PlanningStatistics -> Maybe Integer
$sel:queueTimeMillis:PlanningStatistics' :: PlanningStatistics -> Maybe Integer
$sel:planningTimeMillis:PlanningStatistics' :: PlanningStatistics -> Maybe Integer
$sel:estimatedDataToScanBytes:PlanningStatistics' :: PlanningStatistics -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
estimatedDataToScanBytes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
planningTimeMillis
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
queueTimeMillis
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
workUnitsGeneratedCount