mirror of
https://github.com/weaveworks/scope.git
synced 2026-05-06 01:08:03 +00:00
Gather per-process CPU and memory metrics.
This commit is contained in:
@@ -327,6 +327,18 @@ func processOriginTable(nmd report.Node, addHostTag bool, addContainerTag bool)
|
||||
rows = append([]Row{{Key: "Host", ValueMajor: report.ExtractHostID(nmd)}}, rows...)
|
||||
}
|
||||
|
||||
for _, tuple := range []struct {
|
||||
key, human string
|
||||
fmt formatter
|
||||
}{
|
||||
{process.CPUUsage, "CPU Usage", formatPercent},
|
||||
{process.MemoryUsage, "Memory Usage", formatMemory},
|
||||
} {
|
||||
if val, ok := nmd.Metrics[tuple.key]; ok {
|
||||
rows = append(rows, sparklineRow(tuple.human, val, tuple.fmt))
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
title = "Process"
|
||||
name, commFound = nmd.Metadata[process.Comm]
|
||||
|
||||
Reference in New Issue
Block a user