spinframework / spinframework/spin
Provide resource usage as part of `spin up`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.5k
- Forks
- 310
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 24
Description
Somewhat tangential to https://github.com/spinframework/spin/issues/2933.
It would be great to have a flag (or potentially a plugin) to Spin, which will output three metrics from running a Spin app locally:
- CPU Times spent (min/avg/max)
- Execution time (min/avg/max)
- Memory usage (min/avg/max)
With min/avg/max being across the requests handled while Spin was running a given application.
Further improvement being splitting by component, while maintaining total.
I'm imagining something like:
> spin up --enable-spinfo
Logging component stdio to ".spin/logs/"
Serving http://127.0.0.1:3000
Available Routes:
demo-ts: http://127.0.0.1:3000 (wildcard)
^C⏎
-- SpInfo
Total:
# of invocations: 200
CPU Times spent (min/avg/max) 1ms/2ms/5ms
Execution time (min/avg/max) 10ms/20ms/30ms
Memory usage (min/avg/max) 5MB/10MB/10MB
Component 1:
# of invocations: 200
CPU Times spent (min/avg/max) 1ms/2ms/5ms
Execution time (min/avg/max) 10ms/20ms/30ms
Memory usage (min/avg/max) 5MB/5MB/5MB
Component 2:
# of invocations: 100
CPU Times spent (min/avg/max) 0ms/1ms/2ms
Execution time (min/avg/max) 5ms/10ms/20ms
Memory usage (min/avg/max) 5MB/5MB/5MB
>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the spin up command and the request and component invocation paths. Define how CPU time, execution time, memory, and invocation counts are collected and aggregated, then verify that the completed feature reports min/avg/max totals and per-component values as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, wasm
- Domain
- cli, observability, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100