fix(performance): refine process distinction for Nginx worker and cache processes

This commit is contained in:
Jacky 2025-04-12 15:01:13 +00:00
parent 16369bc635
commit 402de5d987
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D

View file

@ -119,9 +119,9 @@ func GetNginxProcessInfo() (*NginxProcessInfo, error) {
}
// Distinguish between worker processes, cache processes, and other processes
if ppid == masterPID || strings.Contains(cmdline, "worker process") {
if ppid == masterPID && strings.Contains(cmdline, "worker process") {
workerCount++
} else if strings.Contains(cmdline, "cache") {
} else if ppid == masterPID && strings.Contains(cmdline, "cache") {
cacheCount++
} else {
otherCount++