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

NAS-133683 / 25.04 / Refactor CPU reporting #15445

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

Qubad786
Copy link
Contributor

@Qubad786 Qubad786 commented Jan 21, 2025

Context

It was requested that we make some refactoring changes to our CPU reporting. Following points have been catered to:

  1. /proc/stat has been disabled
  2. CPU stats like user/nice etc are not being saved/retrieved
  3. We were calculating the usage incorrectly which has been addressed
  4. Data structure of CPU stats has been changed in realtime reporting

Example payload of what we send in realtime reporting for CPU metrics

    "cpu": {
      "cpu": {
        "usage": 33,
        "temp": null
      },
      "cpu0": {
        "usage": 100,
        "temp": null
      },
      "cpu1": {
        "usage": 1,
        "temp": null
      },
      "cpu2": {
        "usage": 0,
        "temp": null
      }
    },

@Qubad786 Qubad786 added the jira label Jan 21, 2025
@Qubad786 Qubad786 requested a review from a team January 21, 2025 10:09
@bugclerk bugclerk changed the title Refactor CPU reporting NAS-133683 / 25.04 / Refactor CPU reporting Jan 21, 2025
@bugclerk
Copy link
Contributor

@truenas truenas deleted a comment from bugclerk Jan 21, 2025
@Qubad786 Qubad786 force-pushed the mrehan/cpu-reporting-refactor branch from 6ddce00 to 23059e4 Compare January 21, 2025 12:23
Copy link
Contributor

@yocalebo yocalebo left a comment

Choose a reason for hiding this comment

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

Looks great, thank you! Please do not merge until UI has a PR up and can adapt to these changes since this affects the dashboard widgets.

Copy link
Contributor

@yocalebo yocalebo left a comment

Choose a reason for hiding this comment

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

temp isn't working in my tests.

Copy link
Contributor

@yocalebo yocalebo left a comment

Choose a reason for hiding this comment

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

Sorry, I was wrong. This is working, re-approving (but still don't merge yet).

@Qubad786 Qubad786 force-pushed the mrehan/cpu-reporting-refactor branch from 23059e4 to 9479e43 Compare January 23, 2025 09:49
@RehanY147
Copy link

RehanY147 commented Jan 23, 2025

Hello. I am getting this response in reporting.realtime response under CPU over and over. Usage values are always 0.

{
	"cpu": {
		"cpu": {
			"usage": 0,
			"temp": null
		},
		"cpu0": {
			"usage": 0,
			"temp": null
		},
		"cpu1": {
			"usage": 0,
			"temp": null
		},
		"cpu2": {
			"usage": 0,
			"temp": null
		},
		"cpu3": {
			"usage": 0,
			"temp": null
		}
	}
}

@Qubad786 Qubad786 merged commit 6147e8d into master Jan 27, 2025
2 checks passed
@Qubad786 Qubad786 deleted the mrehan/cpu-reporting-refactor branch January 27, 2025 12:51
@bugclerk
Copy link
Contributor

JIRA ticket https://ixsystems.atlassian.net/browse/NAS-133683 is targeted to the following versions which have not received their corresponding PRs: 25.10

@bugclerk
Copy link
Contributor

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Jan 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants