This code is copied from https://github.com/golang/perf/tree/master/internal/stats because we can't import an ‘internal’ directory.
Since that code has been stable for close to four years, this seems relatively safe.
The code is copyright the Go authors using the Go License. See the local LICENSE file.