Skip to content

Fix CPU gauge to just use normalized CPU percentages #1458

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

Merged

Conversation

fearful-symmetry
Copy link
Contributor

What does this PR do?

This alters the CPU Usage Gauge to just use normalized values for visualizations, and removes the painless script, which was (incorrectly) dividing the normalized value by the CPU count.

I'd actually like some feedback on this, since I can't figure out why the visualization hasn't always been like this. We've been doing some math cleverness to take the "regular" CPU value and divide it by the CPU count, when this is basically what the norm.cpu values do to begin with. I've tested this change and it works fine, but I'm a tad paranoid and I wonder if there's a reason why we haven't been doing this before.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.

How to test this PR locally

Pull down, build. Find the CPU Usage gauge In the System Integration Host Details dashboard. Make sure the gauge is populated and the value is correct.

@fearful-symmetry fearful-symmetry added the bug Something isn't working, use only for issues label Aug 9, 2021
@fearful-symmetry fearful-symmetry requested a review from a team August 9, 2021 04:26
@fearful-symmetry fearful-symmetry self-assigned this Aug 9, 2021
@elasticmachine
Copy link

elasticmachine commented Aug 9, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-08-10T16:51:16.142+0000

  • Duration: 14 min 30 sec

  • Commit: 2626767

Test stats 🧪

Test Results
Failed 0
Passed 266
Skipped 0
Total 266

Trends 🧪

Image of Build Times

Image of Tests

- version: "1.1.4"
changes:
- description: Fix issue with normalized CPU gauge
type: enhancement
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is more like a "bugfix" than "enhancement".

@exekias
Copy link

exekias commented Aug 9, 2021

I'd actually like some feedback on this, since I can't figure out why the visualization hasn't always been like this. We've been doing some math cleverness to take the "regular" CPU value and divide it by the CPU count, when this is basically what the norm.cpu values do to begin with. I've tested this change and it works fine, but I'm a tad paranoid and I wonder if there's a reason why we haven't been doing this before.

@jsoriano do you happen to remember this? I don't 🤔 , I guess this is because normalized values were added after the initial dashboards were created

Copy link

@exekias exekias left a comment

Choose a reason for hiding this comment

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

Change LGTM, besides comment on change type in the changelog

@andrewkroh
Copy link
Member

I guess this is because normalized values were added after the initial dashboards were created

Or maybe that normalized_percentages are disabled by default. But here we have control of the cpu.metrics setting.

@fearful-symmetry
Copy link
Contributor Author

Or maybe that normalized_percentages are disabled by default. But here we have control of the cpu.metrics setting.

So, @andrewkroh , everything is enabled by default save for ticks, which makes it even weirder.

I guess this is because normalized values were added after the initial dashboards were created
Honestly, that's my best guess.

@andrewkroh
Copy link
Member

everything is enabled by default save for ticks

I think the docs are wrong then. They say:

The default value is cpu.metrics: [percentages].

@fearful-symmetry
Copy link
Contributor Author

The default value is cpu.metrics: [percentages].

@andrewkroh where are you seeing that? I'm grepping through the repo and can't find it.

@andrewkroh
Copy link
Member

@jsoriano
Copy link
Member

I guess this is because normalized values were added after the initial dashboards were created

Or maybe that normalized_percentages are disabled by default. But here we have control of the cpu.metrics setting.

Yes, I think the reason is this one, that normalized values are (or were) disabled by default.

@fearful-symmetry
Copy link
Contributor Author

Yah, key word being were here. We might want to look into just refreshing most of the system dashboards. A lot of this stuff looks really old.

@fearful-symmetry fearful-symmetry merged commit 5f571a7 into elastic:master Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working, use only for issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants