Fix pid_count with systemd_unit in procstat_lookup#5972
Fix pid_count with systemd_unit in procstat_lookup#5972danielnelson merged 2 commits intoinfluxdata:masterfrom
Conversation
Attempt at fixing influxdata#5300. Not sure if using an OR statement or writing a separate if was a better practice. Since both check for valid PIDs I used an OR statement. Also I tested this on golang and know almost nothing of GO, so there might be better ways to write this.
|
Is there a chance this failed because I made the edit directly on github's website? It could be a syntax error that worked on versions 1.9 and 1.10 but not from 1.11 onwards. I will give it another Go on a few days if I have enough time to install and learn the language a bit. |
|
I think you just need a space before the - if len(kv[1]) == 0 || bytes.Equal(kv[1], []byte("0")){
+ if len(kv[1]) == 0 || bytes.Equal(kv[1], []byte("0")) { |
(cherry picked from commit cc2f3b2)
|
It seems to me that it doesn't work as expected. When I use influx db as output client, it works fine. However, I also use I want to control the status of But if I shut down the service, I get this: So when I use this query: |
Attempt at fixing #5300. Not sure if using an OR statement or writing a separate if was a better practice. Since both check for valid PIDs I used an OR statement.
Also I tested this on golang and know almost nothing of GO, so there might be better ways to write this.
Required for all PRs: