@@ -260,12 +260,16 @@ module Database.Bloodhound.Types
260 , NodesInfo(..)
260 , NodesInfo(..)
261 , NodesStats(..)
261 , NodesStats(..)
262 , NodeStats(..)
262 , NodeStats(..)
263+ , NodeBreakersStats(..)
263 , NodeBreakerStats(..)
264 , NodeBreakerStats(..)
264 , NodeHTTPStats(..)
265 , NodeHTTPStats(..)
265 , NodeTransportStats(..)
266 , NodeTransportStats(..)
266 , NodeFSStats(..)
267 , NodeFSStats(..)
268+ , NodeDataPathStats(..)
269+ , NodeFSTotalStats(..)
267 , NodeNetworkStats(..)
270 , NodeNetworkStats(..)
268 , NodeThreadPoolsStats(..)
271 , NodeThreadPoolsStats(..)
272+ , NodeThreadPoolStats(..)
269 , NodeJVMStats(..)
273 , NodeJVMStats(..)
270 , NodeProcessStats(..)
274 , NodeProcessStats(..)
271 , NodeOSStats(..)
275 , NodeOSStats(..)
@@ -3859,39 +3863,125 @@ data NodesStats = NodesStats {
3859 } deriving (Eq, Show, Generic, Typeable)
3863 } deriving (Eq, Show, Generic, Typeable)
3861data NodeStats = NodeStats {
3865data NodeStats = NodeStats {
3862− nodeStatsName :: NodeName
3866+ nodeStatsName :: NodeName
3863− , nodeStatsFullId :: FullNodeId
3867+ , nodeStatsFullId :: FullNodeId
3868+ , nodeStatsBreakersStats :: NodeBreakersStats
3869+ , nodeStatsHTTP :: NodeHTTPStats
3870+ , nodeStatsTransport :: NodeTransportStats
3871+ , nodeStatsFS :: NodeFSStats
3872+ , nodeStatsNetwork :: NodeNetworkStats
3873+ , nodeStatsThreadPool :: NodeThreadPoolsStats
3874+ , nodeStatsJVM :: NodeJVMStats
3875+ , nodeStatsProcess :: NodeProcessStats
3876+ , nodeStatsOS :: NodeOSStats
3877+ , nodeStatsIndices :: NodeIndicesStats
3878+ } deriving (Eq, Show, Generic, Typeable)
3880+data NodeBreakersStats = NodeBreakersStats {
3864− , nodeStatsParentBreaker :: NodeBreakerStats
3881+ nodeStatsParentBreaker :: NodeBreakerStats
3865 , nodeStatsRequestBreaker :: NodeBreakerStats
3882 , nodeStatsRequestBreaker :: NodeBreakerStats
3866 , nodeStatsFieldDataBreaker :: NodeBreakerStats
3883 , 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)
3884 } deriving (Eq, Show, Generic, Typeable)
3878−data NodeBreakerStats = NodeBreakerStats
3886+data NodeBreakerStats = NodeBreakerStats {
3887+ nodeBreakersTripped :: Int
3888+ , nodeBreakersOverhead :: Double
3889+ , nodeBreakersEstSize :: Bytes
3890+ , nodeBreakersLimitSize :: Bytes
3879− deriving (Eq, Show, Generic, Typeable)
3891+ } deriving (Eq, Show, Generic, Typeable)
3881−data NodeHTTPStats = NodeHTTPStats
3893+data NodeHTTPStats = NodeHTTPStats {
3894+ nodeHTTPTotalOpened :: Int
3895+ , nodeHTTPCurrentOpen :: Int
3882− deriving (Eq, Show, Generic, Typeable)
3896+ } deriving (Eq, Show, Generic, Typeable)
3884−data NodeTransportStats = NodeTransportStats
3898+data NodeTransportStats = NodeTransportStats {
3899+ nodeTransportTXSize :: Bytes
3900+ , nodeTransportCount :: Int
3901+ , nodeTransportRXSize :: Bytes
3902+ , nodeTransportRXCount :: Int
3903+ , nodeTransportServerOpen :: Int
3885− deriving (Eq, Show, Generic, Typeable)
3904+ } deriving (Eq, Show, Generic, Typeable)
3887−data NodeFSStats = NodeFSStats
3906+data NodeFSStats = NodeFSStats {
3907+ nodeFSDataPaths :: [NodeDataPathStats]
3908+ , nodeFSTotal :: NodeFSTotalStats
3909+ , nodeFSTimestamp :: UTCTime
3888− deriving (Eq, Show, Generic, Typeable)
3910+ } deriving (Eq, Show, Generic, Typeable)
3890−data NodeNetworkStats = NodeNetworkStats
3912+data NodeDataPathStats = NodeDataPathStats {
3913+ nodeDataPathDiskServiceTime :: Double
3914+ , nodeDataPathDiskQueue :: Double
3915+ , nodeDataPathIOSize :: Bytes
3916+ , nodeDataPathWriteSize :: Bytes
3917+ , nodeDataPathReadSize :: Bytes
3918+ , nodeDataPathIOOps :: Int
3919+ , nodeDataPathWrites :: Int
3920+ , nodeDataPathReads :: Int
3921+ , nodeDataPathAvailable :: Bytes
3922+ , nodeDataPathFree :: Bytes
3923+ , nodeDataPathTotal :: Bytes
3924+ , nodeDataPathType :: Text
3925+ , nodeDataPathDevice :: Text
3926+ , nodeDataPathMount :: Text
3927+ , nodeDataPathPath :: Text
3928+ } deriving (Eq, Show, Generic, Typeable)
3930+data NodeFSTotalStats = NodeFSTotalStats {
3931+ nodeFSTotalDiskServiceTime :: Double
3932+ , nodeFSTotalDiskQueue :: Double
3933+ , nodeFSTotalIOSize :: Bytes
3934+ , nodeFSTotalWriteSize :: Bytes
3935+ , nodeFSTotalReadSize :: Bytes
3936+ , nodeFSTotalIOOps :: Int
3937+ , nodeFSTotalWrites :: Int
3938+ , nodeFSTotalReads :: Int
3939+ , nodeFSTotalAvailable :: Bytes
3940+ , nodeFSTotalFree :: Bytes
3941+ , nodeFSTotalTotal :: Bytes
3891− deriving (Eq, Show, Generic, Typeable)
3942+ } deriving (Eq, Show, Generic, Typeable)
3944+data NodeNetworkStats = NodeNetworkStats {
3945+ nodeNetTCPOutRSTs :: Int
3946+ , nodeNetTCPInErrs :: Int
3947+ , nodeNetTCPAttemptFails :: Int
3948+ , nodeNetTCPEstabResets :: Int
3949+ , nodeNetTCPRetransSegs :: Int
3950+ , nodeNetTCPOutSegs :: Int
3951+ , nodeNetTCPInSegs :: Int
3952+ , nodeNetTCPCurrEstab :: Int
3953+ , nodeNetTCPPassiveOpens :: Int
3954+ , nodeNetTCPActiveOpens :: Int
3955+ } deriving (Eq, Show, Generic, Typeable)
3893−data NodeThreadPoolsStats = NodeThreadPoolsStats
3957+data NodeThreadPoolsStats = NodeThreadPoolsStats {
3958+ nodeThreadPoolsStatsSnapshot :: NodeThreadPoolStats
3959+ , nodeThreadPoolsStatsBulk :: NodeThreadPoolStats
3960+ , nodeThreadPoolsStatsMerge :: NodeThreadPoolStats
3961+ , nodeThreadPoolsStatsGet :: NodeThreadPoolStats
3962+ , nodeThreadPoolsStatsManagement :: NodeThreadPoolStats
3963+ , nodeThreadPoolsStatsFetchShardStore :: NodeThreadPoolStats
3964+ , nodeThreadPoolsStatsOptimize :: NodeThreadPoolStats
3965+ , nodeThreadPoolsStatsFlush :: NodeThreadPoolStats
3966+ , nodeThreadPoolsStatsSearch :: NodeThreadPoolStats
3967+ , nodeThreadPoolsStatsWarmer :: NodeThreadPoolStats
3968+ , nodeThreadPoolsStatsGeneric :: NodeThreadPoolStats
3969+ , nodeThreadPoolsStatsSuggest :: NodeThreadPoolStats
3970+ , nodeThreadPoolsStatsRefresh :: NodeThreadPoolStats
3971+ , nodeThreadPoolsStatsIndex :: NodeThreadPoolStats
3972+ , nodeThreadPoolsStatsListener :: NodeThreadPoolStats
3973+ , nodeThreadPoolsStatsFetchShardStarted :: NodeThreadPoolStats
3974+ , nodeThreadPoolsStatsPercolate :: NodeThreadPoolStats
3975+ } deriving (Eq, Show, Generic, Typeable)
3977+data NodeThreadPoolStats = NodeThreadPoolStats {
3978+ nodeThreadPoolCompleted :: Int
3979+ , nodeThreadPoolLargest :: Int
3980+ , nodeThreadPoolRejected :: Int
3981+ , nodeThreadPoolActive :: Int
3982+ , nodeThreadPoolQueue :: Int
3983+ , nodeThreadPoolThreads :: Int
3894− deriving (Eq, Show, Generic, Typeable)
3984+ } deriving (Eq, Show, Generic, Typeable)
3896data NodeJVMStats = NodeJVMStats
3986data NodeJVMStats = NodeJVMStats
3897 deriving (Eq, Show, Generic, Typeable)
3987 deriving (Eq, Show, Generic, Typeable)
@@ -4436,22 +4526,114 @@ instance FromJSON NodesStats where
4436 return (NodesStats stats cn)
4526 return (NodesStats stats cn)
4438instance FromJSON NodeBreakerStats where
4528instance FromJSON NodeBreakerStats where
4439− parseJSON _ = pure NodeBreakerStats
4529+ parseJSON = withObject "NodeBreakerStats" parse
4531+ parse o = NodeBreakerStats <$> o .: "tripped"
4532+ <*> o .: "overhead"
4533+ <*> o .: "estimated_size_in_bytes"
4534+ <*> o .: "limit_size_in_bytes"
4441instance FromJSON NodeHTTPStats where
4536instance FromJSON NodeHTTPStats where
4442− parseJSON _ = pure NodeHTTPStats
4537+ parseJSON = withObject "NodeHTTPStats" parse
4539+ parse o = NodeHTTPStats <$> o .: "total_opened"
4540+ <*> o .: "current_open"
4444instance FromJSON NodeTransportStats where
4542instance FromJSON NodeTransportStats where
4445− parseJSON _ = pure NodeTransportStats
4543+ parseJSON = withObject "NodeTransportStats" parse
4545+ parse o = NodeTransportStats <$> o .: "tx_size_in_bytes"
4546+ <*> o .: "tx_count"
4547+ <*> o .: "rx_size_in_bytes"
4548+ <*> o .: "rx_count"
4549+ <*> o .: "server_open"
4447instance FromJSON NodeFSStats where
4551instance FromJSON NodeFSStats where
4448− parseJSON _ = pure NodeFSStats
4552+ parseJSON = withObject "NodeFSStats" parse
4554+ parse o = NodeFSStats <$> o .: "data"
4556+ <*> (posixMS <$> o .: "timestamp")
4558+instance FromJSON NodeDataPathStats where
4559+ parseJSON = withObject "NodeDataPathStats" parse
4561+ parse o = NodeDataPathStats <$> (parseJSON . unStringlyTypeJSON =<< o .: "disk_service_time")
4562+ <*> (parseJSON . unStringlyTypeJSON =<< o .: "disk_queue")
4563+ <*> o .: "disk_io_size_in_bytes"
4564+ <*> o .: "disk_write_size_in_bytes"
4565+ <*> o .: "disk_read_size_in_bytes"
4566+ <*> o .: "disk_io_op"
4567+ <*> o .: "disk_writes"
4568+ <*> o .: "disk_reads"
4569+ <*> o .: "available_in_bytes"
4570+ <*> o .: "free_in_bytes"
4571+ <*> o .: "total_in_bytes"
4577+instance FromJSON NodeFSTotalStats where
4578+ parseJSON = withObject "NodeFSTotalStats" parse
4580+ parse o = NodeFSTotalStats <$> (parseJSON . unStringlyTypeJSON =<< o .: "disk_service_time")
4581+ <*> (parseJSON . unStringlyTypeJSON =<< o .: "disk_queue")
4582+ <*> o .: "disk_io_size_in_bytes"
4583+ <*> o .: "disk_write_size_in_bytes"
4584+ <*> o .: "disk_read_size_in_bytes"
4585+ <*> o .: "disk_io_op"
4586+ <*> o .: "disk_writes"
4587+ <*> o .: "disk_reads"
4588+ <*> o .: "available_in_bytes"
4589+ <*> o .: "free_in_bytes"
4590+ <*> o .: "total_in_bytes"
4450instance FromJSON NodeNetworkStats where
4592instance FromJSON NodeNetworkStats where
4593+ parseJSON = withObject "NodeNetworkStats" parse
4451− parseJSON _ = pure NodeNetworkStats
4597+ NodeNetworkStats <$> tcp .: "out_rsts"
4598+ <*> tcp .: "in_errs"
4599+ <*> tcp .: "attempt_fails"
4600+ <*> tcp .: "estab_resets"
4601+ <*> tcp .: "retrans_segs"
4602+ <*> tcp .: "out_segs"
4603+ <*> tcp .: "in_segs"
4604+ <*> tcp .: "curr_estab"
4605+ <*> tcp .: "passive_opens"
4606+ <*> tcp .: "active_opens"
4453instance FromJSON NodeThreadPoolsStats where
4608instance FromJSON NodeThreadPoolsStats where
4454− parseJSON _ = pure NodeThreadPoolsStats
4609+ parseJSON = withObject "NodeThreadPoolsStats" parse
4611+ parse o = NodeThreadPoolsStats <$> o .: "snapshot"
4615+ <*> o .: "management"
4616+ <*> o .: "fetch_shard_store"
4617+ <*> o .: "optimize"
4625+ <*> o .: "listener"
4626+ <*> o .: "fetch_shard_started"
4627+ <*> o .: "percolate"
4628+instance FromJSON NodeThreadPoolStats where
4629+ parseJSON = withObject "NodeThreadPoolStats" parse
4631+ parse o = NodeThreadPoolStats <$> o .: "completed"
4633+ <*> o .: "rejected"
4456instance FromJSON NodeJVMStats where
4638instance FromJSON NodeJVMStats where
4457 parseJSON _ = pure NodeJVMStats
4639 parseJSON _ = pure NodeJVMStats
@@ -4465,14 +4647,18 @@ instance FromJSON NodeOSStats where
4465instance FromJSON NodeIndicesStats where
4647instance FromJSON NodeIndicesStats where
4466 parseJSON _ = pure NodeIndicesStats
4648 parseJSON _ = pure NodeIndicesStats
4650+instance FromJSON NodeBreakersStats where
4651+ parseJSON = withObject "NodeBreakersStats" parse
4653+ parse o = NodeBreakersStats <$> o .: "parent"
4655+ <*> o .: "fielddata"
4468parseNodeStats :: FullNodeId -> Object -> Parser NodeStats
4657parseNodeStats :: FullNodeId -> Object -> Parser NodeStats
4469parseNodeStats fnid o = do
4658parseNodeStats fnid o = do
4470− breakers <- o .: "breakers"
4471 NodeStats <$> o .: "name"
4659 NodeStats <$> o .: "name"
4472 <*> pure fnid
4660 <*> pure fnid
4473− <*> breakers .: "parent"
4474− <*> breakers .: "request"
4475− <*> breakers .: "fielddata"
4661+ <*> o .: "breakers"
4476 <*> o .: "http"
4662 <*> o .: "http"
4477 <*> o .: "transport"
4663 <*> o .: "transport"
4478 <*> o .: "fs"
4664 <*> o .: "fs"