{"action":"created","comment":{"url":"https://api.github.com/repos/PagerDuty/eris-pd/pulls/comments/75885833","id":75885833,"diff_hunk":"@@ -20,10 +20,16 @@ class ErisPdSettings(config: Config = ConfigFactory.load()) {\n   /**\n    * Metrics implementation to use.\n    */\n-  val metrics: Metrics = {\n-    val metricsName: String = libConfig.getString(\"metricsClass\")\n-    val clazz = Class.forName(metricsName)\n-    clazz.newInstance().asInstanceOf[Metrics]\n+  val metrics: Metrics = metricsImpl match {\n+    case Some(metrics) =>\n+      // if an implementation was provided in the constructor, use that\n+      metrics\n+    case None =>","path":"src/main/scala/com/pagerduty/eris/custom/ErisPdSettings.scala","position":21,"original_position":21,"commit_id":"95ee2cc90d8bd41e3e7915df19f6378ca86fe46c","original_commit_id":"95ee2cc90d8bd41e3e7915df19f6378ca86fe46c","user":{"login":"cdegroot","id":84811,"avatar_url":"https://avatars.githubusercontent.com/u/84811?v=3","gravatar_id":"","url":"https://api.github.com/users/cdegroot","html_url":"https://github.com/cdegroot","followers_url":"https://api.github.com/users/cdegroot/followers","following_url":"https://api.github.com/users/cdegroot/following{/other_user}","gists_url":"https://api.github.com/users/cdegroot/gists{/gist_id}","starred_url":"https://api.github.com/users/cdegroot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdegroot/subscriptions","organizations_url":"https://api.github.com/users/cdegroot/orgs","repos_url":"https://api.github.com/users/cdegroot/repos","events_url":"https://api.github.com/users/cdegroot/events{/privacy}","received_events_url":"https://api.github.com/users/cdegroot/received_events","type":"User","site_admin":false},"body":"Given that there's only scheduler/apollo involved here and this is new code, I'd drop this clause (or throw an error, or log a warning and emit NullMetrics - there's nothing to be backwards compatible with)","created_at":"2016-08-23T15:06:19Z","updated_at":"2016-08-23T15:06:19Z","html_url":"https://github.com/PagerDuty/eris-pd/pull/30#discussion_r75885833","pull_request_url":"https://api.github.com/repos/PagerDuty/eris-pd/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/PagerDuty/eris-pd/pulls/comments/75885833"},"html":{"href":"https://github.com/PagerDuty/eris-pd/pull/30#discussion_r75885833"},"pull_request":{"href":"https://api.github.com/repos/PagerDuty/eris-pd/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/PagerDuty/eris-pd/pulls/30","id":82381755,"html_url":"https://github.com/PagerDuty/eris-pd/pull/30","diff_url":"https://github.com/PagerDuty/eris-pd/pull/30.diff","patch_url":"https://github.com/PagerDuty/eris-pd/pull/30.patch","issue_url":"https://api.github.com/repos/PagerDuty/eris-pd/issues/30","number":30,"state":"open","locked":false,"title":"Allow ErisPdSettings to take a Metrics instance in the constructor.","user":{"login":"DWvanGeest","id":947530,"avatar_url":"https://avatars.githubusercontent.com/u/947530?v=3","gravatar_id":"","url":"https://api.github.com/users/DWvanGeest","html_url":"https://github.com/DWvanGeest","followers_url":"https://api.github.com/users/DWvanGeest/followers","following_url":"https://api.github.com/users/DWvanGeest/following{/other_user}","gists_url":"https://api.github.com/users/DWvanGeest/gists{/gist_id}","starred_url":"https://api.github.com/users/DWvanGeest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DWvanGeest/subscriptions","organizations_url":"https://api.github.com/users/DWvanGeest/orgs","repos_url":"https://api.github.com/users/DWvanGeest/repos","events_url":"https://api.github.com/users/DWvanGeest/events{/privacy}","received_events_url":"https://api.github.com/users/DWvanGeest/received_events","type":"User","site_admin":false},"body":"`DogstatsdMetrics` doesn't have a no-arg constructor, so instantiating it via settings and reflection will be tricky.\r\n\r\nTo get around this, allow `ErisPdSettings` to take an optional `Metrics` instance as a constructor arg. If this arg is passed, `ErisPdSettings` will just use that instead of the reflection/settings business.","created_at":"2016-08-23T15:01:06Z","updated_at":"2016-08-23T15:06:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fbf3108f7e5769aa22daa7999c067cd87dd5a34b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/PagerDuty/eris-pd/pulls/30/commits","review_comments_url":"https://api.github.com/repos/PagerDuty/eris-pd/pulls/30/comments","review_comment_url":"https://api.github.com/repos/PagerDuty/eris-pd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PagerDuty/eris-pd/issues/30/comments","statuses_url":"https://api.github.com/repos/PagerDuty/eris-pd/statuses/95ee2cc90d8bd41e3e7915df19f6378ca86fe46c","head":{"label":"PagerDuty:CORE-950-dogstatsd-metrics","ref":"CORE-950-dogstatsd-metrics","sha":"95ee2cc90d8bd41e3e7915df19f6378ca86fe46c","user":{"login":"PagerDuty","id":766800,"avatar_url":"https://avatars.githubusercontent.com/u/766800?v=3","gravatar_id":"","url":"https://api.github.com/users/PagerDuty","html_url":"https://github.com/PagerDuty","followers_url":"https://api.github.com/users/PagerDuty/followers","following_url":"https://api.github.com/users/PagerDuty/following{/other_user}","gists_url":"https://api.github.com/users/PagerDuty/gists{/gist_id}","starred_url":"https://api.github.com/users/PagerDuty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PagerDuty/subscriptions","organizations_url":"https://api.github.com/users/PagerDuty/orgs","repos_url":"https://api.github.com/users/PagerDuty/repos","events_url":"https://api.github.com/users/PagerDuty/events{/privacy}","received_events_url":"https://api.github.com/users/PagerDuty/received_events","type":"Organization","site_admin":false},"repo":{"id":39032201,"name":"eris-pd","full_name":"PagerDuty/eris-pd","owner":{"login":"PagerDuty","id":766800,"avatar_url":"https://avatars.githubusercontent.com/u/766800?v=3","gravatar_id":"","url":"https://api.github.com/users/PagerDuty","html_url":"https://github.com/PagerDuty","followers_url":"https://api.github.com/users/PagerDuty/followers","following_url":"https://api.github.com/users/PagerDuty/following{/other_user}","gists_url":"https://api.github.com/users/PagerDuty/gists{/gist_id}","starred_url":"https://api.github.com/users/PagerDuty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PagerDuty/subscriptions","organizations_url":"https://api.github.com/users/PagerDuty/orgs","repos_url":"https://api.github.com/users/PagerDuty/repos","events_url":"https://api.github.com/users/PagerDuty/events{/privacy}","received_events_url":"https://api.github.com/users/PagerDuty/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PagerDuty/eris-pd","description":null,"fork":false,"url":"https://api.github.com/repos/PagerDuty/eris-pd","forks_url":"https://api.github.com/repos/PagerDuty/eris-pd/forks","keys_url":"https://api.github.com/repos/PagerDuty/eris-pd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PagerDuty/eris-pd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PagerDuty/eris-pd/teams","hooks_url":"https://api.github.com/repos/PagerDuty/eris-pd/hooks","issue_events_url":"https://api.github.com/repos/PagerDuty/eris-pd/issues/events{/number}","events_url":"https://api.github.com/repos/PagerDuty/eris-pd/events","assignees_url":"https://api.github.com/repos/PagerDuty/eris-pd/assignees{/user}","branches_url":"https://api.github.com/repos/PagerDuty/eris-pd/branches{/branch}","tags_url":"https://api.github.com/repos/PagerDuty/eris-pd/tags","blobs_url":"https://api.github.com/repos/PagerDuty/eris-pd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PagerDuty/eris-pd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PagerDuty/eris-pd/git/refs{/sha}","trees_url":"https://api.github.com/repos/PagerDuty/eris-pd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PagerDuty/eris-pd/statuses/{sha}","languages_url":"https://api.github.com/repos/PagerDuty/eris-pd/languages","stargazers_url":"https://api.github.com/repos/PagerDuty/eris-pd/stargazers","contributors_url":"https://api.github.com/repos/PagerDuty/eris-pd/contributors","subscribers_url":"https://api.github.com/repos/PagerDuty/eris-pd/subscribers","subscription_url":"https://api.github.com/repos/PagerDuty/eris-pd/subscription","commits_url":"https://api.github.com/repos/PagerDuty/eris-pd/commits{/sha}","git_commits_url":"https://api.github.com/repos/PagerDuty/eris-pd/git/commits{/sha}","comments_url":"https://api.github.com/repos/PagerDuty/eris-pd/comments{/number}","issue_comment_url":"https://api.github.com/repos/PagerDuty/eris-pd/issues/comments{/number}","contents_url":"https://api.github.com/repos/PagerDuty/eris-pd/contents/{+path}","compare_url":"https://api.github.com/repos/PagerDuty/eris-pd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PagerDuty/eris-pd/merges","archive_url":"https://api.github.com/repos/PagerDuty/eris-pd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PagerDuty/eris-pd/downloads","issues_url":"https://api.github.com/repos/PagerDuty/eris-pd/issues{/number}","pulls_url":"https://api.github.com/repos/PagerDuty/eris-pd/pulls{/number}","milestones_url":"https://api.github.com/repos/PagerDuty/eris-pd/milestones{/number}","notifications_url":"https://api.github.com/repos/PagerDuty/eris-pd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PagerDuty/eris-pd/labels{/name}","releases_url":"https://api.github.com/repos/PagerDuty/eris-pd/releases{/id}","deployments_url":"https://api.github.com/repos/PagerDuty/eris-pd/deployments","created_at":"2015-07-13T19:15:53Z","updated_at":"2016-08-04T16:16:09Z","pushed_at":"2016-08-23T15:01:06Z","git_url":"git://github.com/PagerDuty/eris-pd.git","ssh_url":"git@github.com:PagerDuty/eris-pd.git","clone_url":"https://github.com/PagerDuty/eris-pd.git","svn_url":"https://github.com/PagerDuty/eris-pd","homepage":null,"size":106,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"PagerDuty:master","ref":"master","sha":"58ea865f9b232ddb04e851ebab25503f58042907","user":{"login":"PagerDuty","id":766800,"avatar_url":"https://avatars.githubusercontent.com/u/766800?v=3","gravatar_id":"","url":"https://api.github.com/users/PagerDuty","html_url":"https://github.com/PagerDuty","followers_url":"https://api.github.com/users/PagerDuty/followers","following_url":"https://api.github.com/users/PagerDuty/following{/other_user}","gists_url":"https://api.github.com/users/PagerDuty/gists{/gist_id}","starred_url":"https://api.github.com/users/PagerDuty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PagerDuty/subscriptions","organizations_url":"https://api.github.com/users/PagerDuty/orgs","repos_url":"https://api.github.com/users/PagerDuty/repos","events_url":"https://api.github.com/users/PagerDuty/events{/privacy}","received_events_url":"https://api.github.com/users/PagerDuty/received_events","type":"Organization","site_admin":false},"repo":{"id":39032201,"name":"eris-pd","full_name":"PagerDuty/eris-pd","owner":{"login":"PagerDuty","id":766800,"avatar_url":"https://avatars.githubusercontent.com/u/766800?v=3","gravatar_id":"","url":"https://api.github.com/users/PagerDuty","html_url":"https://github.com/PagerDuty","followers_url":"https://api.github.com/users/PagerDuty/followers","following_url":"https://api.github.com/users/PagerDuty/following{/other_user}","gists_url":"https://api.github.com/users/PagerDuty/gists{/gist_id}","starred_url":"https://api.github.com/users/PagerDuty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PagerDuty/subscriptions","organizations_url":"https://api.github.com/users/PagerDuty/orgs","repos_url":"https://api.github.com/users/PagerDuty/repos","events_url":"https://api.github.com/users/PagerDuty/events{/privacy}","received_events_url":"https://api.github.com/users/PagerDuty/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PagerDuty/eris-pd","description":null,"fork":false,"url":"https://api.github.com/repos/PagerDuty/eris-pd","forks_url":"https://api.github.com/repos/PagerDuty/eris-pd/forks","keys_url":"https://api.github.com/repos/PagerDuty/eris-pd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PagerDuty/eris-pd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PagerDuty/eris-pd/teams","hooks_url":"https://api.github.com/repos/PagerDuty/eris-pd/hooks","issue_events_url":"https://api.github.com/repos/PagerDuty/eris-pd/issues/events{/number}","events_url":"https://api.github.com/repos/PagerDuty/eris-pd/events","assignees_url":"https://api.github.com/repos/PagerDuty/eris-pd/assignees{/user}","branches_url":"https://api.github.com/repos/PagerDuty/eris-pd/branches{/branch}","tags_url":"https://api.github.com/repos/PagerDuty/eris-pd/tags","blobs_url":"https://api.github.com/repos/PagerDuty/eris-pd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PagerDuty/eris-pd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PagerDuty/eris-pd/git/refs{/sha}","trees_url":"https://api.github.com/repos/PagerDuty/eris-pd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PagerDuty/eris-pd/statuses/{sha}","languages_url":"https://api.github.com/repos/PagerDuty/eris-pd/languages","stargazers_url":"https://api.github.com/repos/PagerDuty/eris-pd/stargazers","contributors_url":"https://api.github.com/repos/PagerDuty/eris-pd/contributors","subscribers_url":"https://api.github.com/repos/PagerDuty/eris-pd/subscribers","subscription_url":"https://api.github.com/repos/PagerDuty/eris-pd/subscription","commits_url":"https://api.github.com/repos/PagerDuty/eris-pd/commits{/sha}","git_commits_url":"https://api.github.com/repos/PagerDuty/eris-pd/git/commits{/sha}","comments_url":"https://api.github.com/repos/PagerDuty/eris-pd/comments{/number}","issue_comment_url":"https://api.github.com/repos/PagerDuty/eris-pd/issues/comments{/number}","contents_url":"https://api.github.com/repos/PagerDuty/eris-pd/contents/{+path}","compare_url":"https://api.github.com/repos/PagerDuty/eris-pd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PagerDuty/eris-pd/merges","archive_url":"https://api.github.com/repos/PagerDuty/eris-pd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PagerDuty/eris-pd/downloads","issues_url":"https://api.github.com/repos/PagerDuty/eris-pd/issues{/number}","pulls_url":"https://api.github.com/repos/PagerDuty/eris-pd/pulls{/number}","milestones_url":"https://api.github.com/repos/PagerDuty/eris-pd/milestones{/number}","notifications_url":"https://api.github.com/repos/PagerDuty/eris-pd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PagerDuty/eris-pd/labels{/name}","releases_url":"https://api.github.com/repos/PagerDuty/eris-pd/releases{/id}","deployments_url":"https://api.github.com/repos/PagerDuty/eris-pd/deployments","created_at":"2015-07-13T19:15:53Z","updated_at":"2016-08-04T16:16:09Z","pushed_at":"2016-08-23T15:01:06Z","git_url":"git://github.com/PagerDuty/eris-pd.git","ssh_url":"git@github.com:PagerDuty/eris-pd.git","clone_url":"https://github.com/PagerDuty/eris-pd.git","svn_url":"https://github.com/PagerDuty/eris-pd","homepage":null,"size":106,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PagerDuty/eris-pd/pulls/30"},"html":{"href":"https://github.com/PagerDuty/eris-pd/pull/30"},"issue":{"href":"https://api.github.com/repos/PagerDuty/eris-pd/issues/30"},"comments":{"href":"https://api.github.com/repos/PagerDuty/eris-pd/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/PagerDuty/eris-pd/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/PagerDuty/eris-pd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PagerDuty/eris-pd/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/PagerDuty/eris-pd/statuses/95ee2cc90d8bd41e3e7915df19f6378ca86fe46c"}}}}
{"actor":{"display_login":"cdegroot"}}