{"action":"created","issue":{"url":"https://api.github.com/repos/sensu-plugins/sensu-plugins-cpu-checks/issues/35","repository_url":"https://api.github.com/repos/sensu-plugins/sensu-plugins-cpu-checks","labels_url":"https://api.github.com/repos/sensu-plugins/sensu-plugins-cpu-checks/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/sensu-plugins/sensu-plugins-cpu-checks/issues/35/comments","events_url":"https://api.github.com/repos/sensu-plugins/sensu-plugins-cpu-checks/issues/35/events","html_url":"https://github.com/sensu-plugins/sensu-plugins-cpu-checks/issues/35","id":340834547,"node_id":"MDU6SXNzdWUzNDA4MzQ1NDc=","number":35,"title":"check-cpu.rb alerts sometimes regardless of load on cpu","user":{"login":"infa-ddeore","id":39782583,"node_id":"MDQ6VXNlcjM5NzgyNTgz","avatar_url":"https://avatars3.githubusercontent.com/u/39782583?v=4","gravatar_id":"","url":"https://api.github.com/users/infa-ddeore","html_url":"https://github.com/infa-ddeore","followers_url":"https://api.github.com/users/infa-ddeore/followers","following_url":"https://api.github.com/users/infa-ddeore/following{/other_user}","gists_url":"https://api.github.com/users/infa-ddeore/gists{/gist_id}","starred_url":"https://api.github.com/users/infa-ddeore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infa-ddeore/subscriptions","organizations_url":"https://api.github.com/users/infa-ddeore/orgs","repos_url":"https://api.github.com/users/infa-ddeore/repos","events_url":"https://api.github.com/users/infa-ddeore/events{/privacy}","received_events_url":"https://api.github.com/users/infa-ddeore/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"majormoses","id":3145127,"node_id":"MDQ6VXNlcjMxNDUxMjc=","avatar_url":"https://avatars3.githubusercontent.com/u/3145127?v=4","gravatar_id":"","url":"https://api.github.com/users/majormoses","html_url":"https://github.com/majormoses","followers_url":"https://api.github.com/users/majormoses/followers","following_url":"https://api.github.com/users/majormoses/following{/other_user}","gists_url":"https://api.github.com/users/majormoses/gists{/gist_id}","starred_url":"https://api.github.com/users/majormoses/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/majormoses/subscriptions","organizations_url":"https://api.github.com/users/majormoses/orgs","repos_url":"https://api.github.com/users/majormoses/repos","events_url":"https://api.github.com/users/majormoses/events{/privacy}","received_events_url":"https://api.github.com/users/majormoses/received_events","type":"User","site_admin":false},"assignees":[{"login":"majormoses","id":3145127,"node_id":"MDQ6VXNlcjMxNDUxMjc=","avatar_url":"https://avatars3.githubusercontent.com/u/3145127?v=4","gravatar_id":"","url":"https://api.github.com/users/majormoses","html_url":"https://github.com/majormoses","followers_url":"https://api.github.com/users/majormoses/followers","following_url":"https://api.github.com/users/majormoses/following{/other_user}","gists_url":"https://api.github.com/users/majormoses/gists{/gist_id}","starred_url":"https://api.github.com/users/majormoses/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/majormoses/subscriptions","organizations_url":"https://api.github.com/users/majormoses/orgs","repos_url":"https://api.github.com/users/majormoses/repos","events_url":"https://api.github.com/users/majormoses/events{/privacy}","received_events_url":"https://api.github.com/users/majormoses/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-07-12T23:43:23Z","updated_at":"2018-07-13T00:17:33Z","closed_at":null,"author_association":"NONE","body":"check-cpu.rb alerts sometimes with total cpu being 100% busy, but the top output captured at the same time as a part of `hooks` doesn't show any load.\r\n\r\nExplanation by @majormoses:\r\n\r\n> the way that it detects it is by gathering the current and then gathering it again (defaults to 1s) and measuring the difference. As the very act of doing so means that you are inflating the cpu utilization by loading up ruby. In addition because of the short timespan it collects data for the numbers will also not be 100% accurate. You can use the `--sleep` option to control how long it waits before using another data point, the longer you wait the more accurate it will be. In an ideal world I would opt for changing the default value to `5` as that is what I found was a good compromise for accuracy and being able to still get very granular/frequent checks but the problem is that someone might be setting their thresholds to less than 5 seconds which would cause issues as you'd have multiple instances of the check running at the same time. I am willing to do it as a breaking change as I think its a good move forward, just giving context of where it is and why it was not changed previously.\r\n\r\nChange default 1 seconds to something higher to get more accurate data and avoid un-necessary alerts.\r\n"},"comment":{"url":"https://api.github.com/repos/sensu-plugins/sensu-plugins-cpu-checks/issues/comments/404688725","html_url":"https://github.com/sensu-plugins/sensu-plugins-cpu-checks/issues/35#issuecomment-404688725","issue_url":"https://api.github.com/repos/sensu-plugins/sensu-plugins-cpu-checks/issues/35","id":404688725,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDY4ODcyNQ==","user":{"login":"majormoses","id":3145127,"node_id":"MDQ6VXNlcjMxNDUxMjc=","avatar_url":"https://avatars3.githubusercontent.com/u/3145127?v=4","gravatar_id":"","url":"https://api.github.com/users/majormoses","html_url":"https://github.com/majormoses","followers_url":"https://api.github.com/users/majormoses/followers","following_url":"https://api.github.com/users/majormoses/following{/other_user}","gists_url":"https://api.github.com/users/majormoses/gists{/gist_id}","starred_url":"https://api.github.com/users/majormoses/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/majormoses/subscriptions","organizations_url":"https://api.github.com/users/majormoses/orgs","repos_url":"https://api.github.com/users/majormoses/repos","events_url":"https://api.github.com/users/majormoses/events{/privacy}","received_events_url":"https://api.github.com/users/majormoses/received_events","type":"User","site_admin":false},"created_at":"2018-07-13T00:17:33Z","updated_at":"2018-07-13T00:17:33Z","author_association":"MEMBER","body":"@infa-ddeore did you find that `5` was a reasonable number on your hardware profile? The more constrained the resources are the more impact the poll interval (sleep) will have. On my local machine I noticed very little difference because I have plenty of CPU and memory but when I last did that testing I was testing it based on an aws vm (m4.large) if I recall correctly. I think its worth exploring if there might be a better default than `5`. From my tests so far it looks pretty close to top usage at `5`, at worst its been inflated by maybe as much as 2-3 percent which I'd say is pretty negligable. Also keep in mind I have lots of things running on my local machine and pretty much anything could cause a 2-3% variation between captures. I have been comparing the results to `top -d 5` to make sure that we are not comparing apples and oranges."}}
{"actor":{"display_login":"majormoses"}}