{"action":"opened","number":1514,"pull_request":{"url":"https://api.github.com/repos/sensu/sensu/pulls/1514","id":97041390,"html_url":"https://github.com/sensu/sensu/pull/1514","diff_url":"https://github.com/sensu/sensu/pull/1514.diff","patch_url":"https://github.com/sensu/sensu/pull/1514.patch","issue_url":"https://api.github.com/repos/sensu/sensu/issues/1514","number":1514,"state":"open","locked":false,"title":"Override check interval in TTL alarm with interval of TTL timer","user":{"login":"CVTJNII","id":13871930,"avatar_url":"https://avatars.githubusercontent.com/u/13871930?v=3","gravatar_id":"","url":"https://api.github.com/users/CVTJNII","html_url":"https://github.com/CVTJNII","followers_url":"https://api.github.com/users/CVTJNII/followers","following_url":"https://api.github.com/users/CVTJNII/following{/other_user}","gists_url":"https://api.github.com/users/CVTJNII/gists{/gist_id}","starred_url":"https://api.github.com/users/CVTJNII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CVTJNII/subscriptions","organizations_url":"https://api.github.com/users/CVTJNII/orgs","repos_url":"https://api.github.com/users/CVTJNII/repos","events_url":"https://api.github.com/users/CVTJNII/events{/privacy}","received_events_url":"https://api.github.com/users/CVTJNII/received_events","type":"User","site_admin":false},"body":"…so that handler calculations are correct\r\n\r\nProposed partial solution for #1302: Extend the TTL check result to set the TTL timer interval in the check.  When using [Sensu-Plugin handlers](https://github.com/sensu-plugins/sensu-plugin/blob/ead9fd0a81ff3f099a0032f90ae6976d63a345c5/lib/sensu-handler.rb#L171) this will allow the handler to update the re-alert occurrence count if the TTL interval is not equal to the actual check interval.\r\n\r\nResolves the concern about re-alerts in #1302.  Does not address other concerns about the interval time changing.\r\n\r\nDetails of change:\r\n- Turns the magic \"30\" value into a method argument default so that is can be passed around easier and be a little less magical\r\n- Sets the :interval key in the TTL check result to the TTL timer interval value\r\n- Adds test coverage\r\n\r\n## Motivation and Context\r\nIf a check is set up to be slow, say every hour with a 6 hour realert, then the handler refresh occurrence value is 6.  If that check goes in to TTL alert with a 30 second interval, but still passing 1 hour interval to the handler from the underlying check, then the refresh goes from 1 hour to three minutes due to 30sec * 6 = 3 min.  This change mitigates this and ensures the check payload interval will match the rate from the TTL processor.\r\n\r\n## How Has This Been Tested?\r\n- Spec tests updated and tested with 'bundle exec rake'\r\n- Tested in a lab environment by running the Sensu stack (server/api installed via gem specific_install into a container) and verified the interval changed from the check interval to the TTL interval (30).\r\n\r\n## Types of changes\r\n- [X] Bug fix (non-breaking change which fixes an issue)\r\n- [ ] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\r\n\r\n## Checklist:\r\n- [ ] My change requires a change to the documentation.\r\n- [ ] I have updated the documentation accordingly.\r\n- [X] I have read the **CONTRIBUTING** document.\r\n- [X] I have added tests to cover my changes.\r\n- [X] All new and existing tests passed.\r\n\r\nNOTE: (Re: Contributing) There hasn't been any discussion of my proposed solution in #1302 yet, but this change is simple enough that I believe it to be safe.\r\n\r\n","created_at":"2016-12-08T01:14:29Z","updated_at":"2016-12-08T01:14:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sensu/sensu/pulls/1514/commits","review_comments_url":"https://api.github.com/repos/sensu/sensu/pulls/1514/comments","review_comment_url":"https://api.github.com/repos/sensu/sensu/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sensu/sensu/issues/1514/comments","statuses_url":"https://api.github.com/repos/sensu/sensu/statuses/33e1b75da03d8074d39aa8007ef85c8cf6a95f93","head":{"label":"CVTJNII:check_ttl_interval","ref":"check_ttl_interval","sha":"33e1b75da03d8074d39aa8007ef85c8cf6a95f93","user":{"login":"CVTJNII","id":13871930,"avatar_url":"https://avatars.githubusercontent.com/u/13871930?v=3","gravatar_id":"","url":"https://api.github.com/users/CVTJNII","html_url":"https://github.com/CVTJNII","followers_url":"https://api.github.com/users/CVTJNII/followers","following_url":"https://api.github.com/users/CVTJNII/following{/other_user}","gists_url":"https://api.github.com/users/CVTJNII/gists{/gist_id}","starred_url":"https://api.github.com/users/CVTJNII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CVTJNII/subscriptions","organizations_url":"https://api.github.com/users/CVTJNII/orgs","repos_url":"https://api.github.com/users/CVTJNII/repos","events_url":"https://api.github.com/users/CVTJNII/events{/privacy}","received_events_url":"https://api.github.com/users/CVTJNII/received_events","type":"User","site_admin":false},"repo":{"id":75880236,"name":"sensu","full_name":"CVTJNII/sensu","owner":{"login":"CVTJNII","id":13871930,"avatar_url":"https://avatars.githubusercontent.com/u/13871930?v=3","gravatar_id":"","url":"https://api.github.com/users/CVTJNII","html_url":"https://github.com/CVTJNII","followers_url":"https://api.github.com/users/CVTJNII/followers","following_url":"https://api.github.com/users/CVTJNII/following{/other_user}","gists_url":"https://api.github.com/users/CVTJNII/gists{/gist_id}","starred_url":"https://api.github.com/users/CVTJNII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CVTJNII/subscriptions","organizations_url":"https://api.github.com/users/CVTJNII/orgs","repos_url":"https://api.github.com/users/CVTJNII/repos","events_url":"https://api.github.com/users/CVTJNII/events{/privacy}","received_events_url":"https://api.github.com/users/CVTJNII/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CVTJNII/sensu","description":"Monitoring for today's infrastructure. ","fork":true,"url":"https://api.github.com/repos/CVTJNII/sensu","forks_url":"https://api.github.com/repos/CVTJNII/sensu/forks","keys_url":"https://api.github.com/repos/CVTJNII/sensu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CVTJNII/sensu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CVTJNII/sensu/teams","hooks_url":"https://api.github.com/repos/CVTJNII/sensu/hooks","issue_events_url":"https://api.github.com/repos/CVTJNII/sensu/issues/events{/number}","events_url":"https://api.github.com/repos/CVTJNII/sensu/events","assignees_url":"https://api.github.com/repos/CVTJNII/sensu/assignees{/user}","branches_url":"https://api.github.com/repos/CVTJNII/sensu/branches{/branch}","tags_url":"https://api.github.com/repos/CVTJNII/sensu/tags","blobs_url":"https://api.github.com/repos/CVTJNII/sensu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CVTJNII/sensu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CVTJNII/sensu/git/refs{/sha}","trees_url":"https://api.github.com/repos/CVTJNII/sensu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CVTJNII/sensu/statuses/{sha}","languages_url":"https://api.github.com/repos/CVTJNII/sensu/languages","stargazers_url":"https://api.github.com/repos/CVTJNII/sensu/stargazers","contributors_url":"https://api.github.com/repos/CVTJNII/sensu/contributors","subscribers_url":"https://api.github.com/repos/CVTJNII/sensu/subscribers","subscription_url":"https://api.github.com/repos/CVTJNII/sensu/subscription","commits_url":"https://api.github.com/repos/CVTJNII/sensu/commits{/sha}","git_commits_url":"https://api.github.com/repos/CVTJNII/sensu/git/commits{/sha}","comments_url":"https://api.github.com/repos/CVTJNII/sensu/comments{/number}","issue_comment_url":"https://api.github.com/repos/CVTJNII/sensu/issues/comments{/number}","contents_url":"https://api.github.com/repos/CVTJNII/sensu/contents/{+path}","compare_url":"https://api.github.com/repos/CVTJNII/sensu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CVTJNII/sensu/merges","archive_url":"https://api.github.com/repos/CVTJNII/sensu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CVTJNII/sensu/downloads","issues_url":"https://api.github.com/repos/CVTJNII/sensu/issues{/number}","pulls_url":"https://api.github.com/repos/CVTJNII/sensu/pulls{/number}","milestones_url":"https://api.github.com/repos/CVTJNII/sensu/milestones{/number}","notifications_url":"https://api.github.com/repos/CVTJNII/sensu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CVTJNII/sensu/labels{/name}","releases_url":"https://api.github.com/repos/CVTJNII/sensu/releases{/id}","deployments_url":"https://api.github.com/repos/CVTJNII/sensu/deployments","created_at":"2016-12-07T22:15:03Z","updated_at":"2016-12-07T22:15:04Z","pushed_at":"2016-12-08T00:25:33Z","git_url":"git://github.com/CVTJNII/sensu.git","ssh_url":"git@github.com:CVTJNII/sensu.git","clone_url":"https://github.com/CVTJNII/sensu.git","svn_url":"https://github.com/CVTJNII/sensu","homepage":"https://sensuapp.org","size":3264,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sensu:master","ref":"master","sha":"6698d08df386cee96bc91aaa0621e315dd35e21c","user":{"login":"sensu","id":1648901,"avatar_url":"https://avatars.githubusercontent.com/u/1648901?v=3","gravatar_id":"","url":"https://api.github.com/users/sensu","html_url":"https://github.com/sensu","followers_url":"https://api.github.com/users/sensu/followers","following_url":"https://api.github.com/users/sensu/following{/other_user}","gists_url":"https://api.github.com/users/sensu/gists{/gist_id}","starred_url":"https://api.github.com/users/sensu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sensu/subscriptions","organizations_url":"https://api.github.com/users/sensu/orgs","repos_url":"https://api.github.com/users/sensu/repos","events_url":"https://api.github.com/users/sensu/events{/privacy}","received_events_url":"https://api.github.com/users/sensu/received_events","type":"Organization","site_admin":false},"repo":{"id":2031640,"name":"sensu","full_name":"sensu/sensu","owner":{"login":"sensu","id":1648901,"avatar_url":"https://avatars.githubusercontent.com/u/1648901?v=3","gravatar_id":"","url":"https://api.github.com/users/sensu","html_url":"https://github.com/sensu","followers_url":"https://api.github.com/users/sensu/followers","following_url":"https://api.github.com/users/sensu/following{/other_user}","gists_url":"https://api.github.com/users/sensu/gists{/gist_id}","starred_url":"https://api.github.com/users/sensu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sensu/subscriptions","organizations_url":"https://api.github.com/users/sensu/orgs","repos_url":"https://api.github.com/users/sensu/repos","events_url":"https://api.github.com/users/sensu/events{/privacy}","received_events_url":"https://api.github.com/users/sensu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sensu/sensu","description":"Monitoring for today's infrastructure. ","fork":false,"url":"https://api.github.com/repos/sensu/sensu","forks_url":"https://api.github.com/repos/sensu/sensu/forks","keys_url":"https://api.github.com/repos/sensu/sensu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sensu/sensu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sensu/sensu/teams","hooks_url":"https://api.github.com/repos/sensu/sensu/hooks","issue_events_url":"https://api.github.com/repos/sensu/sensu/issues/events{/number}","events_url":"https://api.github.com/repos/sensu/sensu/events","assignees_url":"https://api.github.com/repos/sensu/sensu/assignees{/user}","branches_url":"https://api.github.com/repos/sensu/sensu/branches{/branch}","tags_url":"https://api.github.com/repos/sensu/sensu/tags","blobs_url":"https://api.github.com/repos/sensu/sensu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sensu/sensu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sensu/sensu/git/refs{/sha}","trees_url":"https://api.github.com/repos/sensu/sensu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sensu/sensu/statuses/{sha}","languages_url":"https://api.github.com/repos/sensu/sensu/languages","stargazers_url":"https://api.github.com/repos/sensu/sensu/stargazers","contributors_url":"https://api.github.com/repos/sensu/sensu/contributors","subscribers_url":"https://api.github.com/repos/sensu/sensu/subscribers","subscription_url":"https://api.github.com/repos/sensu/sensu/subscription","commits_url":"https://api.github.com/repos/sensu/sensu/commits{/sha}","git_commits_url":"https://api.github.com/repos/sensu/sensu/git/commits{/sha}","comments_url":"https://api.github.com/repos/sensu/sensu/comments{/number}","issue_comment_url":"https://api.github.com/repos/sensu/sensu/issues/comments{/number}","contents_url":"https://api.github.com/repos/sensu/sensu/contents/{+path}","compare_url":"https://api.github.com/repos/sensu/sensu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sensu/sensu/merges","archive_url":"https://api.github.com/repos/sensu/sensu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sensu/sensu/downloads","issues_url":"https://api.github.com/repos/sensu/sensu/issues{/number}","pulls_url":"https://api.github.com/repos/sensu/sensu/pulls{/number}","milestones_url":"https://api.github.com/repos/sensu/sensu/milestones{/number}","notifications_url":"https://api.github.com/repos/sensu/sensu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sensu/sensu/labels{/name}","releases_url":"https://api.github.com/repos/sensu/sensu/releases{/id}","deployments_url":"https://api.github.com/repos/sensu/sensu/deployments","created_at":"2011-07-11T17:50:16Z","updated_at":"2016-12-07T16:51:13Z","pushed_at":"2016-12-03T10:49:06Z","git_url":"git://github.com/sensu/sensu.git","ssh_url":"git@github.com:sensu/sensu.git","clone_url":"https://github.com/sensu/sensu.git","svn_url":"https://github.com/sensu/sensu","homepage":"https://sensuapp.org","size":5163,"stargazers_count":2509,"watchers_count":2509,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":353,"mirror_url":null,"open_issues_count":124,"forks":353,"open_issues":124,"watchers":2509,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sensu/sensu/pulls/1514"},"html":{"href":"https://github.com/sensu/sensu/pull/1514"},"issue":{"href":"https://api.github.com/repos/sensu/sensu/issues/1514"},"comments":{"href":"https://api.github.com/repos/sensu/sensu/issues/1514/comments"},"review_comments":{"href":"https://api.github.com/repos/sensu/sensu/pulls/1514/comments"},"review_comment":{"href":"https://api.github.com/repos/sensu/sensu/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sensu/sensu/pulls/1514/commits"},"statuses":{"href":"https://api.github.com/repos/sensu/sensu/statuses/33e1b75da03d8074d39aa8007ef85c8cf6a95f93"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":8,"deletions":5,"changed_files":2}}
{"actor":{"display_login":"CVTJNII"}}