Documentation ¶
Overview ¶
Package grunning is a library that's able to retrieve on-CPU running time for individual goroutines. It relies on using a patched Go and provides a primitive for fine-grained CPU attribution and control. See #82356 for more details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Difference ¶
Difference is a helper function to compute the absolute difference between two durations.
func Elapsed ¶
Elapsed returns the running time spent doing some piece of work, with grunning.Time() measurements from the start and end.
NB: This only exists due to grunning.Time()'s non-monotonicity, a bug in our runtime patch: https://github.com/cockroachdb/cockroachdb-parser/issues/95529. We can get rid of this, keeping just grunning.Difference(), if that bug is fixed. The bug results in slight {over,under}-estimation of the running time (the latter breaking monotonicity), but is livable with our current uses of this library.
Types ¶
This section is empty.