{"action":"created","comment":{"url":"https://api.github.com/repos/linagora/james-project/pulls/comments/239391869","pull_request_review_id":182160255,"id":239391869,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTM5MTg2OQ==","diff_hunk":"@@ -36,7 +41,16 @@ public DropWizardGaugeRegistry(MetricRegistry metricRegistry) {\n \n     @Override\n     public <T> GaugeRegistry register(String name, Gauge<T> gauge) {\n-        metricRegistry.gauge(name, () -> gauge::get);\n+        metricRegistry.gauge(name, () -> toCachedGauge(gauge));\n         return this;\n     }\n+\n+    private <T> CachedGauge<T> toCachedGauge(Gauge<T> gauge) {","path":"metrics/metrics-dropwizard/src/main/java/org/apache/james/metrics/dropwizard/DropWizardGaugeRegistry.java","position":56,"original_position":29,"commit_id":"d26c24af2ec053c4316a83ea7c53a697298d6bcd","original_commit_id":"cad4f9d5d8f1e8e325070fa4d2a8c5b66c19f420","user":{"login":"rouazana","id":1398581,"node_id":"MDQ6VXNlcjEzOTg1ODE=","avatar_url":"https://avatars0.githubusercontent.com/u/1398581?v=4","gravatar_id":"","url":"https://api.github.com/users/rouazana","html_url":"https://github.com/rouazana","followers_url":"https://api.github.com/users/rouazana/followers","following_url":"https://api.github.com/users/rouazana/following{/other_user}","gists_url":"https://api.github.com/users/rouazana/gists{/gist_id}","starred_url":"https://api.github.com/users/rouazana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rouazana/subscriptions","organizations_url":"https://api.github.com/users/rouazana/orgs","repos_url":"https://api.github.com/users/rouazana/repos","events_url":"https://api.github.com/users/rouazana/events{/privacy}","received_events_url":"https://api.github.com/users/rouazana/received_events","type":"User","site_admin":false},"body":"The goal is to circumvent an issue with es-reporter making it reading the gauge twice (first is a null check, second is a jackson serialization).\r\nMaybe we should better find a way to fix the 2 reads. ","created_at":"2018-12-06T10:02:47Z","updated_at":"2018-12-06T10:04:38Z","html_url":"https://github.com/linagora/james-project/pull/2005#discussion_r239391869","pull_request_url":"https://api.github.com/repos/linagora/james-project/pulls/2005","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/linagora/james-project/pulls/comments/239391869"},"html":{"href":"https://github.com/linagora/james-project/pull/2005#discussion_r239391869"},"pull_request":{"href":"https://api.github.com/repos/linagora/james-project/pulls/2005"}},"in_reply_to_id":239371477},"pull_request":{"url":"https://api.github.com/repos/linagora/james-project/pulls/2005","id":236431138,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2NDMxMTM4","html_url":"https://github.com/linagora/james-project/pull/2005","diff_url":"https://github.com/linagora/james-project/pull/2005.diff","patch_url":"https://github.com/linagora/james-project/pull/2005.patch","issue_url":"https://api.github.com/repos/linagora/james-project/issues/2005","number":2005,"state":"open","locked":false,"title":"JAMES-2550 Avoid double MailQueue size computation upon metric reporting","user":{"login":"chibenwa","id":6928740,"node_id":"MDQ6VXNlcjY5Mjg3NDA=","avatar_url":"https://avatars1.githubusercontent.com/u/6928740?v=4","gravatar_id":"","url":"https://api.github.com/users/chibenwa","html_url":"https://github.com/chibenwa","followers_url":"https://api.github.com/users/chibenwa/followers","following_url":"https://api.github.com/users/chibenwa/following{/other_user}","gists_url":"https://api.github.com/users/chibenwa/gists{/gist_id}","starred_url":"https://api.github.com/users/chibenwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chibenwa/subscriptions","organizations_url":"https://api.github.com/users/chibenwa/orgs","repos_url":"https://api.github.com/users/chibenwa/repos","events_url":"https://api.github.com/users/chibenwa/events{/privacy}","received_events_url":"https://api.github.com/users/chibenwa/received_events","type":"User","site_admin":false},"body":"This computation is expensive and should be avoided.\r\n\r\nReporters tend to check nullity of gauges before reporting them. 10s cache is enough to avoid this double computation while avoiding affecting metrics normal collection.","created_at":"2018-12-06T07:22:20Z","updated_at":"2018-12-06T10:04:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"702374a0ef8ab37fd9903ba615a3d8bb459b2a76","assignee":{"login":"chibenwa","id":6928740,"node_id":"MDQ6VXNlcjY5Mjg3NDA=","avatar_url":"https://avatars1.githubusercontent.com/u/6928740?v=4","gravatar_id":"","url":"https://api.github.com/users/chibenwa","html_url":"https://github.com/chibenwa","followers_url":"https://api.github.com/users/chibenwa/followers","following_url":"https://api.github.com/users/chibenwa/following{/other_user}","gists_url":"https://api.github.com/users/chibenwa/gists{/gist_id}","starred_url":"https://api.github.com/users/chibenwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chibenwa/subscriptions","organizations_url":"https://api.github.com/users/chibenwa/orgs","repos_url":"https://api.github.com/users/chibenwa/repos","events_url":"https://api.github.com/users/chibenwa/events{/privacy}","received_events_url":"https://api.github.com/users/chibenwa/received_events","type":"User","site_admin":false},"assignees":[{"login":"chibenwa","id":6928740,"node_id":"MDQ6VXNlcjY5Mjg3NDA=","avatar_url":"https://avatars1.githubusercontent.com/u/6928740?v=4","gravatar_id":"","url":"https://api.github.com/users/chibenwa","html_url":"https://github.com/chibenwa","followers_url":"https://api.github.com/users/chibenwa/followers","following_url":"https://api.github.com/users/chibenwa/following{/other_user}","gists_url":"https://api.github.com/users/chibenwa/gists{/gist_id}","starred_url":"https://api.github.com/users/chibenwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chibenwa/subscriptions","organizations_url":"https://api.github.com/users/chibenwa/orgs","repos_url":"https://api.github.com/users/chibenwa/repos","events_url":"https://api.github.com/users/chibenwa/events{/privacy}","received_events_url":"https://api.github.com/users/chibenwa/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1136216526,"node_id":"MDU6TGFiZWwxMTM2MjE2NTI2","url":"https://api.github.com/repos/linagora/james-project/labels/perf","name":"perf","color":"FFFF00","default":false}],"milestone":{"url":"https://api.github.com/repos/linagora/james-project/milestones/12","html_url":"https://github.com/linagora/james-project/milestone/12","labels_url":"https://api.github.com/repos/linagora/james-project/milestones/12/labels","id":3831326,"node_id":"MDk6TWlsZXN0b25lMzgzMTMyNg==","number":12,"title":"Sprint 1 - Robusta beans","description":"","creator":{"login":"chibenwa","id":6928740,"node_id":"MDQ6VXNlcjY5Mjg3NDA=","avatar_url":"https://avatars1.githubusercontent.com/u/6928740?v=4","gravatar_id":"","url":"https://api.github.com/users/chibenwa","html_url":"https://github.com/chibenwa","followers_url":"https://api.github.com/users/chibenwa/followers","following_url":"https://api.github.com/users/chibenwa/following{/other_user}","gists_url":"https://api.github.com/users/chibenwa/gists{/gist_id}","starred_url":"https://api.github.com/users/chibenwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chibenwa/subscriptions","organizations_url":"https://api.github.com/users/chibenwa/orgs","repos_url":"https://api.github.com/users/chibenwa/repos","events_url":"https://api.github.com/users/chibenwa/events{/privacy}","received_events_url":"https://api.github.com/users/chibenwa/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":53,"state":"open","created_at":"2018-11-19T12:11:40Z","updated_at":"2018-12-06T08:25:02Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/linagora/james-project/pulls/2005/commits","review_comments_url":"https://api.github.com/repos/linagora/james-project/pulls/2005/comments","review_comment_url":"https://api.github.com/repos/linagora/james-project/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linagora/james-project/issues/2005/comments","statuses_url":"https://api.github.com/repos/linagora/james-project/statuses/d26c24af2ec053c4316a83ea7c53a697298d6bcd","head":{"label":"chibenwa:JAMES-2550-cached-gauge","ref":"JAMES-2550-cached-gauge","sha":"d26c24af2ec053c4316a83ea7c53a697298d6bcd","user":{"login":"chibenwa","id":6928740,"node_id":"MDQ6VXNlcjY5Mjg3NDA=","avatar_url":"https://avatars1.githubusercontent.com/u/6928740?v=4","gravatar_id":"","url":"https://api.github.com/users/chibenwa","html_url":"https://github.com/chibenwa","followers_url":"https://api.github.com/users/chibenwa/followers","following_url":"https://api.github.com/users/chibenwa/following{/other_user}","gists_url":"https://api.github.com/users/chibenwa/gists{/gist_id}","starred_url":"https://api.github.com/users/chibenwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chibenwa/subscriptions","organizations_url":"https://api.github.com/users/chibenwa/orgs","repos_url":"https://api.github.com/users/chibenwa/repos","events_url":"https://api.github.com/users/chibenwa/events{/privacy}","received_events_url":"https://api.github.com/users/chibenwa/received_events","type":"User","site_admin":false},"repo":{"id":42459504,"node_id":"MDEwOlJlcG9zaXRvcnk0MjQ1OTUwNA==","name":"james-project","full_name":"chibenwa/james-project","private":false,"owner":{"login":"chibenwa","id":6928740,"node_id":"MDQ6VXNlcjY5Mjg3NDA=","avatar_url":"https://avatars1.githubusercontent.com/u/6928740?v=4","gravatar_id":"","url":"https://api.github.com/users/chibenwa","html_url":"https://github.com/chibenwa","followers_url":"https://api.github.com/users/chibenwa/followers","following_url":"https://api.github.com/users/chibenwa/following{/other_user}","gists_url":"https://api.github.com/users/chibenwa/gists{/gist_id}","starred_url":"https://api.github.com/users/chibenwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chibenwa/subscriptions","organizations_url":"https://api.github.com/users/chibenwa/orgs","repos_url":"https://api.github.com/users/chibenwa/repos","events_url":"https://api.github.com/users/chibenwa/events{/privacy}","received_events_url":"https://api.github.com/users/chibenwa/received_events","type":"User","site_admin":false},"html_url":"https://github.com/chibenwa/james-project","description":"Mirror of Apache James Project","fork":true,"url":"https://api.github.com/repos/chibenwa/james-project","forks_url":"https://api.github.com/repos/chibenwa/james-project/forks","keys_url":"https://api.github.com/repos/chibenwa/james-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chibenwa/james-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chibenwa/james-project/teams","hooks_url":"https://api.github.com/repos/chibenwa/james-project/hooks","issue_events_url":"https://api.github.com/repos/chibenwa/james-project/issues/events{/number}","events_url":"https://api.github.com/repos/chibenwa/james-project/events","assignees_url":"https://api.github.com/repos/chibenwa/james-project/assignees{/user}","branches_url":"https://api.github.com/repos/chibenwa/james-project/branches{/branch}","tags_url":"https://api.github.com/repos/chibenwa/james-project/tags","blobs_url":"https://api.github.com/repos/chibenwa/james-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chibenwa/james-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chibenwa/james-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/chibenwa/james-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chibenwa/james-project/statuses/{sha}","languages_url":"https://api.github.com/repos/chibenwa/james-project/languages","stargazers_url":"https://api.github.com/repos/chibenwa/james-project/stargazers","contributors_url":"https://api.github.com/repos/chibenwa/james-project/contributors","subscribers_url":"https://api.github.com/repos/chibenwa/james-project/subscribers","subscription_url":"https://api.github.com/repos/chibenwa/james-project/subscription","commits_url":"https://api.github.com/repos/chibenwa/james-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/chibenwa/james-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/chibenwa/james-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/chibenwa/james-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/chibenwa/james-project/contents/{+path}","compare_url":"https://api.github.com/repos/chibenwa/james-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chibenwa/james-project/merges","archive_url":"https://api.github.com/repos/chibenwa/james-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chibenwa/james-project/downloads","issues_url":"https://api.github.com/repos/chibenwa/james-project/issues{/number}","pulls_url":"https://api.github.com/repos/chibenwa/james-project/pulls{/number}","milestones_url":"https://api.github.com/repos/chibenwa/james-project/milestones{/number}","notifications_url":"https://api.github.com/repos/chibenwa/james-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chibenwa/james-project/labels{/name}","releases_url":"https://api.github.com/repos/chibenwa/james-project/releases{/id}","deployments_url":"https://api.github.com/repos/chibenwa/james-project/deployments","created_at":"2015-09-14T15:57:25Z","updated_at":"2017-10-03T11:59:27Z","pushed_at":"2018-12-06T08:09:44Z","git_url":"git://github.com/chibenwa/james-project.git","ssh_url":"git@github.com:chibenwa/james-project.git","clone_url":"https://github.com/chibenwa/james-project.git","svn_url":"https://github.com/chibenwa/james-project","homepage":null,"size":49656,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":2,"open_issues":2,"watchers":0,"default_branch":"trunk"}},"base":{"label":"linagora:master","ref":"master","sha":"16e4d9f93d411cebbf4f39d8420f379e357b692c","user":{"login":"linagora","id":1230365,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMzAzNjU=","avatar_url":"https://avatars3.githubusercontent.com/u/1230365?v=4","gravatar_id":"","url":"https://api.github.com/users/linagora","html_url":"https://github.com/linagora","followers_url":"https://api.github.com/users/linagora/followers","following_url":"https://api.github.com/users/linagora/following{/other_user}","gists_url":"https://api.github.com/users/linagora/gists{/gist_id}","starred_url":"https://api.github.com/users/linagora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linagora/subscriptions","organizations_url":"https://api.github.com/users/linagora/orgs","repos_url":"https://api.github.com/users/linagora/repos","events_url":"https://api.github.com/users/linagora/events{/privacy}","received_events_url":"https://api.github.com/users/linagora/received_events","type":"Organization","site_admin":false},"repo":{"id":39182136,"node_id":"MDEwOlJlcG9zaXRvcnkzOTE4MjEzNg==","name":"james-project","full_name":"linagora/james-project","private":false,"owner":{"login":"linagora","id":1230365,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMzAzNjU=","avatar_url":"https://avatars3.githubusercontent.com/u/1230365?v=4","gravatar_id":"","url":"https://api.github.com/users/linagora","html_url":"https://github.com/linagora","followers_url":"https://api.github.com/users/linagora/followers","following_url":"https://api.github.com/users/linagora/following{/other_user}","gists_url":"https://api.github.com/users/linagora/gists{/gist_id}","starred_url":"https://api.github.com/users/linagora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linagora/subscriptions","organizations_url":"https://api.github.com/users/linagora/orgs","repos_url":"https://api.github.com/users/linagora/repos","events_url":"https://api.github.com/users/linagora/events{/privacy}","received_events_url":"https://api.github.com/users/linagora/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/linagora/james-project","description":"Mirror of Apache James Project","fork":true,"url":"https://api.github.com/repos/linagora/james-project","forks_url":"https://api.github.com/repos/linagora/james-project/forks","keys_url":"https://api.github.com/repos/linagora/james-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linagora/james-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linagora/james-project/teams","hooks_url":"https://api.github.com/repos/linagora/james-project/hooks","issue_events_url":"https://api.github.com/repos/linagora/james-project/issues/events{/number}","events_url":"https://api.github.com/repos/linagora/james-project/events","assignees_url":"https://api.github.com/repos/linagora/james-project/assignees{/user}","branches_url":"https://api.github.com/repos/linagora/james-project/branches{/branch}","tags_url":"https://api.github.com/repos/linagora/james-project/tags","blobs_url":"https://api.github.com/repos/linagora/james-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linagora/james-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linagora/james-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/linagora/james-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linagora/james-project/statuses/{sha}","languages_url":"https://api.github.com/repos/linagora/james-project/languages","stargazers_url":"https://api.github.com/repos/linagora/james-project/stargazers","contributors_url":"https://api.github.com/repos/linagora/james-project/contributors","subscribers_url":"https://api.github.com/repos/linagora/james-project/subscribers","subscription_url":"https://api.github.com/repos/linagora/james-project/subscription","commits_url":"https://api.github.com/repos/linagora/james-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/linagora/james-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/linagora/james-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/linagora/james-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/linagora/james-project/contents/{+path}","compare_url":"https://api.github.com/repos/linagora/james-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linagora/james-project/merges","archive_url":"https://api.github.com/repos/linagora/james-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linagora/james-project/downloads","issues_url":"https://api.github.com/repos/linagora/james-project/issues{/number}","pulls_url":"https://api.github.com/repos/linagora/james-project/pulls{/number}","milestones_url":"https://api.github.com/repos/linagora/james-project/milestones{/number}","notifications_url":"https://api.github.com/repos/linagora/james-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linagora/james-project/labels{/name}","releases_url":"https://api.github.com/repos/linagora/james-project/releases{/id}","deployments_url":"https://api.github.com/repos/linagora/james-project/deployments","created_at":"2015-07-16T07:04:59Z","updated_at":"2018-12-06T08:06:19Z","pushed_at":"2018-12-06T08:18:19Z","git_url":"git://github.com/linagora/james-project.git","ssh_url":"git@github.com:linagora/james-project.git","clone_url":"https://github.com/linagora/james-project.git","svn_url":"https://github.com/linagora/james-project","homepage":null,"size":38345,"stargazers_count":24,"watchers_count":24,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":33,"mirror_url":null,"archived":false,"open_issues_count":107,"license":null,"forks":33,"open_issues":107,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linagora/james-project/pulls/2005"},"html":{"href":"https://github.com/linagora/james-project/pull/2005"},"issue":{"href":"https://api.github.com/repos/linagora/james-project/issues/2005"},"comments":{"href":"https://api.github.com/repos/linagora/james-project/issues/2005/comments"},"review_comments":{"href":"https://api.github.com/repos/linagora/james-project/pulls/2005/comments"},"review_comment":{"href":"https://api.github.com/repos/linagora/james-project/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linagora/james-project/pulls/2005/commits"},"statuses":{"href":"https://api.github.com/repos/linagora/james-project/statuses/d26c24af2ec053c4316a83ea7c53a697298d6bcd"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"rouazana"}}