1
0
mirror of https://github.com/google/gops.git synced 2024-11-19 20:31:58 +02:00

agent: fix mistakes in off-heap mstat naming

Some statistics were mislabeled as related to the stack while those are
off-heap memory statistics. I'm guessing this is due to their proximity
with the stack stats.

Here is the general documentation for these metrics:
https://github.com/golang/go/blob/go1.23.2/src/runtime/mstats.go#L209-L218

	// Off-heap memory statistics.
	//
	// The following statistics measure runtime-internal
	// structures that are not allocated from heap memory (usually
	// because they are part of implementing the heap). Unlike
	// heap or stack memory, any memory allocated to these
	// structures is dedicated to these structures.
	//
	// These are primarily useful for debugging runtime memory
	// overheads.>

Fixes: 390a41310a ("Report more Stack info, as stack-mspan-inuse stack-mspan-sys etc. (#63)")

Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
This commit is contained in:
Mahe Tardy 2024-11-04 11:50:32 +01:00 committed by Tobias Klauser
parent 20ad5744be
commit dcd9131fb9

View File

@ -229,10 +229,10 @@ func handle(conn io.ReadWriter, msg []byte) error {
fmt.Fprintf(conn, "heap-objects: %v\n", s.HeapObjects)
fmt.Fprintf(conn, "stack-in-use: %v\n", formatBytes(s.StackInuse))
fmt.Fprintf(conn, "stack-sys: %v\n", formatBytes(s.StackSys))
fmt.Fprintf(conn, "stack-mspan-inuse: %v\n", formatBytes(s.MSpanInuse))
fmt.Fprintf(conn, "stack-mspan-sys: %v\n", formatBytes(s.MSpanSys))
fmt.Fprintf(conn, "stack-mcache-inuse: %v\n", formatBytes(s.MCacheInuse))
fmt.Fprintf(conn, "stack-mcache-sys: %v\n", formatBytes(s.MCacheSys))
fmt.Fprintf(conn, "mspan-inuse: %v\n", formatBytes(s.MSpanInuse))
fmt.Fprintf(conn, "mspan-sys: %v\n", formatBytes(s.MSpanSys))
fmt.Fprintf(conn, "mcache-inuse: %v\n", formatBytes(s.MCacheInuse))
fmt.Fprintf(conn, "mcache-sys: %v\n", formatBytes(s.MCacheSys))
fmt.Fprintf(conn, "other-sys: %v\n", formatBytes(s.OtherSys))
fmt.Fprintf(conn, "gc-sys: %v\n", formatBytes(s.GCSys))
fmt.Fprintf(conn, "next-gc: when heap-alloc >= %v\n", formatBytes(s.NextGC))