-
Notifications
You must be signed in to change notification settings - Fork 292
Expose CPU and memory usage on per-component execution spans #3365
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good overall; some mostly-superficial suggestions.
I wonder if we should enable this by default for spin up; there is a small performance penalty but I'm not sure anyone will actually use this otherwise... 🤔
…sage Signed-off-by: Andrew Steurer <94206073+asteurer@users.noreply.github.com>
7480c42 to
2f89787
Compare
BenchmarkingI used the oha tool to benchmark. The performance differences seem to be small enough to justify including the Spin v3.5.1
SummarySuccess rate: 100.00% Spin v3.6.0-pre0 with
|
|
Would you mind doing one more comparison just between the branch as-is and with the lines that set up the call hook commented out? If most of the overhead is in actually running the call hook then we could maybe have the feature enabled by default but still opt-in at runtime. |
Benchmarking Part IIWith the lines that set up the call hook
SummarySuccess rate: 100.00% Without the lines that set up the call hook
SummarySuccess rate: 100.00% |
|
OK not exactly scientific but it seems like the bulk of the latency comes from actually running the call hook. I think it probably makes sense to enable the cargo feature by default for |
|
Yeah, I would prefer to tackle the runtime flag in another PR |
Overview
This is a feature that enables the collection and emission of CPU and memory usage for each component.
Closes #2933
Notes about the collected metrics
This measures 3 things:
Although it was proposed to measure CPU cycles, I think that that measuring execution time is sufficient for now.
Usage
Prerequisites
Generate usage metrics