Skip to content

[BUG] GetStats class serializes the time field as getTime in XContent/JSON #16894

Closed
@Xtansia

Description

@Xtansia

Describe the bug

The GetStats class serializes what should be the time field as getTime instead.

This issue was introduced in a refactoring from nearly twelve years ago (ie. very pre-fork) where a find & replace appears to have gone awry: cc83c2f#diff-f7abcc8f5eb3ec75bb9be11b7fe88baa0bcedf62c3c481552a0e98ceb7125a27R124

This means that when getting stats for an index, the "human" variant of time_in_millis becomes getTime rather than just time as expected.

Related component

Other

To Reproduce

  1. Create an empty index: PUT /movies
  2. Get stats for the index enabling the "human" fields: GET /movies/_stats?human&filter_path=_all.primaries.get
  3. See response:
{
  "_all": {
    "primaries": {
      "get": {
        "total": 0,
        "getTime": "0s",
        "time_in_millis": 0,
        "exists_total": 0,
        "exists_time": "0s",
        "exists_time_in_millis": 0,
        "missing_total": 0,
        "missing_time": "0s",
        "missing_time_in_millis": 0,
        "current": 0
      }
    }
  }
}

Expected behavior

The getTime field should be named simply time to align with all other "human" _in_millis pairings.

Additional Details

Screenshots
Screenshot 2024-12-23 at 12 52 18 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    OtherbugSomething isn't workinggood first issueGood for newcomersv2.19.0Issues and PRs related to version 2.19.0v3.0.0Issues and PRs related to version 3.0.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions