{"action":"created","comment":{"url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/pulls/comments/89082202","pull_request_review_id":9631504,"id":89082202,"diff_hunk":"@@ -212,29 +204,39 @@ public void report(\n         final SortedMap<String, Counter> counters,\n         final SortedMap<String, Histogram> histograms,\n         final SortedMap<String, Meter> meters,\n-        final SortedMap<String, Timer> timers) {\n+        final SortedMap<String, Timer> timers\n+    ) {\n         final long now = System.currentTimeMillis();\n \n         try {\n             influxDb.flush();\n \n             reportGauges(gauges, now);\n \n-            for (Map.Entry<String, Counter> entry : counters.entrySet()) {\n-                reportCounter(entry.getKey(), entry.getValue(), now);\n-            }\n+            counters.forEach((key, counter) -> {\n+                parse(key, (name, tags) -> reportCounter(name, counter, now, tags));\n+            });\n \n-            for (Map.Entry<String, Histogram> entry : histograms.entrySet()) {\n-                reportHistogram(entry.getKey(), entry.getValue(), now);\n-            }\n+            histograms.forEach((key, histogram) -> {\n+                if (canSkipMetric(key, histogram)) {","path":"metrics-influxdb/src/main/java/com/izettle/metrics/influxdb/InfluxDbReporter.java","position":61,"original_position":61,"commit_id":"e6fc3c576751b3c9abaa22be13a1361894433bc4","original_commit_id":"e6fc3c576751b3c9abaa22be13a1361894433bc4","user":{"login":"xiaodong-izettle","id":3328119,"avatar_url":"https://avatars.githubusercontent.com/u/3328119?v=3","gravatar_id":"","url":"https://api.github.com/users/xiaodong-izettle","html_url":"https://github.com/xiaodong-izettle","followers_url":"https://api.github.com/users/xiaodong-izettle/followers","following_url":"https://api.github.com/users/xiaodong-izettle/following{/other_user}","gists_url":"https://api.github.com/users/xiaodong-izettle/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaodong-izettle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaodong-izettle/subscriptions","organizations_url":"https://api.github.com/users/xiaodong-izettle/orgs","repos_url":"https://api.github.com/users/xiaodong-izettle/repos","events_url":"https://api.github.com/users/xiaodong-izettle/events{/privacy}","received_events_url":"https://api.github.com/users/xiaodong-izettle/received_events","type":"User","site_admin":false},"body":"Hehe, probably not worthy for `histograms.entrySet().stream.filter(...).forEach(...)`, but the memory/performance impact should be neglectable... I'm OK... :-)","created_at":"2016-11-22T10:17:48Z","updated_at":"2016-11-22T10:17:48Z","html_url":"https://github.com/iZettle/dropwizard-metrics-influxdb/pull/62#discussion_r89082202","pull_request_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/pulls/62","_links":{"self":{"href":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/pulls/comments/89082202"},"html":{"href":"https://github.com/iZettle/dropwizard-metrics-influxdb/pull/62#discussion_r89082202"},"pull_request":{"href":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/pulls/62","id":94722367,"html_url":"https://github.com/iZettle/dropwizard-metrics-influxdb/pull/62","diff_url":"https://github.com/iZettle/dropwizard-metrics-influxdb/pull/62.diff","patch_url":"https://github.com/iZettle/dropwizard-metrics-influxdb/pull/62.patch","issue_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/issues/62","number":62,"state":"open","locked":false,"title":"Support per metric custom tags","user":{"login":"x1a0","id":205756,"avatar_url":"https://avatars.githubusercontent.com/u/205756?v=3","gravatar_id":"","url":"https://api.github.com/users/x1a0","html_url":"https://github.com/x1a0","followers_url":"https://api.github.com/users/x1a0/followers","following_url":"https://api.github.com/users/x1a0/following{/other_user}","gists_url":"https://api.github.com/users/x1a0/gists{/gist_id}","starred_url":"https://api.github.com/users/x1a0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/x1a0/subscriptions","organizations_url":"https://api.github.com/users/x1a0/orgs","repos_url":"https://api.github.com/users/x1a0/repos","events_url":"https://api.github.com/users/x1a0/events{/privacy}","received_events_url":"https://api.github.com/users/x1a0/received_events","type":"User","site_admin":false},"body":"Poor man's support of custom tags. This could solve https://github.com/iZettle/dropwizard-metrics-influxdb/issues/42.\r\n\r\n### How to use\r\n\r\nWhen defining key of a metric, use the pattern `name|tag1:val1|tag2:val2|...|tagN:valN` to add custom tags.\r\n\r\nFor example, given a metric key `user.created|country:SE`, it will be sent to influxdb measurement `user.created` (if no measurement mapping specified) with a tag `country` and corresponding value `SE`.\r\n\r\nTo create/retrieve the metric handler in Dropwizard:\r\n```\r\nmetricRegistry.counter(name(\"user\", \"created|country:SE\"));\r\n```\r\n\r\n### About grouped gauges\r\n\r\nFor grouped gauges, custom tags are the last part of keys.\r\n\r\nFor example, `gauge.a|country:SE`, `gauge.b|country:DE`, `gauge.|country:SE` and `gauge|country:SE` could be grouped.","created_at":"2016-11-21T23:58:17Z","updated_at":"2016-11-22T10:17:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"14d990a9a1fa6a36274017848ade2320a95b966d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/pulls/62/commits","review_comments_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/pulls/62/comments","review_comment_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/issues/62/comments","statuses_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/statuses/e6fc3c576751b3c9abaa22be13a1361894433bc4","head":{"label":"iZettle:support-per-metric-tags","ref":"support-per-metric-tags","sha":"e6fc3c576751b3c9abaa22be13a1361894433bc4","user":{"login":"iZettle","id":1272526,"avatar_url":"https://avatars.githubusercontent.com/u/1272526?v=3","gravatar_id":"","url":"https://api.github.com/users/iZettle","html_url":"https://github.com/iZettle","followers_url":"https://api.github.com/users/iZettle/followers","following_url":"https://api.github.com/users/iZettle/following{/other_user}","gists_url":"https://api.github.com/users/iZettle/gists{/gist_id}","starred_url":"https://api.github.com/users/iZettle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iZettle/subscriptions","organizations_url":"https://api.github.com/users/iZettle/orgs","repos_url":"https://api.github.com/users/iZettle/repos","events_url":"https://api.github.com/users/iZettle/events{/privacy}","received_events_url":"https://api.github.com/users/iZettle/received_events","type":"Organization","site_admin":false},"repo":{"id":43748389,"name":"dropwizard-metrics-influxdb","full_name":"iZettle/dropwizard-metrics-influxdb","owner":{"login":"iZettle","id":1272526,"avatar_url":"https://avatars.githubusercontent.com/u/1272526?v=3","gravatar_id":"","url":"https://api.github.com/users/iZettle","html_url":"https://github.com/iZettle","followers_url":"https://api.github.com/users/iZettle/followers","following_url":"https://api.github.com/users/iZettle/following{/other_user}","gists_url":"https://api.github.com/users/iZettle/gists{/gist_id}","starred_url":"https://api.github.com/users/iZettle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iZettle/subscriptions","organizations_url":"https://api.github.com/users/iZettle/orgs","repos_url":"https://api.github.com/users/iZettle/repos","events_url":"https://api.github.com/users/iZettle/events{/privacy}","received_events_url":"https://api.github.com/users/iZettle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iZettle/dropwizard-metrics-influxdb","description":"Dropwizard Metrics v3 InfluxDB ","fork":false,"url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb","forks_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/forks","keys_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/teams","hooks_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/hooks","issue_events_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/issues/events{/number}","events_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/events","assignees_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/assignees{/user}","branches_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/branches{/branch}","tags_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/tags","blobs_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/statuses/{sha}","languages_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/languages","stargazers_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/stargazers","contributors_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/contributors","subscribers_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/subscribers","subscription_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/subscription","commits_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/contents/{+path}","compare_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/merges","archive_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/downloads","issues_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/issues{/number}","pulls_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/pulls{/number}","milestones_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/milestones{/number}","notifications_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/labels{/name}","releases_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/releases{/id}","deployments_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/deployments","created_at":"2015-10-06T12:13:23Z","updated_at":"2016-11-08T21:29:32Z","pushed_at":"2016-11-22T07:57:53Z","git_url":"git://github.com/iZettle/dropwizard-metrics-influxdb.git","ssh_url":"git@github.com:iZettle/dropwizard-metrics-influxdb.git","clone_url":"https://github.com/iZettle/dropwizard-metrics-influxdb.git","svn_url":"https://github.com/iZettle/dropwizard-metrics-influxdb","homepage":null,"size":192,"stargazers_count":27,"watchers_count":27,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":5,"forks":9,"open_issues":5,"watchers":27,"default_branch":"master"}},"base":{"label":"iZettle:master","ref":"master","sha":"8ed67e1fd63585b617b481e9b40263a3f75b8a5f","user":{"login":"iZettle","id":1272526,"avatar_url":"https://avatars.githubusercontent.com/u/1272526?v=3","gravatar_id":"","url":"https://api.github.com/users/iZettle","html_url":"https://github.com/iZettle","followers_url":"https://api.github.com/users/iZettle/followers","following_url":"https://api.github.com/users/iZettle/following{/other_user}","gists_url":"https://api.github.com/users/iZettle/gists{/gist_id}","starred_url":"https://api.github.com/users/iZettle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iZettle/subscriptions","organizations_url":"https://api.github.com/users/iZettle/orgs","repos_url":"https://api.github.com/users/iZettle/repos","events_url":"https://api.github.com/users/iZettle/events{/privacy}","received_events_url":"https://api.github.com/users/iZettle/received_events","type":"Organization","site_admin":false},"repo":{"id":43748389,"name":"dropwizard-metrics-influxdb","full_name":"iZettle/dropwizard-metrics-influxdb","owner":{"login":"iZettle","id":1272526,"avatar_url":"https://avatars.githubusercontent.com/u/1272526?v=3","gravatar_id":"","url":"https://api.github.com/users/iZettle","html_url":"https://github.com/iZettle","followers_url":"https://api.github.com/users/iZettle/followers","following_url":"https://api.github.com/users/iZettle/following{/other_user}","gists_url":"https://api.github.com/users/iZettle/gists{/gist_id}","starred_url":"https://api.github.com/users/iZettle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iZettle/subscriptions","organizations_url":"https://api.github.com/users/iZettle/orgs","repos_url":"https://api.github.com/users/iZettle/repos","events_url":"https://api.github.com/users/iZettle/events{/privacy}","received_events_url":"https://api.github.com/users/iZettle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iZettle/dropwizard-metrics-influxdb","description":"Dropwizard Metrics v3 InfluxDB ","fork":false,"url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb","forks_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/forks","keys_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/teams","hooks_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/hooks","issue_events_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/issues/events{/number}","events_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/events","assignees_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/assignees{/user}","branches_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/branches{/branch}","tags_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/tags","blobs_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/statuses/{sha}","languages_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/languages","stargazers_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/stargazers","contributors_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/contributors","subscribers_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/subscribers","subscription_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/subscription","commits_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/contents/{+path}","compare_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/merges","archive_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/downloads","issues_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/issues{/number}","pulls_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/pulls{/number}","milestones_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/milestones{/number}","notifications_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/labels{/name}","releases_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/releases{/id}","deployments_url":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/deployments","created_at":"2015-10-06T12:13:23Z","updated_at":"2016-11-08T21:29:32Z","pushed_at":"2016-11-22T07:57:53Z","git_url":"git://github.com/iZettle/dropwizard-metrics-influxdb.git","ssh_url":"git@github.com:iZettle/dropwizard-metrics-influxdb.git","clone_url":"https://github.com/iZettle/dropwizard-metrics-influxdb.git","svn_url":"https://github.com/iZettle/dropwizard-metrics-influxdb","homepage":null,"size":192,"stargazers_count":27,"watchers_count":27,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":5,"forks":9,"open_issues":5,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/pulls/62"},"html":{"href":"https://github.com/iZettle/dropwizard-metrics-influxdb/pull/62"},"issue":{"href":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/issues/62"},"comments":{"href":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/iZettle/dropwizard-metrics-influxdb/statuses/e6fc3c576751b3c9abaa22be13a1361894433bc4"}}}}
{"actor":{"display_login":"xiaodong-izettle"}}