@@ -258,6 +258,18 @@ module Database.Bloodhound.Types
258258 , NodeName(..)
259259 , ClusterName(..)
260260 , NodesInfo(..)
261+ , NodesStats(..)
262+ , NodeStats(..)
263+ , NodeBreakerStats(..)
264+ , NodeHTTPStats(..)
265+ , NodeTransportStats(..)
266+ , NodeFSStats(..)
267+ , NodeNetworkStats(..)
268+ , NodeThreadPoolsStats(..)
269+ , NodeJVMStats(..)
270+ , NodeProcessStats(..)
271+ , NodeOSStats(..)
272+ , NodeIndicesStats(..)
261273 , EsAddress(..)
262274 , PluginName(..)
263275 , NodeInfo(..)
@@ -3841,6 +3853,58 @@ data NodesInfo = NodesInfo {
38413853 , nodesClusterName :: ClusterName
38423854 } deriving (Eq, Show, Generic, Typeable)
38433855
3856+data NodesStats = NodesStats {
3857+ nodesStats :: [NodeStats]
3858+ , nodesStatsClusterName :: ClusterName
3859+ } deriving (Eq, Show, Generic, Typeable)
3860+
3861+data NodeStats = NodeStats {
3862+ nodeStatsName :: NodeName
3863+ , nodeStatsFullId :: FullNodeId
3864+ , nodeStatsParentBreaker :: NodeBreakerStats
3865+ , nodeStatsRequestBreaker :: NodeBreakerStats
3866+ , nodeStatsFieldDataBreaker :: NodeBreakerStats
3867+ , nodeStatsHTTP :: NodeHTTPStats
3868+ , nodeStatsTransport :: NodeTransportStats
3869+ , nodeStatsFS :: NodeFSStats
3870+ , nodeStatsNetwork :: NodeNetworkStats
3871+ , nodeStatsThreadPool :: NodeThreadPoolsStats
3872+ , nodeStatsJVM :: NodeJVMStats
3873+ , nodeStatsProcess :: NodeProcessStats
3874+ , nodeStatsOS :: NodeOSStats
3875+ , nodeStatsIndices :: NodeIndicesStats
3876+ } deriving (Eq, Show, Generic, Typeable)
3877+
3878+data NodeBreakerStats = NodeBreakerStats
3879+ deriving (Eq, Show, Generic, Typeable)
3880+
3881+data NodeHTTPStats = NodeHTTPStats
3882+ deriving (Eq, Show, Generic, Typeable)
3883+
3884+data NodeTransportStats = NodeTransportStats
3885+ deriving (Eq, Show, Generic, Typeable)
3886+
3887+data NodeFSStats = NodeFSStats
3888+ deriving (Eq, Show, Generic, Typeable)
3889+
3890+data NodeNetworkStats = NodeNetworkStats
3891+ deriving (Eq, Show, Generic, Typeable)
3892+
3893+data NodeThreadPoolsStats = NodeThreadPoolsStats
3894+ deriving (Eq, Show, Generic, Typeable)
3895+
3896+data NodeJVMStats = NodeJVMStats
3897+ deriving (Eq, Show, Generic, Typeable)
3898+
3899+data NodeProcessStats = NodeProcessStats
3900+ deriving (Eq, Show, Generic, Typeable)
3901+
3902+data NodeOSStats = NodeOSStats
3903+ deriving (Eq, Show, Generic, Typeable)
3904+
3905+data NodeIndicesStats = NodeIndicesStats
3906+ deriving (Eq, Show, Generic, Typeable)
3907+
38443908-- | A quirky address format used throughout ElasticSearch. An example
38453909-- would be inet[/1.1.1.1:9200]. inet may be a placeholder for a
38463910-- <https://en.wikipedia.org/wiki/Fully_qualified_domain_name FQDN>.
@@ -4360,6 +4424,64 @@ instance FromJSON NodesInfo where
43604424 cn <- o .: "cluster_name"
43614425 return (NodesInfo infos cn)
43624426
4427+instance FromJSON NodesStats where
4428+ parseJSON = withObject "NodesStats" parse
4429+ where
4430+ parse o = do
4431+ nodes <- o .: "nodes"
4432+ stats <- forM (HM.toList nodes) $ \(fullNID, v) -> do
4433+ node <- parseJSON v
4434+ parseNodeStats (FullNodeId fullNID) node
4435+ cn <- o .: "cluster_name"
4436+ return (NodesStats stats cn)
4437+
4438+instance FromJSON NodeBreakerStats where
4439+ parseJSON _ = pure NodeBreakerStats
4440+
4441+instance FromJSON NodeHTTPStats where
4442+ parseJSON _ = pure NodeHTTPStats
4443+
4444+instance FromJSON NodeTransportStats where
4445+ parseJSON _ = pure NodeTransportStats
4446+
4447+instance FromJSON NodeFSStats where
4448+ parseJSON _ = pure NodeFSStats
4449+
4450+instance FromJSON NodeNetworkStats where
4451+ parseJSON _ = pure NodeNetworkStats
4452+
4453+instance FromJSON NodeThreadPoolsStats where
4454+ parseJSON _ = pure NodeThreadPoolsStats
4455+
4456+instance FromJSON NodeJVMStats where
4457+ parseJSON _ = pure NodeJVMStats
4458+
4459+instance FromJSON NodeProcessStats where
4460+ parseJSON _ = pure NodeProcessStats
4461+
4462+instance FromJSON NodeOSStats where
4463+ parseJSON _ = pure NodeOSStats
4464+
4465+instance FromJSON NodeIndicesStats where
4466+ parseJSON _ = pure NodeIndicesStats
4467+
4468+parseNodeStats :: FullNodeId -> Object -> Parser NodeStats
4469+parseNodeStats fnid o = do
4470+ breakers <- o .: "breakers"
4471+ NodeStats <$> o .: "name"
4472+ <*> pure fnid
4473+ <*> breakers .: "parent"
4474+ <*> breakers .: "request"
4475+ <*> breakers .: "fielddata"
4476+ <*> o .: "http"
4477+ <*> o .: "transport"
4478+ <*> o .: "fs"
4479+ <*> o .: "network"
4480+ <*> o .: "thread_pool"
4481+ <*> o .: "jvm"
4482+ <*> o .: "process"
4483+ <*> o .: "os"
4484+ <*> o .: "indices"
43634485
43644486parseNodeInfo :: FullNodeId -> Object -> Parser NodeInfo
43654487parseNodeInfo nid o =