Skip to content

Commit 840f524

Browse files
committed
fixing cluster stats response
1 parent 92f69aa commit 840f524

File tree

5 files changed

+261
-45
lines changed

5 files changed

+261
-45
lines changed

specification/_types/Stats.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,35 @@ export class DocStats {
109109
* Elasticsearch reclaims the disk space of deleted Lucene documents when a segment is merged.
110110
*/
111111
deleted?: long
112+
/**
113+
* Returns the total size in bytes of all documents in this stats.
114+
* This value may be more reliable than store_stats.size_in_bytes in estimating the index size.
115+
*/
116+
total_size_in_bytes?: long
117+
/**
118+
* Human readable total_size_in_bytes
119+
*/
120+
total_size?: ByteSize
112121
}
113122

114123
export class FielddataStats {
115124
evictions?: long
116125
memory_size?: ByteSize
117126
memory_size_in_bytes: long
118127
fields?: Dictionary<Field, FieldMemoryUsage>
128+
global_ordinals: GlobalOrdinalsStats
129+
}
130+
131+
export class GlobalOrdinalsStats {
132+
build_time_in_millis?: UnitMillis
133+
build_time?: string
134+
fields?: Dictionary<Name, GlobalOrdinalFieldStats>
135+
}
136+
137+
export class GlobalOrdinalFieldStats {
138+
build_time_in_millis?: UnitMillis
139+
build_time?: string
140+
shard_max_value_count: long
119141
}
120142

121143
export class FieldMemoryUsage {
@@ -344,6 +366,10 @@ export class SegmentsStats {
344366
* Total amount, in bytes, of memory used for stored fields across all shards assigned to selected nodes.
345367
*/
346368
stored_fields_memory_in_bytes: long
369+
/**
370+
* Total amount of memory used for stored fields across all shards assigned to selected nodes.
371+
*/
372+
stored_fields_memory?: ByteSize
347373
/**
348374
* Total amount, in bytes, of memory used for terms across all shards assigned to selected nodes.
349375
*/
@@ -355,7 +381,7 @@ export class SegmentsStats {
355381
/**
356382
* Total amount of memory used for term vectors across all shards assigned to selected nodes.
357383
*/
358-
term_vectory_memory?: ByteSize
384+
term_vectors_memory?: ByteSize
359385
/**
360386
* Total amount, in bytes, of memory used for term vectors across all shards assigned to selected nodes.
361387
*/

specification/_types/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ export type ExpandWildcards = ExpandWildcard | ExpandWildcard[]
215215

216216
/**
217217
* Health status of the cluster, based on the state of its primary and replica shards.
218+
* @non_exhaustive
218219
*/
219220
export enum HealthStatus {
220221
// ES will send this enum as upper or lowercase depending on the APIs

specification/cluster/stats/ClusterStatsResponse.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@
2020
import { HealthStatus, Name, Uuid } from '@_types/common'
2121
import { long } from '@_types/Numeric'
2222
import { NodesResponseBase } from '@nodes/_types/NodesResponseBase'
23-
import { CCSStats, ClusterIndices, ClusterNodes } from './types'
23+
import { Dictionary } from '@spec_utils/Dictionary'
24+
import {
25+
CCSStats,
26+
ClusterIndices,
27+
ClusterNodes,
28+
ClusterSnapshotStats
29+
} from './types'
2430

2531
export class StatsResponseBase extends NodesResponseBase {
2632
/**
@@ -40,6 +46,14 @@ export class StatsResponseBase extends NodesResponseBase {
4046
* @doc_id cluster-nodes
4147
*/
4248
nodes: ClusterNodes
49+
/**
50+
* Contains stats on repository feature usage exposed in cluster stats for telemetry.
51+
*/
52+
repositories: Dictionary<Name, Dictionary<Name, long>>
53+
/**
54+
* Contains stats cluster snapshots.
55+
*/
56+
snapshots: ClusterSnapshotStats
4357
/**
4458
* Health status of the cluster, based on the state of its primary and replica shards.
4559
*/

0 commit comments

Comments
 (0)