Files
Etienne PerotandgVisor bot 94073805ef 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 ----
```

PiperOrigin-RevId: 752019739
2025-04-27 08:42:58 -07:00

17 lines
294 B
Python

load("//tools:defs.bzl", "go_library")
package(
default_applicable_licenses = ["//:license"],
licenses = ["notice"],
)
go_library(
name = "timing",
srcs = ["timing.go"],
visibility = ["//:sandbox"],
deps = [
"//pkg/atomicbitops",
"//pkg/log",
],
)