Skip to content

Conversation

@jsadowyj
Copy link
Contributor

@jsadowyj jsadowyj commented Oct 28, 2025

Overview

This PR modifies the cpu_detailed plugin to use awk efficiently. Some rudimentary testing shows a 98% speed gain after this change.

AI Disclosure

@jperkin worked with Claude to optimize this script.

Problem Statement

The average time to execute the cpu_detailed plugin on one of our EPYC CNs crosses well over the default three second threshold.

image

Testing

The version of this plugin released in v0.0.6 was manually replaced with this version on one of the problematic EPYC CNs. The log shows no errors:

[root@a12 (us-central-1a) ~]# bunyan -l warn $(svcs -L cmon-agent)

[root@a12 (us-central-1a) ~]# echo $?
0

And the execution time decreased sharply according to our CMON metrics:
image

Additional Notes

IIf anyone has some suggestions on how to optimize the runtime for the plugin, I am open to suggestions. I would much rather optimize the plugin than increase the timeout.

I already refactored it to use associative arrays in #2, which greatly improved performance, but perhaps there is something else I have not considered.

Thank you @jperkin for the optimization!

@jsadowyj jsadowyj requested a review from a team October 28, 2025 15:41
@jsadowyj jsadowyj self-assigned this Oct 28, 2025
@jsadowyj jsadowyj changed the title TRITON-2516 increase timeout for cpu_detailed plugin TRITON-2516 optimize cpu_detailed cmon gz plugin Oct 28, 2025
Copy link

@danmcd danmcd left a comment

Choose a reason for hiding this comment

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

When you get far enough along, make sure your test results are in the ticket.

Copy link

@danmcd danmcd left a comment

Choose a reason for hiding this comment

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

Thanks for the testing notes in the ticket. Before I approve this, a couple of quick questions:

1.) The single-awk-run was Claude-assisted? If so, the assisted-by line needs to go into the commit.

2.) But it was suggested by @jperkin ? If so, a Portions-by-jperkin line needs to go into the comment as well.

Copy link

@danmcd danmcd left a comment

Choose a reason for hiding this comment

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

Questions answered offline, and will be reflected in the squash-and-merge commit message.

@jsadowyj jsadowyj merged commit 575a9cc into master Oct 29, 2025
@jsadowyj jsadowyj deleted the TRITON-2516 branch October 29, 2025 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants