Skip to content
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

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

Open
Xtansia opened this issue Dec 22, 2024 · 0 comments
Open
Labels
bug Something isn't working Other untriaged

Comments

@Xtansia
Copy link
Contributor

Xtansia commented Dec 22, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Other untriaged
Projects
None yet
Development

No branches or pull requests

1 participant