Skip to content

Fixing cluster stats response #4632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion specification/_global/health_report/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export enum IndicatorHealthStatus {
green,
yellow,
red,
unknown
unknown,
unavailable
}

export class Indicators {
Expand Down
30 changes: 27 additions & 3 deletions 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 @@ -306,7 +328,6 @@ export class SegmentsStats {
* Total amount of memory used by all index writers across all shards assigned to selected nodes.
*/
index_writer_memory?: ByteSize
index_writer_max_memory_in_bytes?: long
/**
* Total amount, in bytes, of memory used by all index writers across all shards assigned to selected nodes.
*/
Expand Down Expand Up @@ -339,11 +360,14 @@ export class SegmentsStats {
* Total amount, in bytes, of memory used for points across all shards assigned to selected nodes.
*/
points_memory_in_bytes: long
stored_memory?: ByteSize
/**
* 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 +379,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
5 changes: 4 additions & 1 deletion 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 All @@ -232,7 +233,9 @@ export enum HealthStatus {
* One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.
* @aliases RED
*/
red
red,
unknown,
unavailable
}

export enum HttpMethod {
Expand Down
18 changes: 16 additions & 2 deletions 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,10 +46,18 @@ 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.
*/
status: HealthStatus
status?: HealthStatus
/**
* Unix timestamp, in milliseconds, for the last time the cluster statistics were refreshed.
*/
Expand Down
Loading