{"action":"created","comment":{"url":"https://api.github.com/repos/electronicarts/orbit/pulls/comments/32916921","id":32916921,"diff_hunk":"@@ -241,6 +246,18 @@ public void setMode(final StageMode mode)\n         hosting.start();\n         execution.start();\n \n+        try\n+        {\n+            Class.forName(\"com.ea.orbit.metrics.MetricsManager\"); //make sure the metrics manager is on the classpath.\n+\n+            MetricsManager.getInstance().initializeMetrics(metricsConfig);","path":"actors/stage/src/main/java/com/ea/orbit/actors/Stage.java","position":27,"original_position":27,"commit_id":"3142bf4b17b91139b4454f56777b26dff46590b6","original_commit_id":"3142bf4b17b91139b4454f56777b26dff46590b6","user":{"login":"johnou","id":323497,"avatar_url":"https://avatars.githubusercontent.com/u/323497?v=3","gravatar_id":"","url":"https://api.github.com/users/johnou","html_url":"https://github.com/johnou","followers_url":"https://api.github.com/users/johnou/followers","following_url":"https://api.github.com/users/johnou/following{/other_user}","gists_url":"https://api.github.com/users/johnou/gists{/gist_id}","starred_url":"https://api.github.com/users/johnou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnou/subscriptions","organizations_url":"https://api.github.com/users/johnou/orgs","repos_url":"https://api.github.com/users/johnou/repos","events_url":"https://api.github.com/users/johnou/events{/privacy}","received_events_url":"https://api.github.com/users/johnou/received_events","type":"User","site_admin":false},"body":"Unfortunately this isn't going to work, we cannot have imports for MetricsManager or reference it directly if you want the dependency to be optional, instead we'll need to use reflection to instantiate the manager.","created_at":"2015-06-22T09:18:44Z","updated_at":"2015-06-22T09:18:44Z","html_url":"https://github.com/electronicarts/orbit/pull/73#discussion_r32916921","pull_request_url":"https://api.github.com/repos/electronicarts/orbit/pulls/73","_links":{"self":{"href":"https://api.github.com/repos/electronicarts/orbit/pulls/comments/32916921"},"html":{"href":"https://github.com/electronicarts/orbit/pull/73#discussion_r32916921"},"pull_request":{"href":"https://api.github.com/repos/electronicarts/orbit/pulls/73"}}},"pull_request":{"url":"https://api.github.com/repos/electronicarts/orbit/pulls/73","id":38174896,"html_url":"https://github.com/electronicarts/orbit/pull/73","diff_url":"https://github.com/electronicarts/orbit/pull/73.diff","patch_url":"https://github.com/electronicarts/orbit/pull/73.patch","issue_url":"https://api.github.com/repos/electronicarts/orbit/issues/73","number":73,"state":"open","locked":false,"title":"Orbit Metrics Round 2","user":{"login":"FieldFlux","id":623899,"avatar_url":"https://avatars.githubusercontent.com/u/623899?v=3","gravatar_id":"","url":"https://api.github.com/users/FieldFlux","html_url":"https://github.com/FieldFlux","followers_url":"https://api.github.com/users/FieldFlux/followers","following_url":"https://api.github.com/users/FieldFlux/following{/other_user}","gists_url":"https://api.github.com/users/FieldFlux/gists{/gist_id}","starred_url":"https://api.github.com/users/FieldFlux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FieldFlux/subscriptions","organizations_url":"https://api.github.com/users/FieldFlux/orgs","repos_url":"https://api.github.com/users/FieldFlux/repos","events_url":"https://api.github.com/users/FieldFlux/events{/privacy}","received_events_url":"https://api.github.com/users/FieldFlux/received_events","type":"User","site_admin":false},"body":"This PR provides a wrapper around Dropwizard's metrics library.\r\n\r\nFields or Methods tagged with @ExportMetric can be registered to emit metrics to a variety of sources via Reporters. In this PR, wrappers are provided for emitting metrics to SL4J, JMX, Graphite, and Ganglia. Reporters can be configured via orbit.yaml like so:\r\n\r\n```\r\norbit.metrics.reporters:\r\n  - !!com.ea.orbit.metrics.config.Slf4jReporterConfig\r\n    period: 1\r\n    periodUnit: 'MINUTES'\r\n    prefix: 'chat.chat-backend'\r\n  - !!com.ea.orbit.metrics.config.JmxReporterConfig {}\r\n```\r\nStandard configuration management tools can be used to modify the prefix on a host-by-host manner when deploying by modifying this file. \r\n\r\nAn Orbit Container Module is provided to setup metrics on the JVM if actors is not being used. The Actors Module will also attempt to setup metrics. If Container is not being used, MetricsManager can be provided a set of ReporterConfig objects using the initializeMetrics() method. This should be done before Stage startup if actors is being used. \r\n\r\nMetrics must be registered using the MetricsManager registerExportedMetrics method. A instanceId may be provided so that instance metrics can be setup. \r\n\r\nMetrics must be uniquely named. Currently, metrics are named using the name of the class they are defined in plus the name provided via the ExportMetric annotation. For example a metric in ca.fieldflux.awesomeapp.neatclass with a field annotated with \r\n```\r\n@ExportMetric(name=\"coolmetric\")\r\n```\r\nwould generate a metric named: \r\n```\r\nca.fieldflux.awesomeapp.neatclass.coolmetric\r\n```\r\n\r\nInstance Metrics can be used where there may be more than one instance of a class and metrics must be tracked per-instance. To mark a metric as an instance metric use:\r\n```\r\n@ExportMetric(name=\"coolmetric\", isInstanceMetric=true)\r\n```\r\nand provide an instanceId when registering the object instance. This will insert an instance identifier into the metric name hierarchy like so:\r\n```\r\nca.fieldflux.awesomeapp.neatclass.instanceId.coolmetric\r\n```\r\n\r\nAn Actors lifetime extension is also provided so that Actors can expose metrics and have them automatically registered and unregistered on actor activation and deactivation respectively.","created_at":"2015-06-20T21:45:39Z","updated_at":"2015-06-22T09:18:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5f006a080e3bbe04d47883a3fdba224d2d748cc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/electronicarts/orbit/pulls/73/commits","review_comments_url":"https://api.github.com/repos/electronicarts/orbit/pulls/73/comments","review_comment_url":"https://api.github.com/repos/electronicarts/orbit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/electronicarts/orbit/issues/73/comments","statuses_url":"https://api.github.com/repos/electronicarts/orbit/statuses/3142bf4b17b91139b4454f56777b26dff46590b6","head":{"label":"FieldFlux:metricsredux","ref":"metricsredux","sha":"3142bf4b17b91139b4454f56777b26dff46590b6","user":{"login":"FieldFlux","id":623899,"avatar_url":"https://avatars.githubusercontent.com/u/623899?v=3","gravatar_id":"","url":"https://api.github.com/users/FieldFlux","html_url":"https://github.com/FieldFlux","followers_url":"https://api.github.com/users/FieldFlux/followers","following_url":"https://api.github.com/users/FieldFlux/following{/other_user}","gists_url":"https://api.github.com/users/FieldFlux/gists{/gist_id}","starred_url":"https://api.github.com/users/FieldFlux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FieldFlux/subscriptions","organizations_url":"https://api.github.com/users/FieldFlux/orgs","repos_url":"https://api.github.com/users/FieldFlux/repos","events_url":"https://api.github.com/users/FieldFlux/events{/privacy}","received_events_url":"https://api.github.com/users/FieldFlux/received_events","type":"User","site_admin":false},"repo":{"id":33753137,"name":"orbit","full_name":"FieldFlux/orbit","owner":{"login":"FieldFlux","id":623899,"avatar_url":"https://avatars.githubusercontent.com/u/623899?v=3","gravatar_id":"","url":"https://api.github.com/users/FieldFlux","html_url":"https://github.com/FieldFlux","followers_url":"https://api.github.com/users/FieldFlux/followers","following_url":"https://api.github.com/users/FieldFlux/following{/other_user}","gists_url":"https://api.github.com/users/FieldFlux/gists{/gist_id}","starred_url":"https://api.github.com/users/FieldFlux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FieldFlux/subscriptions","organizations_url":"https://api.github.com/users/FieldFlux/orgs","repos_url":"https://api.github.com/users/FieldFlux/repos","events_url":"https://api.github.com/users/FieldFlux/events{/privacy}","received_events_url":"https://api.github.com/users/FieldFlux/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/FieldFlux/orbit","description":"Orbit - Build distributed and scalable online services","fork":true,"url":"https://api.github.com/repos/FieldFlux/orbit","forks_url":"https://api.github.com/repos/FieldFlux/orbit/forks","keys_url":"https://api.github.com/repos/FieldFlux/orbit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FieldFlux/orbit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FieldFlux/orbit/teams","hooks_url":"https://api.github.com/repos/FieldFlux/orbit/hooks","issue_events_url":"https://api.github.com/repos/FieldFlux/orbit/issues/events{/number}","events_url":"https://api.github.com/repos/FieldFlux/orbit/events","assignees_url":"https://api.github.com/repos/FieldFlux/orbit/assignees{/user}","branches_url":"https://api.github.com/repos/FieldFlux/orbit/branches{/branch}","tags_url":"https://api.github.com/repos/FieldFlux/orbit/tags","blobs_url":"https://api.github.com/repos/FieldFlux/orbit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FieldFlux/orbit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FieldFlux/orbit/git/refs{/sha}","trees_url":"https://api.github.com/repos/FieldFlux/orbit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FieldFlux/orbit/statuses/{sha}","languages_url":"https://api.github.com/repos/FieldFlux/orbit/languages","stargazers_url":"https://api.github.com/repos/FieldFlux/orbit/stargazers","contributors_url":"https://api.github.com/repos/FieldFlux/orbit/contributors","subscribers_url":"https://api.github.com/repos/FieldFlux/orbit/subscribers","subscription_url":"https://api.github.com/repos/FieldFlux/orbit/subscription","commits_url":"https://api.github.com/repos/FieldFlux/orbit/commits{/sha}","git_commits_url":"https://api.github.com/repos/FieldFlux/orbit/git/commits{/sha}","comments_url":"https://api.github.com/repos/FieldFlux/orbit/comments{/number}","issue_comment_url":"https://api.github.com/repos/FieldFlux/orbit/issues/comments{/number}","contents_url":"https://api.github.com/repos/FieldFlux/orbit/contents/{+path}","compare_url":"https://api.github.com/repos/FieldFlux/orbit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FieldFlux/orbit/merges","archive_url":"https://api.github.com/repos/FieldFlux/orbit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FieldFlux/orbit/downloads","issues_url":"https://api.github.com/repos/FieldFlux/orbit/issues{/number}","pulls_url":"https://api.github.com/repos/FieldFlux/orbit/pulls{/number}","milestones_url":"https://api.github.com/repos/FieldFlux/orbit/milestones{/number}","notifications_url":"https://api.github.com/repos/FieldFlux/orbit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FieldFlux/orbit/labels{/name}","releases_url":"https://api.github.com/repos/FieldFlux/orbit/releases{/id}","created_at":"2015-04-10T22:14:43Z","updated_at":"2015-04-20T01:39:57Z","pushed_at":"2015-06-20T21:23:11Z","git_url":"git://github.com/FieldFlux/orbit.git","ssh_url":"git@github.com:FieldFlux/orbit.git","clone_url":"https://github.com/FieldFlux/orbit.git","svn_url":"https://github.com/FieldFlux/orbit","homepage":"http://orbit.bioware.com/","size":3136,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"electronicarts:master","ref":"master","sha":"22cf4d681df2442c5aa6a0a751f3690b5f942f67","user":{"login":"electronicarts","id":1637638,"avatar_url":"https://avatars.githubusercontent.com/u/1637638?v=3","gravatar_id":"","url":"https://api.github.com/users/electronicarts","html_url":"https://github.com/electronicarts","followers_url":"https://api.github.com/users/electronicarts/followers","following_url":"https://api.github.com/users/electronicarts/following{/other_user}","gists_url":"https://api.github.com/users/electronicarts/gists{/gist_id}","starred_url":"https://api.github.com/users/electronicarts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electronicarts/subscriptions","organizations_url":"https://api.github.com/users/electronicarts/orgs","repos_url":"https://api.github.com/users/electronicarts/repos","events_url":"https://api.github.com/users/electronicarts/events{/privacy}","received_events_url":"https://api.github.com/users/electronicarts/received_events","type":"Organization","site_admin":false},"repo":{"id":32951609,"name":"orbit","full_name":"electronicarts/orbit","owner":{"login":"electronicarts","id":1637638,"avatar_url":"https://avatars.githubusercontent.com/u/1637638?v=3","gravatar_id":"","url":"https://api.github.com/users/electronicarts","html_url":"https://github.com/electronicarts","followers_url":"https://api.github.com/users/electronicarts/followers","following_url":"https://api.github.com/users/electronicarts/following{/other_user}","gists_url":"https://api.github.com/users/electronicarts/gists{/gist_id}","starred_url":"https://api.github.com/users/electronicarts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electronicarts/subscriptions","organizations_url":"https://api.github.com/users/electronicarts/orgs","repos_url":"https://api.github.com/users/electronicarts/repos","events_url":"https://api.github.com/users/electronicarts/events{/privacy}","received_events_url":"https://api.github.com/users/electronicarts/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/electronicarts/orbit","description":"Orbit - Build distributed and scalable online services","fork":false,"url":"https://api.github.com/repos/electronicarts/orbit","forks_url":"https://api.github.com/repos/electronicarts/orbit/forks","keys_url":"https://api.github.com/repos/electronicarts/orbit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electronicarts/orbit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electronicarts/orbit/teams","hooks_url":"https://api.github.com/repos/electronicarts/orbit/hooks","issue_events_url":"https://api.github.com/repos/electronicarts/orbit/issues/events{/number}","events_url":"https://api.github.com/repos/electronicarts/orbit/events","assignees_url":"https://api.github.com/repos/electronicarts/orbit/assignees{/user}","branches_url":"https://api.github.com/repos/electronicarts/orbit/branches{/branch}","tags_url":"https://api.github.com/repos/electronicarts/orbit/tags","blobs_url":"https://api.github.com/repos/electronicarts/orbit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electronicarts/orbit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electronicarts/orbit/git/refs{/sha}","trees_url":"https://api.github.com/repos/electronicarts/orbit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electronicarts/orbit/statuses/{sha}","languages_url":"https://api.github.com/repos/electronicarts/orbit/languages","stargazers_url":"https://api.github.com/repos/electronicarts/orbit/stargazers","contributors_url":"https://api.github.com/repos/electronicarts/orbit/contributors","subscribers_url":"https://api.github.com/repos/electronicarts/orbit/subscribers","subscription_url":"https://api.github.com/repos/electronicarts/orbit/subscription","commits_url":"https://api.github.com/repos/electronicarts/orbit/commits{/sha}","git_commits_url":"https://api.github.com/repos/electronicarts/orbit/git/commits{/sha}","comments_url":"https://api.github.com/repos/electronicarts/orbit/comments{/number}","issue_comment_url":"https://api.github.com/repos/electronicarts/orbit/issues/comments{/number}","contents_url":"https://api.github.com/repos/electronicarts/orbit/contents/{+path}","compare_url":"https://api.github.com/repos/electronicarts/orbit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electronicarts/orbit/merges","archive_url":"https://api.github.com/repos/electronicarts/orbit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electronicarts/orbit/downloads","issues_url":"https://api.github.com/repos/electronicarts/orbit/issues{/number}","pulls_url":"https://api.github.com/repos/electronicarts/orbit/pulls{/number}","milestones_url":"https://api.github.com/repos/electronicarts/orbit/milestones{/number}","notifications_url":"https://api.github.com/repos/electronicarts/orbit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electronicarts/orbit/labels{/name}","releases_url":"https://api.github.com/repos/electronicarts/orbit/releases{/id}","created_at":"2015-03-26T20:59:23Z","updated_at":"2015-06-16T13:32:14Z","pushed_at":"2015-06-20T21:45:40Z","git_url":"git://github.com/electronicarts/orbit.git","ssh_url":"git@github.com:electronicarts/orbit.git","clone_url":"https://github.com/electronicarts/orbit.git","svn_url":"https://github.com/electronicarts/orbit","homepage":"http://orbit.bioware.com/","size":5486,"stargazers_count":740,"watchers_count":740,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":60,"mirror_url":null,"open_issues_count":1,"forks":60,"open_issues":1,"watchers":740,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/electronicarts/orbit/pulls/73"},"html":{"href":"https://github.com/electronicarts/orbit/pull/73"},"issue":{"href":"https://api.github.com/repos/electronicarts/orbit/issues/73"},"comments":{"href":"https://api.github.com/repos/electronicarts/orbit/issues/73/comments"},"review_comments":{"href":"https://api.github.com/repos/electronicarts/orbit/pulls/73/comments"},"review_comment":{"href":"https://api.github.com/repos/electronicarts/orbit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/electronicarts/orbit/pulls/73/commits"},"statuses":{"href":"https://api.github.com/repos/electronicarts/orbit/statuses/3142bf4b17b91139b4454f56777b26dff46590b6"}}}}