From ce74e928e9df6c9b73cee5a6ca90180c680718c7 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Tue, 3 Sep 2024 11:12:05 +0400 Subject: [PATCH] Add hits_time_in_millis and misses_time_in_millis to enrich stats (#2845) * Add hits_time_in_millis and misses_time_in_millis to enrich stats * Switch to DurationValue --- output/openapi/elasticsearch-openapi.json | 8 ++++ .../elasticsearch-serverless-openapi.json | 8 ++++ output/schema/schema-serverless.json | 46 +++++++++++++++++-- output/schema/schema.json | 46 +++++++++++++++++-- output/typescript/types.ts | 2 + specification/enrich/stats/types.ts | 5 ++ 6 files changed, 109 insertions(+), 6 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 7b448bf5c6..d3a71670a5 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -81451,9 +81451,15 @@ "hits": { "type": "number" }, + "hits_time_in_millis": { + "$ref": "#/components/schemas/_types:DurationValueUnitMillis" + }, "misses": { "type": "number" }, + "misses_time_in_millis": { + "$ref": "#/components/schemas/_types:DurationValueUnitMillis" + }, "evictions": { "type": "number" }, @@ -81465,7 +81471,9 @@ "node_id", "count", "hits", + "hits_time_in_millis", "misses", + "misses_time_in_millis", "evictions", "size_in_bytes" ] diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 37a3ae10a9..05778fd803 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -53361,9 +53361,15 @@ "hits": { "type": "number" }, + "hits_time_in_millis": { + "$ref": "#/components/schemas/_types:DurationValueUnitMillis" + }, "misses": { "type": "number" }, + "misses_time_in_millis": { + "$ref": "#/components/schemas/_types:DurationValueUnitMillis" + }, "evictions": { "type": "number" }, @@ -53375,7 +53381,9 @@ "node_id", "count", "hits", + "hits_time_in_millis", "misses", + "misses_time_in_millis", "evictions", "size_in_bytes" ] diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index b9bd7415c4..daf3603269 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -115090,7 +115090,7 @@ } } ], - "specLocation": "enrich/stats/types.ts#L29-L35" + "specLocation": "enrich/stats/types.ts#L30-L36" }, { "kind": "interface", @@ -115122,7 +115122,7 @@ } } ], - "specLocation": "enrich/stats/types.ts#L24-L27" + "specLocation": "enrich/stats/types.ts#L25-L28" }, { "kind": "interface", @@ -115164,6 +115164,26 @@ } } }, + { + "name": "hits_time_in_millis", + "required": true, + "type": { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "UnitMillis", + "namespace": "_types" + } + } + ], + "kind": "instance_of", + "type": { + "name": "DurationValue", + "namespace": "_types" + } + } + }, { "name": "misses", "required": true, @@ -115175,6 +115195,26 @@ } } }, + { + "name": "misses_time_in_millis", + "required": true, + "type": { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "UnitMillis", + "namespace": "_types" + } + } + ], + "kind": "instance_of", + "type": { + "name": "DurationValue", + "namespace": "_types" + } + } + }, { "name": "evictions", "required": true, @@ -115198,7 +115238,7 @@ } } ], - "specLocation": "enrich/stats/types.ts#L37-L45" + "specLocation": "enrich/stats/types.ts#L38-L50" }, { "generics": [ diff --git a/output/schema/schema.json b/output/schema/schema.json index 67ff922d03..29a8f7eb32 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -114140,6 +114140,26 @@ } } }, + { + "name": "hits_time_in_millis", + "required": true, + "type": { + "kind": "instance_of", + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "UnitMillis", + "namespace": "_types" + } + } + ], + "type": { + "name": "DurationValue", + "namespace": "_types" + } + } + }, { "name": "misses", "required": true, @@ -114151,6 +114171,26 @@ } } }, + { + "name": "misses_time_in_millis", + "required": true, + "type": { + "kind": "instance_of", + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "UnitMillis", + "namespace": "_types" + } + } + ], + "type": { + "name": "DurationValue", + "namespace": "_types" + } + } + }, { "name": "evictions", "required": true, @@ -114174,7 +114214,7 @@ } } ], - "specLocation": "enrich/stats/types.ts#L37-L45" + "specLocation": "enrich/stats/types.ts#L38-L50" }, { "kind": "interface", @@ -114239,7 +114279,7 @@ } } ], - "specLocation": "enrich/stats/types.ts#L29-L35" + "specLocation": "enrich/stats/types.ts#L30-L36" }, { "kind": "interface", @@ -114271,7 +114311,7 @@ } } ], - "specLocation": "enrich/stats/types.ts#L24-L27" + "specLocation": "enrich/stats/types.ts#L25-L28" }, { "kind": "request", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 6796b49cf4..b52975d188 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -10064,7 +10064,9 @@ export interface EnrichStatsCacheStats { node_id: Id count: integer hits: integer + hits_time_in_millis: DurationValue misses: integer + misses_time_in_millis: DurationValue evictions: integer size_in_bytes: long } diff --git a/specification/enrich/stats/types.ts b/specification/enrich/stats/types.ts index cdd7eb836b..fc4a96d424 100644 --- a/specification/enrich/stats/types.ts +++ b/specification/enrich/stats/types.ts @@ -20,6 +20,7 @@ import { TaskInfo } from '@tasks/_types/TaskInfo' import { Id, Name } from '@_types/common' import { integer, long } from '@_types/Numeric' +import { DurationValue, UnitMillis } from '@_types/Time' export class ExecutingPolicy { name: Name @@ -38,7 +39,11 @@ export class CacheStats { node_id: Id count: integer hits: integer + /* The amount of time in milliseconds spent fetching data from the cache on successful cache hits only. */ + hits_time_in_millis: DurationValue misses: integer + /* The amount of time in milliseconds spent fetching data from the enrich index and updating the cache, on cache misses only. */ + misses_time_in_millis: DurationValue evictions: integer /* An _approximation_ of the size in bytes that the enrich cache takes up on the heap. */ size_in_bytes: long