{"action":"created","comment":{"url":"https://api.github.com/repos/dropwizard/metrics/pulls/comments/59351370","id":59351370,"diff_hunk":"@@ -86,7 +88,13 @@ public void init(ServletConfig config) throws ServletException {\n     @Override\n     protected void doGet(HttpServletRequest req,\n                          HttpServletResponse resp) throws ServletException, IOException {\n-        final SortedMap<String, HealthCheck.Result> results = runHealthChecks();\n+        final Map<String, HealthCheck.Result> results;\n+        String name = getHealthCheckName(req);\n+        if (name != null) {\n+            results = Collections.singletonMap(name, registry.runHealthCheck(name));","path":"metrics-servlets/src/main/java/com/codahale/metrics/servlets/HealthCheckServlet.java","position":30,"original_position":30,"commit_id":"bbf00a7fbc342103572b619210658c1fd46a2c4a","original_commit_id":"bbf00a7fbc342103572b619210658c1fd46a2c4a","user":{"login":"ingwarsw","id":5390156,"avatar_url":"https://avatars.githubusercontent.com/u/5390156?v=3","gravatar_id":"","url":"https://api.github.com/users/ingwarsw","html_url":"https://github.com/ingwarsw","followers_url":"https://api.github.com/users/ingwarsw/followers","following_url":"https://api.github.com/users/ingwarsw/following{/other_user}","gists_url":"https://api.github.com/users/ingwarsw/gists{/gist_id}","starred_url":"https://api.github.com/users/ingwarsw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ingwarsw/subscriptions","organizations_url":"https://api.github.com/users/ingwarsw/orgs","repos_url":"https://api.github.com/users/ingwarsw/repos","events_url":"https://api.github.com/users/ingwarsw/events{/privacy}","received_events_url":"https://api.github.com/users/ingwarsw/received_events","type":"User","site_admin":false},"body":"Actually that method throws NoSuchElementException when check is not found.\r\nYou should create method that would check if that check exists and only then call method.\r\n\r\nIf check is not existing you should return empty map so responses (all/one) would be consistent.","created_at":"2016-04-12T10:05:32Z","updated_at":"2016-04-12T10:05:32Z","html_url":"https://github.com/dropwizard/metrics/pull/940#discussion_r59351370","pull_request_url":"https://api.github.com/repos/dropwizard/metrics/pulls/940","_links":{"self":{"href":"https://api.github.com/repos/dropwizard/metrics/pulls/comments/59351370"},"html":{"href":"https://github.com/dropwizard/metrics/pull/940#discussion_r59351370"},"pull_request":{"href":"https://api.github.com/repos/dropwizard/metrics/pulls/940"}}},"pull_request":{"url":"https://api.github.com/repos/dropwizard/metrics/pulls/940","id":66115956,"html_url":"https://github.com/dropwizard/metrics/pull/940","diff_url":"https://github.com/dropwizard/metrics/pull/940.diff","patch_url":"https://github.com/dropwizard/metrics/pull/940.patch","issue_url":"https://api.github.com/repos/dropwizard/metrics/issues/940","number":940,"state":"open","locked":false,"title":"New feature: ability to query individual health checks","user":{"login":"osigida","id":6461608,"avatar_url":"https://avatars.githubusercontent.com/u/6461608?v=3","gravatar_id":"","url":"https://api.github.com/users/osigida","html_url":"https://github.com/osigida","followers_url":"https://api.github.com/users/osigida/followers","following_url":"https://api.github.com/users/osigida/following{/other_user}","gists_url":"https://api.github.com/users/osigida/gists{/gist_id}","starred_url":"https://api.github.com/users/osigida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osigida/subscriptions","organizations_url":"https://api.github.com/users/osigida/orgs","repos_url":"https://api.github.com/users/osigida/repos","events_url":"https://api.github.com/users/osigida/events{/privacy}","received_events_url":"https://api.github.com/users/osigida/received_events","type":"User","site_admin":false},"body":"We have few health checks in our application. and one of them is basic dead-lock threads.\r\nWhen this happens we have no choice than to restart the app.\r\nWe would like to automate it but we don't like to query all health checks and then parse the response, because it is useless to call all of them and bring some logic to the monitoring tool. Instead we would like to query individual check and act immediately if its failing.\r\n\r\nthanks to @ingwarsw  for sorting out unit-tests","created_at":"2016-04-12T08:07:11Z","updated_at":"2016-04-12T10:05:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df2993e0b03b18b7c2326f93256ba7c50d75049a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dropwizard/metrics/pulls/940/commits","review_comments_url":"https://api.github.com/repos/dropwizard/metrics/pulls/940/comments","review_comment_url":"https://api.github.com/repos/dropwizard/metrics/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dropwizard/metrics/issues/940/comments","statuses_url":"https://api.github.com/repos/dropwizard/metrics/statuses/bbf00a7fbc342103572b619210658c1fd46a2c4a","head":{"label":"osigida:individual-healthchecks-3-2","ref":"individual-healthchecks-3-2","sha":"bbf00a7fbc342103572b619210658c1fd46a2c4a","user":{"login":"osigida","id":6461608,"avatar_url":"https://avatars.githubusercontent.com/u/6461608?v=3","gravatar_id":"","url":"https://api.github.com/users/osigida","html_url":"https://github.com/osigida","followers_url":"https://api.github.com/users/osigida/followers","following_url":"https://api.github.com/users/osigida/following{/other_user}","gists_url":"https://api.github.com/users/osigida/gists{/gist_id}","starred_url":"https://api.github.com/users/osigida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osigida/subscriptions","organizations_url":"https://api.github.com/users/osigida/orgs","repos_url":"https://api.github.com/users/osigida/repos","events_url":"https://api.github.com/users/osigida/events{/privacy}","received_events_url":"https://api.github.com/users/osigida/received_events","type":"User","site_admin":false},"repo":{"id":46561718,"name":"metrics","full_name":"osigida/metrics","owner":{"login":"osigida","id":6461608,"avatar_url":"https://avatars.githubusercontent.com/u/6461608?v=3","gravatar_id":"","url":"https://api.github.com/users/osigida","html_url":"https://github.com/osigida","followers_url":"https://api.github.com/users/osigida/followers","following_url":"https://api.github.com/users/osigida/following{/other_user}","gists_url":"https://api.github.com/users/osigida/gists{/gist_id}","starred_url":"https://api.github.com/users/osigida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osigida/subscriptions","organizations_url":"https://api.github.com/users/osigida/orgs","repos_url":"https://api.github.com/users/osigida/repos","events_url":"https://api.github.com/users/osigida/events{/privacy}","received_events_url":"https://api.github.com/users/osigida/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/osigida/metrics","description":":chart_with_upwards_trend: Capturing JVM- and application-level metrics. So you know what's going on.","fork":true,"url":"https://api.github.com/repos/osigida/metrics","forks_url":"https://api.github.com/repos/osigida/metrics/forks","keys_url":"https://api.github.com/repos/osigida/metrics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/osigida/metrics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/osigida/metrics/teams","hooks_url":"https://api.github.com/repos/osigida/metrics/hooks","issue_events_url":"https://api.github.com/repos/osigida/metrics/issues/events{/number}","events_url":"https://api.github.com/repos/osigida/metrics/events","assignees_url":"https://api.github.com/repos/osigida/metrics/assignees{/user}","branches_url":"https://api.github.com/repos/osigida/metrics/branches{/branch}","tags_url":"https://api.github.com/repos/osigida/metrics/tags","blobs_url":"https://api.github.com/repos/osigida/metrics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/osigida/metrics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/osigida/metrics/git/refs{/sha}","trees_url":"https://api.github.com/repos/osigida/metrics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/osigida/metrics/statuses/{sha}","languages_url":"https://api.github.com/repos/osigida/metrics/languages","stargazers_url":"https://api.github.com/repos/osigida/metrics/stargazers","contributors_url":"https://api.github.com/repos/osigida/metrics/contributors","subscribers_url":"https://api.github.com/repos/osigida/metrics/subscribers","subscription_url":"https://api.github.com/repos/osigida/metrics/subscription","commits_url":"https://api.github.com/repos/osigida/metrics/commits{/sha}","git_commits_url":"https://api.github.com/repos/osigida/metrics/git/commits{/sha}","comments_url":"https://api.github.com/repos/osigida/metrics/comments{/number}","issue_comment_url":"https://api.github.com/repos/osigida/metrics/issues/comments{/number}","contents_url":"https://api.github.com/repos/osigida/metrics/contents/{+path}","compare_url":"https://api.github.com/repos/osigida/metrics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/osigida/metrics/merges","archive_url":"https://api.github.com/repos/osigida/metrics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/osigida/metrics/downloads","issues_url":"https://api.github.com/repos/osigida/metrics/issues{/number}","pulls_url":"https://api.github.com/repos/osigida/metrics/pulls{/number}","milestones_url":"https://api.github.com/repos/osigida/metrics/milestones{/number}","notifications_url":"https://api.github.com/repos/osigida/metrics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/osigida/metrics/labels{/name}","releases_url":"https://api.github.com/repos/osigida/metrics/releases{/id}","deployments_url":"https://api.github.com/repos/osigida/metrics/deployments","created_at":"2015-11-20T12:51:06Z","updated_at":"2015-11-20T12:51:08Z","pushed_at":"2016-04-12T08:06:07Z","git_url":"git://github.com/osigida/metrics.git","ssh_url":"git@github.com:osigida/metrics.git","clone_url":"https://github.com/osigida/metrics.git","svn_url":"https://github.com/osigida/metrics","homepage":"http://metrics.dropwizard.io","size":5768,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"dropwizard:3.2-development","ref":"3.2-development","sha":"dff1a69b3a0824ff445492777052ea0417b9c5cf","user":{"login":"dropwizard","id":5478557,"avatar_url":"https://avatars.githubusercontent.com/u/5478557?v=3","gravatar_id":"","url":"https://api.github.com/users/dropwizard","html_url":"https://github.com/dropwizard","followers_url":"https://api.github.com/users/dropwizard/followers","following_url":"https://api.github.com/users/dropwizard/following{/other_user}","gists_url":"https://api.github.com/users/dropwizard/gists{/gist_id}","starred_url":"https://api.github.com/users/dropwizard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dropwizard/subscriptions","organizations_url":"https://api.github.com/users/dropwizard/orgs","repos_url":"https://api.github.com/users/dropwizard/repos","events_url":"https://api.github.com/users/dropwizard/events{/privacy}","received_events_url":"https://api.github.com/users/dropwizard/received_events","type":"Organization","site_admin":false},"repo":{"id":537800,"name":"metrics","full_name":"dropwizard/metrics","owner":{"login":"dropwizard","id":5478557,"avatar_url":"https://avatars.githubusercontent.com/u/5478557?v=3","gravatar_id":"","url":"https://api.github.com/users/dropwizard","html_url":"https://github.com/dropwizard","followers_url":"https://api.github.com/users/dropwizard/followers","following_url":"https://api.github.com/users/dropwizard/following{/other_user}","gists_url":"https://api.github.com/users/dropwizard/gists{/gist_id}","starred_url":"https://api.github.com/users/dropwizard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dropwizard/subscriptions","organizations_url":"https://api.github.com/users/dropwizard/orgs","repos_url":"https://api.github.com/users/dropwizard/repos","events_url":"https://api.github.com/users/dropwizard/events{/privacy}","received_events_url":"https://api.github.com/users/dropwizard/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dropwizard/metrics","description":":chart_with_upwards_trend: Capturing JVM- and application-level metrics. So you know what's going on.","fork":false,"url":"https://api.github.com/repos/dropwizard/metrics","forks_url":"https://api.github.com/repos/dropwizard/metrics/forks","keys_url":"https://api.github.com/repos/dropwizard/metrics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dropwizard/metrics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dropwizard/metrics/teams","hooks_url":"https://api.github.com/repos/dropwizard/metrics/hooks","issue_events_url":"https://api.github.com/repos/dropwizard/metrics/issues/events{/number}","events_url":"https://api.github.com/repos/dropwizard/metrics/events","assignees_url":"https://api.github.com/repos/dropwizard/metrics/assignees{/user}","branches_url":"https://api.github.com/repos/dropwizard/metrics/branches{/branch}","tags_url":"https://api.github.com/repos/dropwizard/metrics/tags","blobs_url":"https://api.github.com/repos/dropwizard/metrics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dropwizard/metrics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dropwizard/metrics/git/refs{/sha}","trees_url":"https://api.github.com/repos/dropwizard/metrics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dropwizard/metrics/statuses/{sha}","languages_url":"https://api.github.com/repos/dropwizard/metrics/languages","stargazers_url":"https://api.github.com/repos/dropwizard/metrics/stargazers","contributors_url":"https://api.github.com/repos/dropwizard/metrics/contributors","subscribers_url":"https://api.github.com/repos/dropwizard/metrics/subscribers","subscription_url":"https://api.github.com/repos/dropwizard/metrics/subscription","commits_url":"https://api.github.com/repos/dropwizard/metrics/commits{/sha}","git_commits_url":"https://api.github.com/repos/dropwizard/metrics/git/commits{/sha}","comments_url":"https://api.github.com/repos/dropwizard/metrics/comments{/number}","issue_comment_url":"https://api.github.com/repos/dropwizard/metrics/issues/comments{/number}","contents_url":"https://api.github.com/repos/dropwizard/metrics/contents/{+path}","compare_url":"https://api.github.com/repos/dropwizard/metrics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dropwizard/metrics/merges","archive_url":"https://api.github.com/repos/dropwizard/metrics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dropwizard/metrics/downloads","issues_url":"https://api.github.com/repos/dropwizard/metrics/issues{/number}","pulls_url":"https://api.github.com/repos/dropwizard/metrics/pulls{/number}","milestones_url":"https://api.github.com/repos/dropwizard/metrics/milestones{/number}","notifications_url":"https://api.github.com/repos/dropwizard/metrics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dropwizard/metrics/labels{/name}","releases_url":"https://api.github.com/repos/dropwizard/metrics/releases{/id}","deployments_url":"https://api.github.com/repos/dropwizard/metrics/deployments","created_at":"2010-02-26T19:44:42Z","updated_at":"2016-04-12T04:54:23Z","pushed_at":"2016-04-12T08:07:11Z","git_url":"git://github.com/dropwizard/metrics.git","ssh_url":"git@github.com:dropwizard/metrics.git","clone_url":"https://github.com/dropwizard/metrics.git","svn_url":"https://github.com/dropwizard/metrics","homepage":"http://metrics.dropwizard.io","size":19460,"stargazers_count":3884,"watchers_count":3884,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1032,"mirror_url":null,"open_issues_count":121,"forks":1032,"open_issues":121,"watchers":3884,"default_branch":"3.1-maintenance"}},"_links":{"self":{"href":"https://api.github.com/repos/dropwizard/metrics/pulls/940"},"html":{"href":"https://github.com/dropwizard/metrics/pull/940"},"issue":{"href":"https://api.github.com/repos/dropwizard/metrics/issues/940"},"comments":{"href":"https://api.github.com/repos/dropwizard/metrics/issues/940/comments"},"review_comments":{"href":"https://api.github.com/repos/dropwizard/metrics/pulls/940/comments"},"review_comment":{"href":"https://api.github.com/repos/dropwizard/metrics/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dropwizard/metrics/pulls/940/commits"},"statuses":{"href":"https://api.github.com/repos/dropwizard/metrics/statuses/bbf00a7fbc342103572b619210658c1fd46a2c4a"}}}}