Skip to content

Provide resource usage as part of spin up #3193

@mikkelhegn

Description

@mikkelhegn

Somewhat tangential to #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:

  1. CPU Times spent (min/avg/max)
  2. Execution time (min/avg/max)
  3. 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
>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions