{-# 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.Athena.Types.QueryRuntimeStatisticsRows
-- 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.Athena.Types.QueryRuntimeStatisticsRows 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 such as input rows and bytes read by the query, rows and
-- bytes output by the query, and the number of rows written by the query.
--
-- /See:/ 'newQueryRuntimeStatisticsRows' smart constructor.
data QueryRuntimeStatisticsRows = QueryRuntimeStatisticsRows'
  { -- | The number of bytes read to execute the query.
    QueryRuntimeStatisticsRows -> Maybe Integer
inputBytes :: Prelude.Maybe Prelude.Integer,
    -- | The number of rows read to execute the query.
    QueryRuntimeStatisticsRows -> Maybe Integer
inputRows :: Prelude.Maybe Prelude.Integer,
    -- | The number of bytes returned by the query.
    QueryRuntimeStatisticsRows -> Maybe Integer
outputBytes :: Prelude.Maybe Prelude.Integer,
    -- | The number of rows returned by the query.
    QueryRuntimeStatisticsRows -> Maybe Integer
outputRows :: Prelude.Maybe Prelude.Integer
  }
  deriving (QueryRuntimeStatisticsRows -> QueryRuntimeStatisticsRows -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QueryRuntimeStatisticsRows -> QueryRuntimeStatisticsRows -> Bool
$c/= :: QueryRuntimeStatisticsRows -> QueryRuntimeStatisticsRows -> Bool
== :: QueryRuntimeStatisticsRows -> QueryRuntimeStatisticsRows -> Bool
$c== :: QueryRuntimeStatisticsRows -> QueryRuntimeStatisticsRows -> Bool
Prelude.Eq, ReadPrec [QueryRuntimeStatisticsRows]
ReadPrec QueryRuntimeStatisticsRows
Int -> ReadS QueryRuntimeStatisticsRows
ReadS [QueryRuntimeStatisticsRows]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [QueryRuntimeStatisticsRows]
$creadListPrec :: ReadPrec [QueryRuntimeStatisticsRows]
readPrec :: ReadPrec QueryRuntimeStatisticsRows
$creadPrec :: ReadPrec QueryRuntimeStatisticsRows
readList :: ReadS [QueryRuntimeStatisticsRows]
$creadList :: ReadS [QueryRuntimeStatisticsRows]
readsPrec :: Int -> ReadS QueryRuntimeStatisticsRows
$creadsPrec :: Int -> ReadS QueryRuntimeStatisticsRows
Prelude.Read, Int -> QueryRuntimeStatisticsRows -> ShowS
[QueryRuntimeStatisticsRows] -> ShowS
QueryRuntimeStatisticsRows -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QueryRuntimeStatisticsRows] -> ShowS
$cshowList :: [QueryRuntimeStatisticsRows] -> ShowS
show :: QueryRuntimeStatisticsRows -> String
$cshow :: QueryRuntimeStatisticsRows -> String
showsPrec :: Int -> QueryRuntimeStatisticsRows -> ShowS
$cshowsPrec :: Int -> QueryRuntimeStatisticsRows -> ShowS
Prelude.Show, forall x.
Rep QueryRuntimeStatisticsRows x -> QueryRuntimeStatisticsRows
forall x.
QueryRuntimeStatisticsRows -> Rep QueryRuntimeStatisticsRows x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep QueryRuntimeStatisticsRows x -> QueryRuntimeStatisticsRows
$cfrom :: forall x.
QueryRuntimeStatisticsRows -> Rep QueryRuntimeStatisticsRows x
Prelude.Generic)

-- |
-- Create a value of 'QueryRuntimeStatisticsRows' 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:
--
-- 'inputBytes', 'queryRuntimeStatisticsRows_inputBytes' - The number of bytes read to execute the query.
--
-- 'inputRows', 'queryRuntimeStatisticsRows_inputRows' - The number of rows read to execute the query.
--
-- 'outputBytes', 'queryRuntimeStatisticsRows_outputBytes' - The number of bytes returned by the query.
--
-- 'outputRows', 'queryRuntimeStatisticsRows_outputRows' - The number of rows returned by the query.
newQueryRuntimeStatisticsRows ::
  QueryRuntimeStatisticsRows
newQueryRuntimeStatisticsRows :: QueryRuntimeStatisticsRows
newQueryRuntimeStatisticsRows =
  QueryRuntimeStatisticsRows'
    { $sel:inputBytes:QueryRuntimeStatisticsRows' :: Maybe Integer
inputBytes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:inputRows:QueryRuntimeStatisticsRows' :: Maybe Integer
inputRows = forall a. Maybe a
Prelude.Nothing,
      $sel:outputBytes:QueryRuntimeStatisticsRows' :: Maybe Integer
outputBytes = forall a. Maybe a
Prelude.Nothing,
      $sel:outputRows:QueryRuntimeStatisticsRows' :: Maybe Integer
outputRows = forall a. Maybe a
Prelude.Nothing
    }

-- | The number of bytes read to execute the query.
queryRuntimeStatisticsRows_inputBytes :: Lens.Lens' QueryRuntimeStatisticsRows (Prelude.Maybe Prelude.Integer)
queryRuntimeStatisticsRows_inputBytes :: Lens' QueryRuntimeStatisticsRows (Maybe Integer)
queryRuntimeStatisticsRows_inputBytes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryRuntimeStatisticsRows' {Maybe Integer
inputBytes :: Maybe Integer
$sel:inputBytes:QueryRuntimeStatisticsRows' :: QueryRuntimeStatisticsRows -> Maybe Integer
inputBytes} -> Maybe Integer
inputBytes) (\s :: QueryRuntimeStatisticsRows
s@QueryRuntimeStatisticsRows' {} Maybe Integer
a -> QueryRuntimeStatisticsRows
s {$sel:inputBytes:QueryRuntimeStatisticsRows' :: Maybe Integer
inputBytes = Maybe Integer
a} :: QueryRuntimeStatisticsRows)

-- | The number of rows read to execute the query.
queryRuntimeStatisticsRows_inputRows :: Lens.Lens' QueryRuntimeStatisticsRows (Prelude.Maybe Prelude.Integer)
queryRuntimeStatisticsRows_inputRows :: Lens' QueryRuntimeStatisticsRows (Maybe Integer)
queryRuntimeStatisticsRows_inputRows = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryRuntimeStatisticsRows' {Maybe Integer
inputRows :: Maybe Integer
$sel:inputRows:QueryRuntimeStatisticsRows' :: QueryRuntimeStatisticsRows -> Maybe Integer
inputRows} -> Maybe Integer
inputRows) (\s :: QueryRuntimeStatisticsRows
s@QueryRuntimeStatisticsRows' {} Maybe Integer
a -> QueryRuntimeStatisticsRows
s {$sel:inputRows:QueryRuntimeStatisticsRows' :: Maybe Integer
inputRows = Maybe Integer
a} :: QueryRuntimeStatisticsRows)

-- | The number of bytes returned by the query.
queryRuntimeStatisticsRows_outputBytes :: Lens.Lens' QueryRuntimeStatisticsRows (Prelude.Maybe Prelude.Integer)
queryRuntimeStatisticsRows_outputBytes :: Lens' QueryRuntimeStatisticsRows (Maybe Integer)
queryRuntimeStatisticsRows_outputBytes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryRuntimeStatisticsRows' {Maybe Integer
outputBytes :: Maybe Integer
$sel:outputBytes:QueryRuntimeStatisticsRows' :: QueryRuntimeStatisticsRows -> Maybe Integer
outputBytes} -> Maybe Integer
outputBytes) (\s :: QueryRuntimeStatisticsRows
s@QueryRuntimeStatisticsRows' {} Maybe Integer
a -> QueryRuntimeStatisticsRows
s {$sel:outputBytes:QueryRuntimeStatisticsRows' :: Maybe Integer
outputBytes = Maybe Integer
a} :: QueryRuntimeStatisticsRows)

-- | The number of rows returned by the query.
queryRuntimeStatisticsRows_outputRows :: Lens.Lens' QueryRuntimeStatisticsRows (Prelude.Maybe Prelude.Integer)
queryRuntimeStatisticsRows_outputRows :: Lens' QueryRuntimeStatisticsRows (Maybe Integer)
queryRuntimeStatisticsRows_outputRows = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryRuntimeStatisticsRows' {Maybe Integer
outputRows :: Maybe Integer
$sel:outputRows:QueryRuntimeStatisticsRows' :: QueryRuntimeStatisticsRows -> Maybe Integer
outputRows} -> Maybe Integer
outputRows) (\s :: QueryRuntimeStatisticsRows
s@QueryRuntimeStatisticsRows' {} Maybe Integer
a -> QueryRuntimeStatisticsRows
s {$sel:outputRows:QueryRuntimeStatisticsRows' :: Maybe Integer
outputRows = Maybe Integer
a} :: QueryRuntimeStatisticsRows)

instance Data.FromJSON QueryRuntimeStatisticsRows where
  parseJSON :: Value -> Parser QueryRuntimeStatisticsRows
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"QueryRuntimeStatisticsRows"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> QueryRuntimeStatisticsRows
QueryRuntimeStatisticsRows'
            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
"InputBytes")
            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
"InputRows")
            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
"OutputBytes")
            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
"OutputRows")
      )

instance Prelude.Hashable QueryRuntimeStatisticsRows where
  hashWithSalt :: Int -> QueryRuntimeStatisticsRows -> Int
hashWithSalt Int
_salt QueryRuntimeStatisticsRows' {Maybe Integer
outputRows :: Maybe Integer
outputBytes :: Maybe Integer
inputRows :: Maybe Integer
inputBytes :: Maybe Integer
$sel:outputRows:QueryRuntimeStatisticsRows' :: QueryRuntimeStatisticsRows -> Maybe Integer
$sel:outputBytes:QueryRuntimeStatisticsRows' :: QueryRuntimeStatisticsRows -> Maybe Integer
$sel:inputRows:QueryRuntimeStatisticsRows' :: QueryRuntimeStatisticsRows -> Maybe Integer
$sel:inputBytes:QueryRuntimeStatisticsRows' :: QueryRuntimeStatisticsRows -> Maybe Integer
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
inputBytes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
inputRows
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
outputBytes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
outputRows

instance Prelude.NFData QueryRuntimeStatisticsRows where
  rnf :: QueryRuntimeStatisticsRows -> ()
rnf QueryRuntimeStatisticsRows' {Maybe Integer
outputRows :: Maybe Integer
outputBytes :: Maybe Integer
inputRows :: Maybe Integer
inputBytes :: Maybe Integer
$sel:outputRows:QueryRuntimeStatisticsRows' :: QueryRuntimeStatisticsRows -> Maybe Integer
$sel:outputBytes:QueryRuntimeStatisticsRows' :: QueryRuntimeStatisticsRows -> Maybe Integer
$sel:inputRows:QueryRuntimeStatisticsRows' :: QueryRuntimeStatisticsRows -> Maybe Integer
$sel:inputBytes:QueryRuntimeStatisticsRows' :: QueryRuntimeStatisticsRows -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
inputBytes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
inputRows
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
outputBytes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
outputRows