git.iko.soy/typeable/bloodhound
on master help sign in
More optional fields
8ccc4fcMichael Xavier
src/Database/Bloodhound/Types.hs+40−37
@@ -1739,7 +1739,7 @@ data TermsAggregation = TermsAggregation { term :: Either Text Text
1739 , termAggs :: Maybe Aggregations
1739 , termAggs :: Maybe Aggregations
1740 } deriving (Eq, Read, Show, Generic, Typeable)
1740 } deriving (Eq, Read, Show, Generic, Typeable)
1741
1741
1742−data CardinalityAggregation = CardinalityAggregation { cardinalityField :: FieldName,
1742+data CardinalityAggregation = CardinalityAggregation { cardinalityField :: FieldName,
1743 precisionThreshold :: Maybe Int
1743 precisionThreshold :: Maybe Int
1744 } deriving (Eq, Read, Show, Generic, Typeable)
1744 } deriving (Eq, Read, Show, Generic, Typeable)
1745
1745
@@ -3882,7 +3882,7 @@ data NodesStats = NodesStats {
3882data NodeStats = NodeStats {
3882data NodeStats = NodeStats {
3883 nodeStatsName :: NodeName
3883 nodeStatsName :: NodeName
3884 , nodeStatsFullId :: FullNodeId
3884 , nodeStatsFullId :: FullNodeId
3885− , nodeStatsBreakersStats :: NodeBreakersStats
3885+ , nodeStatsBreakersStats :: Maybe NodeBreakersStats
3886 , nodeStatsHTTP :: NodeHTTPStats
3886 , nodeStatsHTTP :: NodeHTTPStats
3887 , nodeStatsTransport :: NodeTransportStats
3887 , nodeStatsTransport :: NodeTransportStats
3888 , nodeStatsFS :: NodeFSStats
3888 , nodeStatsFS :: NodeFSStats
@@ -3938,7 +3938,7 @@ data NodeDataPathStats = NodeDataPathStats {
3938 , nodeDataPathAvailable :: Bytes
3938 , nodeDataPathAvailable :: Bytes
3939 , nodeDataPathFree :: Bytes
3939 , nodeDataPathFree :: Bytes
3940 , nodeDataPathTotal :: Bytes
3940 , nodeDataPathTotal :: Bytes
3941− , nodeDataPathType :: Text
3941+ , nodeDataPathType :: Maybe Text
3942 , nodeDataPathDevice :: Text
3942 , nodeDataPathDevice :: Text
3943 , nodeDataPathMount :: Text
3943 , nodeDataPathMount :: Text
3944 , nodeDataPathPath :: Text
3944 , nodeDataPathPath :: Text
@@ -3977,7 +3977,7 @@ data NodeThreadPoolsStats = NodeThreadPoolsStats {
3977 , nodeThreadPoolsStatsMerge :: NodeThreadPoolStats
3977 , nodeThreadPoolsStatsMerge :: NodeThreadPoolStats
3978 , nodeThreadPoolsStatsGet :: NodeThreadPoolStats
3978 , nodeThreadPoolsStatsGet :: NodeThreadPoolStats
3979 , nodeThreadPoolsStatsManagement :: NodeThreadPoolStats
3979 , nodeThreadPoolsStatsManagement :: NodeThreadPoolStats
3980− , nodeThreadPoolsStatsFetchShardStore :: NodeThreadPoolStats
3980+ , nodeThreadPoolsStatsFetchShardStore :: Maybe NodeThreadPoolStats
3981 , nodeThreadPoolsStatsOptimize :: NodeThreadPoolStats
3981 , nodeThreadPoolsStatsOptimize :: NodeThreadPoolStats
3982 , nodeThreadPoolsStatsFlush :: NodeThreadPoolStats
3982 , nodeThreadPoolsStatsFlush :: NodeThreadPoolStats
3983 , nodeThreadPoolsStatsSearch :: NodeThreadPoolStats
3983 , nodeThreadPoolsStatsSearch :: NodeThreadPoolStats
@@ -3986,8 +3986,8 @@ data NodeThreadPoolsStats = NodeThreadPoolsStats {
3986 , nodeThreadPoolsStatsSuggest :: NodeThreadPoolStats
3986 , nodeThreadPoolsStatsSuggest :: NodeThreadPoolStats
3987 , nodeThreadPoolsStatsRefresh :: NodeThreadPoolStats
3987 , nodeThreadPoolsStatsRefresh :: NodeThreadPoolStats
3988 , nodeThreadPoolsStatsIndex :: NodeThreadPoolStats
3988 , nodeThreadPoolsStatsIndex :: NodeThreadPoolStats
3989− , nodeThreadPoolsStatsListener :: NodeThreadPoolStats
3989+ , nodeThreadPoolsStatsListener :: Maybe NodeThreadPoolStats
3990− , nodeThreadPoolsStatsFetchShardStarted :: NodeThreadPoolStats
3990+ , nodeThreadPoolsStatsFetchShardStarted :: Maybe NodeThreadPoolStats
3991 , nodeThreadPoolsStatsPercolate :: NodeThreadPoolStats
3991 , nodeThreadPoolsStatsPercolate :: NodeThreadPoolStats
3992 } deriving (Eq, Show, Generic, Typeable)
3992 } deriving (Eq, Show, Generic, Typeable)
3993
3993
@@ -4076,21 +4076,21 @@ data LoadAvgs = LoadAvgs {
4076 } deriving (Eq, Show, Generic, Typeable)
4076 } deriving (Eq, Show, Generic, Typeable)
4077
4077
4078data NodeIndicesStats = NodeIndicesStats {
4078data NodeIndicesStats = NodeIndicesStats {
4079− nodeIndicesStatsRecoveryThrottleTime :: NominalDiffTime
4079+ nodeIndicesStatsRecoveryThrottleTime :: Maybe NominalDiffTime
4080− , nodeIndicesStatsRecoveryCurrentAsTarget :: Int
4080+ , nodeIndicesStatsRecoveryCurrentAsTarget :: Maybe Int
4081− , nodeIndicesStatsRecoveryCurrentAsSource :: Int
4081+ , nodeIndicesStatsRecoveryCurrentAsSource :: Maybe Int
4082− , nodeIndicesStatsQueryCacheMisses :: Int
4082+ , nodeIndicesStatsQueryCacheMisses :: Maybe Int
4083− , nodeIndicesStatsQueryCacheHits :: Int
4083+ , nodeIndicesStatsQueryCacheHits :: Maybe Int
4084− , nodeIndicesStatsQueryCacheEvictions :: Int
4084+ , nodeIndicesStatsQueryCacheEvictions :: Maybe Int
4085− , nodeIndicesStatsQueryCacheSize :: Bytes
4085+ , nodeIndicesStatsQueryCacheSize :: Maybe Bytes
4086 , nodeIndicesStatsSuggestCurrent :: Int
4086 , nodeIndicesStatsSuggestCurrent :: Int
4087 , nodeIndicesStatsSuggestTime :: NominalDiffTime
4087 , nodeIndicesStatsSuggestTime :: NominalDiffTime
4088 , nodeIndicesStatsSuggestTotal :: Int
4088 , nodeIndicesStatsSuggestTotal :: Int
4089 , nodeIndicesStatsTranslogSize :: Bytes
4089 , nodeIndicesStatsTranslogSize :: Bytes
4090 , nodeIndicesStatsTranslogOps :: Int
4090 , nodeIndicesStatsTranslogOps :: Int
4091− , nodeIndicesStatsSegFixedBitSetMemory :: Bytes
4091+ , nodeIndicesStatsSegFixedBitSetMemory :: Maybe Bytes
4092 , nodeIndicesStatsSegVersionMapMemory :: Bytes
4092 , nodeIndicesStatsSegVersionMapMemory :: Bytes
4093− , nodeIndicesStatsSegIndexWriterMaxMemory :: Bytes
4093+ , nodeIndicesStatsSegIndexWriterMaxMemory :: Maybe Bytes
4094 , nodeIndicesStatsSegIndexWriterMemory :: Bytes
4094 , nodeIndicesStatsSegIndexWriterMemory :: Bytes
4095 , nodeIndicesStatsSegMemory :: Bytes
4095 , nodeIndicesStatsSegMemory :: Bytes
4096 , nodeIndicesStatsSegCount :: Int
4096 , nodeIndicesStatsSegCount :: Int
@@ -4133,9 +4133,9 @@ data NodeIndicesStats = NodeIndicesStats {
4133 , nodeIndicesStatsGetExistsTotal :: Int
4133 , nodeIndicesStatsGetExistsTotal :: Int
4134 , nodeIndicesStatsGetTime :: NominalDiffTime
4134 , nodeIndicesStatsGetTime :: NominalDiffTime
4135 , nodeIndicesStatsGetTotal :: Int
4135 , nodeIndicesStatsGetTotal :: Int
4136− , nodeIndicesStatsIndexingThrottleTime :: NominalDiffTime
4136+ , nodeIndicesStatsIndexingThrottleTime :: Maybe NominalDiffTime
4137− , nodeIndicesStatsIndexingIsThrottled :: Bool
4137+ , nodeIndicesStatsIndexingIsThrottled :: Maybe Bool
4138− , nodeIndicesStatsIndexingNoopUpdateTotal :: Int
4138+ , nodeIndicesStatsIndexingNoopUpdateTotal :: Maybe Int
4139 , nodeIndicesStatsIndexingDeleteCurrent :: Int
4139 , nodeIndicesStatsIndexingDeleteCurrent :: Int
4140 , nodeIndicesStatsIndexingDeleteTime :: NominalDiffTime
4140 , nodeIndicesStatsIndexingDeleteTime :: NominalDiffTime
4141 , nodeIndicesStatsIndexingDeleteTotal :: Int
4141 , nodeIndicesStatsIndexingDeleteTotal :: Int
@@ -4723,7 +4723,7 @@ instance FromJSON NodeDataPathStats where
4723 <*> o .: "available_in_bytes"
4723 <*> o .: "available_in_bytes"
4724 <*> o .: "free_in_bytes"
4724 <*> o .: "free_in_bytes"
4725 <*> o .: "total_in_bytes"
4725 <*> o .: "total_in_bytes"
4726− <*> o .: "type"
4726+ <*> o .:? "type"
4727 <*> o .: "dev"
4727 <*> o .: "dev"
4728 <*> o .: "mount"
4728 <*> o .: "mount"
4729 <*> o .: "path"
4729 <*> o .: "path"
@@ -4774,7 +4774,7 @@ instance FromJSON NodeThreadPoolsStats where
4774 <*> o .: "merge"
4774 <*> o .: "merge"
4775 <*> o .: "get"
4775 <*> o .: "get"
4776 <*> o .: "management"
4776 <*> o .: "management"
4777− <*> o .: "fetch_shard_store"
4777+ <*> o .:? "fetch_shard_store"
4778 <*> o .: "optimize"
4778 <*> o .: "optimize"
4779 <*> o .: "flush"
4779 <*> o .: "flush"
4780 <*> o .: "search"
4780 <*> o .: "search"
@@ -4783,8 +4783,8 @@ instance FromJSON NodeThreadPoolsStats where
4783 <*> o .: "suggest"
4783 <*> o .: "suggest"
4784 <*> o .: "refresh"
4784 <*> o .: "refresh"
4785 <*> o .: "index"
4785 <*> o .: "index"
4786− <*> o .: "listener"
4786+ <*> o .:? "listener"
4787− <*> o .: "fetch_shard_started"
4787+ <*> o .:? "fetch_shard_started"
4788 <*> o .: "percolate"
4788 <*> o .: "percolate"
4789instance FromJSON NodeThreadPoolStats where
4789instance FromJSON NodeThreadPoolStats where
4790 parseJSON = withObject "NodeThreadPoolStats" parse
4790 parseJSON = withObject "NodeThreadPoolStats" parse
@@ -4906,8 +4906,11 @@ instance FromJSON NodeIndicesStats where
4906 parseJSON = withObject "NodeIndicesStats" parse
4906 parseJSON = withObject "NodeIndicesStats" parse
4907 where
4907 where
4908 parse o = do
4908 parse o = do
4909+ let (.::) mv k = case mv of
4910+ Just v -> Just <$> v .: k
4911+ Nothing -> pure Nothing
4909− recovery <- o .: "recovery"
4912+ mRecovery <- o .:? "recovery"
4910− queryCache <- o .: "query_cache"
4913+ mQueryCache <- o .:? "query_cache"
4911 suggest <- o .: "suggest"
4914 suggest <- o .: "suggest"
4912 translog <- o .: "translog"
4915 translog <- o .: "translog"
4913 segments <- o .: "segments"
4916 segments <- o .: "segments"
@@ -4925,21 +4928,21 @@ instance FromJSON NodeIndicesStats where
4925 indexing <- o .: "indexing"
4928 indexing <- o .: "indexing"
4926 store <- o .: "store"
4929 store <- o .: "store"
4927 docs <- o .: "docs"
4930 docs <- o .: "docs"
4928− NodeIndicesStats <$> (unMS <$> recovery .: "throttle_time_in_millis")
4931+ NodeIndicesStats <$> (fmap unMS <$> mRecovery .:: "throttle_time_in_millis")
4929− <*> recovery .: "current_as_target"
4932+ <*> mRecovery .:: "current_as_target"
4930− <*> recovery .: "current_as_source"
4933+ <*> mRecovery .:: "current_as_source"
4931− <*> queryCache .: "miss_count"
4934+ <*> mQueryCache .:: "miss_count"
4932− <*> queryCache .: "hit_count"
4935+ <*> mQueryCache .:: "hit_count"
4933− <*> queryCache .: "evictions"
4936+ <*> mQueryCache .:: "evictions"
4934− <*> queryCache .: "memory_size_in_bytes"
4937+ <*> mQueryCache .:: "memory_size_in_bytes"
4935 <*> suggest .: "current"
4938 <*> suggest .: "current"
4936 <*> (unMS <$> suggest .: "time_in_millis")
4939 <*> (unMS <$> suggest .: "time_in_millis")
4937 <*> suggest .: "total"
4940 <*> suggest .: "total"
4938 <*> translog .: "size_in_bytes"
4941 <*> translog .: "size_in_bytes"
4939 <*> translog .: "operations"
4942 <*> translog .: "operations"
4940− <*> segments .: "fixed_bit_set_memory_in_bytes"
4943+ <*> segments .:? "fixed_bit_set_memory_in_bytes"
4941 <*> segments .: "version_map_memory_in_bytes"
4944 <*> segments .: "version_map_memory_in_bytes"
4942− <*> segments .: "index_writer_max_memory_in_bytes"
4945+ <*> segments .:? "index_writer_max_memory_in_bytes"
4943 <*> segments .: "index_writer_memory_in_bytes"
4946 <*> segments .: "index_writer_memory_in_bytes"
4944 <*> segments .: "memory_in_bytes"
4947 <*> segments .: "memory_in_bytes"
4945 <*> segments .: "count"
4948 <*> segments .: "count"
@@ -4982,9 +4985,9 @@ instance FromJSON NodeIndicesStats where
4982 <*> getStats .: "exists_total"
4985 <*> getStats .: "exists_total"
4983 <*> (unMS <$> getStats .: "time_in_millis")
4986 <*> (unMS <$> getStats .: "time_in_millis")
4984 <*> getStats .: "total"
4987 <*> getStats .: "total"
4985− <*> (unMS <$> indexing .: "throttle_time_in_millis")
4988+ <*> (fmap unMS <$> indexing .:? "throttle_time_in_millis")
4986− <*> indexing .: "is_throttled"
4989+ <*> indexing .:? "is_throttled"
4987− <*> indexing .: "noop_update_total"
4990+ <*> indexing .:? "noop_update_total"
4988 <*> indexing .: "delete_current"
4991 <*> indexing .: "delete_current"
4989 <*> (unMS <$> indexing .: "delete_time_in_millis")
4992 <*> (unMS <$> indexing .: "delete_time_in_millis")
4990 <*> indexing .: "delete_total"
4993 <*> indexing .: "delete_total"
@@ -5007,7 +5010,7 @@ parseNodeStats :: FullNodeId -> Object -> Parser NodeStats
5007parseNodeStats fnid o = do
5010parseNodeStats fnid o = do
5008 NodeStats <$> o .: "name"
5011 NodeStats <$> o .: "name"
5009 <*> pure fnid
5012 <*> pure fnid
5010− <*> o .: "breakers"
5013+ <*> o .:? "breakers"
5011 <*> o .: "http"
5014 <*> o .: "http"
5012 <*> o .: "transport"
5015 <*> o .: "transport"
5013 <*> o .: "fs"
5016 <*> o .: "fs"