-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Fix getTime field name to time in GetStats (#16894) * Update PR number in changelog * Deprecate getTime field and add time field in GetStats for backward compatibility * Add forRemoval flag to getTime field for future removal * Changed to use field instead of humanReadableField for GET_TIME in JSON response Replaced the use of builder.humanReadableField for the GET_TIME field with builder.field(Fields.GET_TIME, Objects.toString(getTime())). This prevents the duplication of the time_in_millis field. * Add test to validate getTime and time fields in _stats API response getTime and time fields are verified to be included in the _stats API response and correctly aligned. * Fix formatting in GetStats.java * Rename test file to better reflect test purpose * Test Add skip version for stats API human filter test under 2.19.99 * Remove unnecessary changelog entries * Add a line for styling purposes --------- (cherry picked from commit fe1f0d8) Signed-off-by: hye-on <ain0103@naver.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
fe02847
commit d632268
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
.../resources/rest-api-spec/test/indices.stats/60_include_both_time_and_gettime_in_stats.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
setup: | ||
- do: | ||
indices.create: | ||
index: test1 | ||
body: | ||
settings: | ||
number_of_shards: 1 | ||
number_of_replicas: 0 | ||
wait_for_active_shards: all | ||
|
||
- do: | ||
index: | ||
index: test1 | ||
id: 1 | ||
body: { "foo": "bar" } | ||
|
||
- do: | ||
indices.refresh: | ||
index: test1 | ||
|
||
--- | ||
"Test _stats API includes both time and getTime metrics with human filter": | ||
- skip: | ||
version: " - 2.19.99" | ||
reason: "this change is added in 3.0.0" | ||
|
||
- do: | ||
indices.stats: | ||
metric: [ get ] | ||
human: true | ||
|
||
- is_true: _all.primaries.get.time | ||
- is_true: _all.primaries.get.getTime | ||
- match: { _all.primaries.get.time: "0s" } | ||
- match: { _all.primaries.get.getTime: "0s" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters