Skip to content

testing: show rusage statistics for benchmarks #24905

@LMMilewski

Description

@LMMilewski

When optimizing CPU usage, it would be useful to get CPU usage information from Go benchmarks.

Could we add, where supported, getrusage calls before and after running each benchmark, in addition to wall-time?

I have no opinion about the API for requesting those statistics. Perhaps adding a -test.stats or -test.resources flag would work?
For example: -test.stats=utime,stime,maxrss.

This doesn't have to be rusage specific. For instance, it could be extended with statistics from the perf_event API at some point.

I could send a CL if this is a welcome change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions