{"action":"created","comment":{"url":"https://api.github.com/repos/zendesk/maxwell/pulls/comments/119768358","pull_request_review_id":41678570,"id":119768358,"diff_hunk":"@@ -1,29 +1,24 @@\n package com.zendesk.maxwell.metrics;\n \n-import com.codahale.metrics.MetricRegistry;\n+import com.codahale.metrics.Meter;\n import com.codahale.metrics.health.HealthCheck;\n-import com.zendesk.maxwell.producer.AbstractAsyncProducer;\n-import org.slf4j.Logger;\n-import org.slf4j.LoggerFactory;\n+import com.zendesk.maxwell.producer.AbstractProducer;\n \n \n public class MaxwellHealthCheck extends HealthCheck {\n+\tprivate final Meter failedMessageMeter;\n \n-\tstatic final Logger LOGGER = LoggerFactory.getLogger(MaxwellHealthCheck.class);\n-\n-\tprivate MetricRegistry metricRegistry;\n-\n-\tpublic MaxwellHealthCheck(MetricRegistry metricRegistry) {\n-\t\tthis.metricRegistry = metricRegistry;\n+\tpublic MaxwellHealthCheck(AbstractProducer producer) {\n+\t\tthis.failedMessageMeter = producer.getFailedMessageMeter();\n \t}\n \n \t@Override\n \tprotected Result check() throws Exception {\n \t\t// TODO: this should be configurable.\n-\t\tif (this.metricRegistry.getMeters().get(AbstractAsyncProducer.failedMessageMeterName).getFifteenMinuteRate() > 0) {\n+\t\tif (failedMessageMeter != null && failedMessageMeter.getFiveMinuteRate() > 0) {\n \t\t\treturn Result.unhealthy(\">1 messages failed to be sent to Kafka in the past 15minutes\");","path":"src/main/java/com/zendesk/maxwell/metrics/MaxwellHealthCheck.java","position":30,"original_position":30,"commit_id":"237fd208e0f5375281885d5ff4f28c697a41c72f","original_commit_id":"237fd208e0f5375281885d5ff4f28c697a41c72f","user":{"login":"smferguson","id":1379282,"avatar_url":"https://avatars1.githubusercontent.com/u/1379282?v=3","gravatar_id":"","url":"https://api.github.com/users/smferguson","html_url":"https://github.com/smferguson","followers_url":"https://api.github.com/users/smferguson/followers","following_url":"https://api.github.com/users/smferguson/following{/other_user}","gists_url":"https://api.github.com/users/smferguson/gists{/gist_id}","starred_url":"https://api.github.com/users/smferguson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smferguson/subscriptions","organizations_url":"https://api.github.com/users/smferguson/orgs","repos_url":"https://api.github.com/users/smferguson/repos","events_url":"https://api.github.com/users/smferguson/events{/privacy}","received_events_url":"https://api.github.com/users/smferguson/received_events","type":"User","site_admin":false},"body":"a little late to the game, but i think the text here needs updating (\"15minutes\" -> \"5minutes\")","created_at":"2017-06-02T02:04:21Z","updated_at":"2017-06-02T02:04:21Z","html_url":"https://github.com/zendesk/maxwell/pull/665#discussion_r119768358","pull_request_url":"https://api.github.com/repos/zendesk/maxwell/pulls/665","_links":{"self":{"href":"https://api.github.com/repos/zendesk/maxwell/pulls/comments/119768358"},"html":{"href":"https://github.com/zendesk/maxwell/pull/665#discussion_r119768358"},"pull_request":{"href":"https://api.github.com/repos/zendesk/maxwell/pulls/665"}}},"pull_request":{"url":"https://api.github.com/repos/zendesk/maxwell/pulls/665","id":122830163,"html_url":"https://github.com/zendesk/maxwell/pull/665","diff_url":"https://github.com/zendesk/maxwell/pull/665.diff","patch_url":"https://github.com/zendesk/maxwell/pull/665.patch","issue_url":"https://api.github.com/repos/zendesk/maxwell/issues/665","number":665,"state":"closed","locked":false,"title":"Pass around MaxwellMetrics instance instead of using static methods","user":{"login":"timbertson","id":14172,"avatar_url":"https://avatars0.githubusercontent.com/u/14172?v=3","gravatar_id":"","url":"https://api.github.com/users/timbertson","html_url":"https://github.com/timbertson","followers_url":"https://api.github.com/users/timbertson/followers","following_url":"https://api.github.com/users/timbertson/following{/other_user}","gists_url":"https://api.github.com/users/timbertson/gists{/gist_id}","starred_url":"https://api.github.com/users/timbertson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timbertson/subscriptions","organizations_url":"https://api.github.com/users/timbertson/orgs","repos_url":"https://api.github.com/users/timbertson/repos","events_url":"https://api.github.com/users/timbertson/events{/privacy}","received_events_url":"https://api.github.com/users/timbertson/received_events","type":"User","site_admin":false},"body":"Mainly this allows us to drop the awkward \"only add a gauge if there isn't one with this name already\" code whenever we add a custom gauge, but it should help with #634 too.\r\n\r\n/cc @zendesk/goanna @smferguson ","created_at":"2017-05-29T05:30:34Z","updated_at":"2017-06-02T02:04:21Z","closed_at":"2017-06-02T01:54:36Z","merged_at":"2017-06-02T01:54:36Z","merge_commit_sha":"93e6aaac5c982c45f841c79458bc246b5247b0dd","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/zendesk/maxwell/pulls/665/commits","review_comments_url":"https://api.github.com/repos/zendesk/maxwell/pulls/665/comments","review_comment_url":"https://api.github.com/repos/zendesk/maxwell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendesk/maxwell/issues/665/comments","statuses_url":"https://api.github.com/repos/zendesk/maxwell/statuses/237fd208e0f5375281885d5ff4f28c697a41c72f","head":{"label":"zendesk:tcuthbertson/metrics","ref":"tcuthbertson/metrics","sha":"237fd208e0f5375281885d5ff4f28c697a41c72f","user":{"login":"zendesk","id":11525,"avatar_url":"https://avatars0.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":30561160,"name":"maxwell","full_name":"zendesk/maxwell","owner":{"login":"zendesk","id":11525,"avatar_url":"https://avatars0.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/maxwell","description":"Maxwell's daemon, a mysql-to-json kafka producer","fork":false,"url":"https://api.github.com/repos/zendesk/maxwell","forks_url":"https://api.github.com/repos/zendesk/maxwell/forks","keys_url":"https://api.github.com/repos/zendesk/maxwell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/maxwell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/maxwell/teams","hooks_url":"https://api.github.com/repos/zendesk/maxwell/hooks","issue_events_url":"https://api.github.com/repos/zendesk/maxwell/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/maxwell/events","assignees_url":"https://api.github.com/repos/zendesk/maxwell/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/maxwell/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/maxwell/tags","blobs_url":"https://api.github.com/repos/zendesk/maxwell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/maxwell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/maxwell/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/maxwell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/maxwell/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/maxwell/languages","stargazers_url":"https://api.github.com/repos/zendesk/maxwell/stargazers","contributors_url":"https://api.github.com/repos/zendesk/maxwell/contributors","subscribers_url":"https://api.github.com/repos/zendesk/maxwell/subscribers","subscription_url":"https://api.github.com/repos/zendesk/maxwell/subscription","commits_url":"https://api.github.com/repos/zendesk/maxwell/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/maxwell/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/maxwell/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/maxwell/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/maxwell/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/maxwell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/maxwell/merges","archive_url":"https://api.github.com/repos/zendesk/maxwell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/maxwell/downloads","issues_url":"https://api.github.com/repos/zendesk/maxwell/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/maxwell/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/maxwell/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/maxwell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/maxwell/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/maxwell/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/maxwell/deployments","created_at":"2015-02-09T22:06:13Z","updated_at":"2017-05-30T05:18:03Z","pushed_at":"2017-06-02T01:57:41Z","git_url":"git://github.com/zendesk/maxwell.git","ssh_url":"git@github.com:zendesk/maxwell.git","clone_url":"https://github.com/zendesk/maxwell.git","svn_url":"https://github.com/zendesk/maxwell","homepage":"http://maxwells-daemon.io/","size":9335,"stargazers_count":357,"watchers_count":357,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":153,"mirror_url":null,"open_issues_count":66,"forks":153,"open_issues":66,"watchers":357,"default_branch":"master"}},"base":{"label":"zendesk:master","ref":"master","sha":"80f8b18e5c495fe83088d5d49b6e3ba8c1481cce","user":{"login":"zendesk","id":11525,"avatar_url":"https://avatars0.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":30561160,"name":"maxwell","full_name":"zendesk/maxwell","owner":{"login":"zendesk","id":11525,"avatar_url":"https://avatars0.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/maxwell","description":"Maxwell's daemon, a mysql-to-json kafka producer","fork":false,"url":"https://api.github.com/repos/zendesk/maxwell","forks_url":"https://api.github.com/repos/zendesk/maxwell/forks","keys_url":"https://api.github.com/repos/zendesk/maxwell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/maxwell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/maxwell/teams","hooks_url":"https://api.github.com/repos/zendesk/maxwell/hooks","issue_events_url":"https://api.github.com/repos/zendesk/maxwell/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/maxwell/events","assignees_url":"https://api.github.com/repos/zendesk/maxwell/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/maxwell/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/maxwell/tags","blobs_url":"https://api.github.com/repos/zendesk/maxwell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/maxwell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/maxwell/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/maxwell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/maxwell/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/maxwell/languages","stargazers_url":"https://api.github.com/repos/zendesk/maxwell/stargazers","contributors_url":"https://api.github.com/repos/zendesk/maxwell/contributors","subscribers_url":"https://api.github.com/repos/zendesk/maxwell/subscribers","subscription_url":"https://api.github.com/repos/zendesk/maxwell/subscription","commits_url":"https://api.github.com/repos/zendesk/maxwell/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/maxwell/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/maxwell/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/maxwell/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/maxwell/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/maxwell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/maxwell/merges","archive_url":"https://api.github.com/repos/zendesk/maxwell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/maxwell/downloads","issues_url":"https://api.github.com/repos/zendesk/maxwell/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/maxwell/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/maxwell/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/maxwell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/maxwell/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/maxwell/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/maxwell/deployments","created_at":"2015-02-09T22:06:13Z","updated_at":"2017-05-30T05:18:03Z","pushed_at":"2017-06-02T01:57:41Z","git_url":"git://github.com/zendesk/maxwell.git","ssh_url":"git@github.com:zendesk/maxwell.git","clone_url":"https://github.com/zendesk/maxwell.git","svn_url":"https://github.com/zendesk/maxwell","homepage":"http://maxwells-daemon.io/","size":9335,"stargazers_count":357,"watchers_count":357,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":153,"mirror_url":null,"open_issues_count":66,"forks":153,"open_issues":66,"watchers":357,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendesk/maxwell/pulls/665"},"html":{"href":"https://github.com/zendesk/maxwell/pull/665"},"issue":{"href":"https://api.github.com/repos/zendesk/maxwell/issues/665"},"comments":{"href":"https://api.github.com/repos/zendesk/maxwell/issues/665/comments"},"review_comments":{"href":"https://api.github.com/repos/zendesk/maxwell/pulls/665/comments"},"review_comment":{"href":"https://api.github.com/repos/zendesk/maxwell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendesk/maxwell/pulls/665/commits"},"statuses":{"href":"https://api.github.com/repos/zendesk/maxwell/statuses/237fd208e0f5375281885d5ff4f28c697a41c72f"}}}}
{"actor":{"display_login":"smferguson"}}