Skip to content

Implement a timing library that can time a multi-goroutine procedure. #11548

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

Merged
merged 1 commit into from
Apr 27, 2025

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Mar 13, 2025

Implement a timing library that can time a multi-goroutine procedure.

This library can record points in time and have its objects be passed around
across goroutines, and then pretty-print all the data after the procedure is
done.

Example output:

---- ContainerManager.RestoreSubcontainer timing information ----
[02:07:25.476281]                       ╭─ ContainerManager.RestoreSubcontainer
[02:07:25.476281]    +0µs               ├─ containerManager locked: 0µs        
[02:07:25.476503]  +221µs ▉▉▉▉▉▉▉▉▉▉▉▉  ├─ spec validated: 221µs               
[02:07:25.476521]   +17µs ▉             ├─ gofer files done: 17µs              
[02:07:25.476521]    +0µs               │ ... 0µs ...                            ╭─ restorer.restoreSubcontainer
[02:07:25.476524]    +2µs ▏             │ ... 3µs ...                            ├─ restorer locked: 2µs
[02:07:25.476551]   +26µs ▉▌            │ ... 30µs ...                           ├─ subcontainer restore skipped: 26µs
[02:07:25.476551]    +0µs               │ ... 30µs ...                           ╰─ END: 0µs
[02:07:25.476560]    +8µs ▌             ╰─ END: 38µs                           
---- End of ContainerManager.RestoreSubcontainer timing information ----

@copybara-service copybara-service bot added the exported Issue was exported automatically label Mar 13, 2025
@copybara-service copybara-service bot changed the title Report detailed time breakdown of the restore process. Implement a timing library that can time a multi-goroutine procedure. Apr 27, 2025
This library can record points in time and have its objects be passed around
across goroutines, and then pretty-print all the data after the procedure is
done.

Example output:

```
---- ContainerManager.RestoreSubcontainer timing information ----
[02:07:25.476281]                       ╭─ ContainerManager.RestoreSubcontainer
[02:07:25.476281]    +0µs               ├─ containerManager locked: 0µs
[02:07:25.476503]  +221µs ▉▉▉▉▉▉▉▉▉▉▉▉  ├─ spec validated: 221µs
[02:07:25.476521]   +17µs ▉             ├─ gofer files done: 17µs
[02:07:25.476521]    +0µs               │ ... 0µs ...                            ╭─ restorer.restoreSubcontainer
[02:07:25.476524]    +2µs ▏             │ ... 3µs ...                            ├─ restorer locked: 2µs
[02:07:25.476551]   +26µs ▉▌            │ ... 30µs ...                           ├─ subcontainer restore skipped: 26µs
[02:07:25.476551]    +0µs               │ ... 30µs ...                           ╰─ END: 0µs
[02:07:25.476560]    +8µs ▌             ╰─ END: 38µs
---- End of ContainerManager.RestoreSubcontainer timing information ----
```

PiperOrigin-RevId: 752019739
@copybara-service copybara-service bot merged commit 90ce1ab into master Apr 27, 2025
1 of 2 checks passed
@copybara-service copybara-service bot deleted the test/cl735946536 branch April 27, 2025 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exported Issue was exported automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant