{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/353909122","pull_request_review_id":327059271,"id":353909122,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM1MzkwOTEyMg==","diff_hunk":"@@ -0,0 +1,140 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one or more\n+ * contributor license agreements. See the NOTICE file distributed with\n+ * this work for additional information regarding copyright ownership.\n+ * The ASF licenses this file to You under the Apache License, Version 2.0\n+ * (the \"License\"); you may not use this file except in compliance with\n+ * the License. You may obtain a copy of the License at\n+ *\n+ *    http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.apache.kafka.common.metrics;\n+\n+import org.apache.kafka.common.MetricName;\n+import org.slf4j.Logger;\n+\n+import java.util.HashMap;\n+import java.util.Map;\n+import java.util.function.Consumer;\n+import java.util.function.Function;\n+\n+/**\n+ * Manages a suite of integer Gauges.\n+ */\n+public class IntGaugeSuite<K> implements AutoCloseable {\n+    private final Logger log;\n+    private final String suiteName;\n+    private final Metrics metrics;\n+    private final Function<K, MetricName> metricNameCalculator;\n+    private final int maxEntries;\n+    private final Map<K, StoredIntGauge> map;\n+    private boolean closed;\n+\n+    class StoredIntGauge implements Gauge<Integer> {\n+        private final MetricName metricName;\n+        int value;\n+\n+        StoredIntGauge(MetricName metricName) {\n+            this.metricName = metricName;\n+            this.value = 0;\n+        }\n+\n+        @Override\n+        public Integer value(MetricConfig config, long now) {\n+            synchronized (IntGaugeSuite.this) {\n+                return value;\n+            }\n+        }\n+    }\n+\n+    public IntGaugeSuite(Logger log,\n+                         String suiteName,\n+                         Metrics metrics,\n+                         Function<K, MetricName> metricNameCalculator,\n+                         int maxEntries) {\n+        this.log = log;\n+        this.suiteName = suiteName;\n+        this.metrics = metrics;\n+        this.metricNameCalculator = metricNameCalculator;\n+        this.maxEntries = maxEntries;\n+        this.map = new HashMap<>(1);\n+        this.closed = false;\n+        log.trace(\"{}: created new gauge suite with maxEntries = {}.\",\n+            suiteName, maxEntries);\n+    }\n+\n+    public synchronized void increment(K shortName) {","path":"clients/src/main/java/org/apache/kafka/common/metrics/IntGaugeSuite.java","position":72,"original_position":72,"commit_id":"ca930f64f7eed072af4605d8e8b6df4dfb02004d","original_commit_id":"ca930f64f7eed072af4605d8e8b6df4dfb02004d","user":{"login":"cmccabe","id":1095624,"node_id":"MDQ6VXNlcjEwOTU2MjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1095624?v=4","gravatar_id":"","url":"https://api.github.com/users/cmccabe","html_url":"https://github.com/cmccabe","followers_url":"https://api.github.com/users/cmccabe/followers","following_url":"https://api.github.com/users/cmccabe/following{/other_user}","gists_url":"https://api.github.com/users/cmccabe/gists{/gist_id}","starred_url":"https://api.github.com/users/cmccabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmccabe/subscriptions","organizations_url":"https://api.github.com/users/cmccabe/orgs","repos_url":"https://api.github.com/users/cmccabe/repos","events_url":"https://api.github.com/users/cmccabe/events{/privacy}","received_events_url":"https://api.github.com/users/cmccabe/received_events","type":"User","site_admin":false},"body":"Yeah, I'll change the \"shortName\" variable name to \"key\" to avoid confusion here.","created_at":"2019-12-04T18:27:58Z","updated_at":"2019-12-04T18:27:58Z","html_url":"https://github.com/apache/kafka/pull/7588#discussion_r353909122","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/7588","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/353909122"},"html":{"href":"https://github.com/apache/kafka/pull/7588#discussion_r353909122"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/7588"}},"in_reply_to_id":352551830},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/7588","id":331784904,"node_id":"MDExOlB1bGxSZXF1ZXN0MzMxNzg0OTA0","html_url":"https://github.com/apache/kafka/pull/7588","diff_url":"https://github.com/apache/kafka/pull/7588.diff","patch_url":"https://github.com/apache/kafka/pull/7588.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/7588","number":7588,"state":"open","locked":false,"title":"KAFKA-9091: Add a metric tracking the number of open connections with a given SSL cipher type","user":{"login":"cmccabe","id":1095624,"node_id":"MDQ6VXNlcjEwOTU2MjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1095624?v=4","gravatar_id":"","url":"https://api.github.com/users/cmccabe","html_url":"https://github.com/cmccabe","followers_url":"https://api.github.com/users/cmccabe/followers","following_url":"https://api.github.com/users/cmccabe/following{/other_user}","gists_url":"https://api.github.com/users/cmccabe/gists{/gist_id}","starred_url":"https://api.github.com/users/cmccabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmccabe/subscriptions","organizations_url":"https://api.github.com/users/cmccabe/orgs","repos_url":"https://api.github.com/users/cmccabe/repos","events_url":"https://api.github.com/users/cmccabe/events{/privacy}","received_events_url":"https://api.github.com/users/cmccabe/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-10-23T23:17:09Z","updated_at":"2019-12-04T18:27:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a2b2e54be077ba2790fe6f1cd2412658d9f0f25","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/7588/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/7588/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/7588/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/ca930f64f7eed072af4605d8e8b6df4dfb02004d","head":{"label":"cmccabe:KAFKA-9091","ref":"KAFKA-9091","sha":"ca930f64f7eed072af4605d8e8b6df4dfb02004d","user":{"login":"cmccabe","id":1095624,"node_id":"MDQ6VXNlcjEwOTU2MjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1095624?v=4","gravatar_id":"","url":"https://api.github.com/users/cmccabe","html_url":"https://github.com/cmccabe","followers_url":"https://api.github.com/users/cmccabe/followers","following_url":"https://api.github.com/users/cmccabe/following{/other_user}","gists_url":"https://api.github.com/users/cmccabe/gists{/gist_id}","starred_url":"https://api.github.com/users/cmccabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmccabe/subscriptions","organizations_url":"https://api.github.com/users/cmccabe/orgs","repos_url":"https://api.github.com/users/cmccabe/repos","events_url":"https://api.github.com/users/cmccabe/events{/privacy}","received_events_url":"https://api.github.com/users/cmccabe/received_events","type":"User","site_admin":false},"repo":{"id":74628042,"node_id":"MDEwOlJlcG9zaXRvcnk3NDYyODA0Mg==","name":"kafka","full_name":"cmccabe/kafka","private":false,"owner":{"login":"cmccabe","id":1095624,"node_id":"MDQ6VXNlcjEwOTU2MjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1095624?v=4","gravatar_id":"","url":"https://api.github.com/users/cmccabe","html_url":"https://github.com/cmccabe","followers_url":"https://api.github.com/users/cmccabe/followers","following_url":"https://api.github.com/users/cmccabe/following{/other_user}","gists_url":"https://api.github.com/users/cmccabe/gists{/gist_id}","starred_url":"https://api.github.com/users/cmccabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmccabe/subscriptions","organizations_url":"https://api.github.com/users/cmccabe/orgs","repos_url":"https://api.github.com/users/cmccabe/repos","events_url":"https://api.github.com/users/cmccabe/events{/privacy}","received_events_url":"https://api.github.com/users/cmccabe/received_events","type":"User","site_admin":false},"html_url":"https://github.com/cmccabe/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/cmccabe/kafka","forks_url":"https://api.github.com/repos/cmccabe/kafka/forks","keys_url":"https://api.github.com/repos/cmccabe/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cmccabe/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cmccabe/kafka/teams","hooks_url":"https://api.github.com/repos/cmccabe/kafka/hooks","issue_events_url":"https://api.github.com/repos/cmccabe/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/cmccabe/kafka/events","assignees_url":"https://api.github.com/repos/cmccabe/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/cmccabe/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/cmccabe/kafka/tags","blobs_url":"https://api.github.com/repos/cmccabe/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cmccabe/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cmccabe/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/cmccabe/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cmccabe/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/cmccabe/kafka/languages","stargazers_url":"https://api.github.com/repos/cmccabe/kafka/stargazers","contributors_url":"https://api.github.com/repos/cmccabe/kafka/contributors","subscribers_url":"https://api.github.com/repos/cmccabe/kafka/subscribers","subscription_url":"https://api.github.com/repos/cmccabe/kafka/subscription","commits_url":"https://api.github.com/repos/cmccabe/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/cmccabe/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/cmccabe/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/cmccabe/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/cmccabe/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/cmccabe/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cmccabe/kafka/merges","archive_url":"https://api.github.com/repos/cmccabe/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cmccabe/kafka/downloads","issues_url":"https://api.github.com/repos/cmccabe/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/cmccabe/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/cmccabe/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/cmccabe/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cmccabe/kafka/labels{/name}","releases_url":"https://api.github.com/repos/cmccabe/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/cmccabe/kafka/deployments","created_at":"2016-11-24T01:40:33Z","updated_at":"2019-01-07T21:22:45Z","pushed_at":"2019-11-25T18:23:30Z","git_url":"git://github.com/cmccabe/kafka.git","ssh_url":"git@github.com:cmccabe/kafka.git","clone_url":"https://github.com/cmccabe/kafka.git","svn_url":"https://github.com/cmccabe/kafka","homepage":null,"size":85990,"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":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"trunk"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"41a9e2c7c3f3c0ae48db89178d56d26dff3a2839","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":2211243,"node_id":"MDEwOlJlcG9zaXRvcnkyMjExMjQz","name":"kafka","full_name":"apache/kafka","private":false,"owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/apache/kafka","description":"Mirror of Apache Kafka","fork":false,"url":"https://api.github.com/repos/apache/kafka","forks_url":"https://api.github.com/repos/apache/kafka/forks","keys_url":"https://api.github.com/repos/apache/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/kafka/teams","hooks_url":"https://api.github.com/repos/apache/kafka/hooks","issue_events_url":"https://api.github.com/repos/apache/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/apache/kafka/events","assignees_url":"https://api.github.com/repos/apache/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/apache/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/apache/kafka/tags","blobs_url":"https://api.github.com/repos/apache/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/kafka/languages","stargazers_url":"https://api.github.com/repos/apache/kafka/stargazers","contributors_url":"https://api.github.com/repos/apache/kafka/contributors","subscribers_url":"https://api.github.com/repos/apache/kafka/subscribers","subscription_url":"https://api.github.com/repos/apache/kafka/subscription","commits_url":"https://api.github.com/repos/apache/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/apache/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/kafka/merges","archive_url":"https://api.github.com/repos/apache/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/kafka/downloads","issues_url":"https://api.github.com/repos/apache/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/apache/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/kafka/labels{/name}","releases_url":"https://api.github.com/repos/apache/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/apache/kafka/deployments","created_at":"2011-08-15T18:06:16Z","updated_at":"2019-12-04T17:11:33Z","pushed_at":"2019-12-04T18:07:07Z","git_url":"git://github.com/apache/kafka.git","ssh_url":"git@github.com:apache/kafka.git","clone_url":"https://github.com/apache/kafka.git","svn_url":"https://github.com/apache/kafka","homepage":null,"size":92259,"stargazers_count":14314,"watchers_count":14314,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7600,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":710,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":7600,"open_issues":710,"watchers":14314,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/7588"},"html":{"href":"https://github.com/apache/kafka/pull/7588"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/7588"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/7588/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/7588/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/7588/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/ca930f64f7eed072af4605d8e8b6df4dfb02004d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"cmccabe"}}