Skip to content

Commit c699780

Browse files
committed
guard: fix perf relevant count reporting
1 parent fced0b5 commit c699780

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

internal/guard/monitor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ func (m *Monitor) scan(source string) {
265265
groupDur.Truncate(time.Millisecond),
266266
dur.Truncate(time.Millisecond),
267267
procStats.ProcessesSeen,
268-
len(procs),
268+
procStats.RelevantCount,
269269
len(groupsToScan),
270270
killed,
271271
)

internal/guard/processes.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type procNameIndex map[string][]int32
2323

2424
type ProcSnapshotStats struct {
2525
ProcessesSeen int
26+
RelevantCount int
2627
List time.Duration
2728
Metadata time.Duration
2829
Index time.Duration
@@ -63,6 +64,7 @@ func snapshotProcesses(commandWatchlist map[string]struct{}, groups []config.Gro
6364
markSubtreeRelevant(root, children, relevant)
6465
}
6566
}
67+
stats.RelevantCount = len(relevant)
6668
stats.Relevant = time.Since(relevantStart)
6769

6870
rssStart := time.Now()

0 commit comments

Comments
 (0)