Skip to content
Draft
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
43 changes: 43 additions & 0 deletions specification/_types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export type ProjectRouting = string

export type Routing = string
export type LongId = string
//TODO encode metrics as API specific enums

export type ClusterAlias = string

Expand Down Expand Up @@ -253,6 +254,48 @@ export enum NodeStatsLevel {
shards
}

export enum Metrics {
adaptive_selection,
allocations,
breaker,
discovery,
fs,
http,
indexing_pressure,
indices,
ingest,
jvm,
os,
process,
repositories,
thread_pool,
transport
}
Comment on lines +257 to +273
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This enum is not used. But I already defined it as NodeStatsMetric in specification/nodes/stats/NodesStatsRequest.ts anyway, with a few values that were missing in the 8.x docs so far.


export enum IndexMetrics{
bulk,
completion,
docs,
fielddata,
flush,
get,
indexing,
mappings,
merge,
query_cache,
recovery,
refresh,
request_cache,
search,
segments,
shard_stats,
store,
translog,
warmer,
dense_vector,
sparse_vector
}

export enum OpType {
/**
* Overwrite any documents that already exist.
Expand Down
3 changes: 2 additions & 1 deletion specification/nodes/stats/NodesStatsRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import { RequestBase } from '@_types/Base'
import {Fields, IndexMetrics, Metrics, NodeIds, NodeStatsLevel} from '@_types/common'
import {
CommonStatsFlags,
Fields,
Expand Down Expand Up @@ -70,7 +71,7 @@ export interface Request extends RequestBase {
/*+ Limits the information returned to the specific metrics. */
metric?: NodeStatsMetrics
/** Limit the information returned for indices metric to the specific index metrics. It can be used only if indices (or all) metric is specified.*/
index_metric?: CommonStatsFlags
index_metric?: IndexMetrics
Comment on lines -73 to +74
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CommonStatsFlag is the name of the enum in the server code, so that was already correct. (Your version is also missing _all that is accepted by the server too.)

}
query_parameters: {
/** Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics. */
Expand Down
Loading