segmentio / stats

Go package for abstracting stats collection
https://godoc.org/github.com/segmentio/stats
MIT License
208 stars 32 forks source link

expose procstats structures #40

Closed achille-roussel closed 7 years ago

achille-roussel commented 7 years ago

The Go memory stats seem to give numbers that I either misinterpret or that aren't what I need in one of our projects. I'd like to access the memory stats exposed by the kernel to compare and potentially replace the use of runtime.Memstats.

Since I had already spent time implementing this is stats/procstats I thought it would be better to just reuse this code by exporting the internal types and functions, which is what this PR does.

Please take a look and let me know if something should be changed.

achille-roussel commented 7 years ago

Yes the TODOs are because I didn't implement it for OSX/Windows, but still need the code to compile.

The procstats package actually exposes APIs to collect both the system metrics and the GC stats from the Go runtime (which are the only stats that Go gives us as far as I know).

Thanks for the review!