Skip to content
28 changes: 27 additions & 1 deletion specification/_types/Stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,35 @@ export class DocStats {
* Elasticsearch reclaims the disk space of deleted Lucene documents when a segment is merged.
*/
deleted?: long
/**
* Returns the total size in bytes of all documents in this stats.
* This value may be more reliable than store_stats.size_in_bytes in estimating the index size.
*/
total_size_in_bytes?: long
/**
* Human readable total_size_in_bytes
*/
total_size?: ByteSize
}

export class FielddataStats {
evictions?: long
memory_size?: ByteSize
memory_size_in_bytes: long
fields?: Dictionary<Field, FieldMemoryUsage>
global_ordinals: GlobalOrdinalsStats
}

export class GlobalOrdinalsStats {
build_time_in_millis?: UnitMillis
build_time?: string
fields?: Dictionary<Name, GlobalOrdinalFieldStats>
}

export class GlobalOrdinalFieldStats {
build_time_in_millis?: UnitMillis
build_time?: string
shard_max_value_count: long
}

export class FieldMemoryUsage {
Expand Down Expand Up @@ -344,6 +366,10 @@ export class SegmentsStats {
* Total amount, in bytes, of memory used for stored fields across all shards assigned to selected nodes.
*/
stored_fields_memory_in_bytes: long
/**
* Total amount of memory used for stored fields across all shards assigned to selected nodes.
*/
stored_fields_memory?: ByteSize
/**
* Total amount, in bytes, of memory used for terms across all shards assigned to selected nodes.
*/
Expand All @@ -355,7 +381,7 @@ export class SegmentsStats {
/**
* Total amount of memory used for term vectors across all shards assigned to selected nodes.
*/
term_vectory_memory?: ByteSize
term_vectors_memory?: ByteSize
/**
* Total amount, in bytes, of memory used for term vectors across all shards assigned to selected nodes.
*/
Expand Down
1 change: 1 addition & 0 deletions specification/_types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export type ExpandWildcards = ExpandWildcard | ExpandWildcard[]

/**
* Health status of the cluster, based on the state of its primary and replica shards.
* @non_exhaustive
*/
export enum HealthStatus {
// ES will send this enum as upper or lowercase depending on the APIs
Expand Down
16 changes: 15 additions & 1 deletion specification/cluster/stats/ClusterStatsResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@
import { HealthStatus, Name, Uuid } from '@_types/common'
import { long } from '@_types/Numeric'
import { NodesResponseBase } from '@nodes/_types/NodesResponseBase'
import { CCSStats, ClusterIndices, ClusterNodes } from './types'
import { Dictionary } from '@spec_utils/Dictionary'
import {
CCSStats,
ClusterIndices,
ClusterNodes,
ClusterSnapshotStats
} from './types'

export class StatsResponseBase extends NodesResponseBase {
/**
Expand All @@ -40,6 +46,14 @@ export class StatsResponseBase extends NodesResponseBase {
* @doc_id cluster-nodes
*/
nodes: ClusterNodes
/**
* Contains stats on repository feature usage exposed in cluster stats for telemetry.
*/
repositories: Dictionary<Name, Dictionary<Name, long>>
/**
* Contains stats cluster snapshots.
*/
snapshots: ClusterSnapshotStats
/**
* Health status of the cluster, based on the state of its primary and replica shards.
*/
Expand Down
Loading