no gather extend metrics if len(pids) == 0

This commit is contained in:
Ulric Qin 2022-04-21 18:18:17 +08:00
parent a8b13de71a
commit 544aa71ba6
1 changed files with 4 additions and 0 deletions

View File

@ -154,6 +154,10 @@ func (s *Procstat) gatherOnce(slist *list.SafeList, ins *Instance) {
}
slist.PushFront(inputs.NewSample("lookup_count", len(pids), tags))
if len(pids) == 0 {
return
}
if len(ins.GatherMoreMetrics) == 0 {
return
}