{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/65636344","id":65636344,"diff_hunk":"@@ -133,6 +135,24 @@ class Log(val dir: File,\n     },\n     tags)\n \n+  newGauge(\"LogSegments\",\n+    new Gauge[util.List[String]] {\n+      def value = {\n+        val list = logSegments.toSeq.map { seg =>\n+          s\"baseOffset=${seg.baseOffset}, created=${seg.created}, logSize=${seg.size}, indexSize=${seg.index.sizeInBytes()}\"\n+        }\n+        // Explicitly returning Java list to support JMX clients that don't have Scala runtime in the classpath\n+        new util.ArrayList[String](list.asJava)","path":"core/src/main/scala/kafka/log/Log.scala","position":27,"original_position":27,"commit_id":"1699b67ef60ec8c15ffd3fddb59a775e76ac12cb","original_commit_id":"1699b67ef60ec8c15ffd3fddb59a775e76ac12cb","user":{"login":"junrao","id":132330,"avatar_url":"https://avatars.githubusercontent.com/u/132330?v=3","gravatar_id":"","url":"https://api.github.com/users/junrao","html_url":"https://github.com/junrao","followers_url":"https://api.github.com/users/junrao/followers","following_url":"https://api.github.com/users/junrao/following{/other_user}","gists_url":"https://api.github.com/users/junrao/gists{/gist_id}","starred_url":"https://api.github.com/users/junrao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junrao/subscriptions","organizations_url":"https://api.github.com/users/junrao/orgs","repos_url":"https://api.github.com/users/junrao/repos","events_url":"https://api.github.com/users/junrao/events{/privacy}","received_events_url":"https://api.github.com/users/junrao/received_events","type":"User","site_admin":false},"body":"The jmx metric value will use comma to delimit different segments. Since each segment also has comma separated fields, it makes it hard to parse the text value. Could we use a different delimiter within a segment?","created_at":"2016-06-02T23:28:09Z","updated_at":"2016-06-02T23:28:09Z","html_url":"https://github.com/apache/kafka/pull/1196#discussion_r65636344","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/1196","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/65636344"},"html":{"href":"https://github.com/apache/kafka/pull/1196#discussion_r65636344"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/1196"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/1196","id":65554885,"html_url":"https://github.com/apache/kafka/pull/1196","diff_url":"https://github.com/apache/kafka/pull/1196.diff","patch_url":"https://github.com/apache/kafka/pull/1196.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/1196","number":1196,"state":"open","locked":false,"title":"KAFKA-1614: Partition log directory name and segments information exposed via JMX","user":{"login":"xdralex","id":1021271,"avatar_url":"https://avatars.githubusercontent.com/u/1021271?v=3","gravatar_id":"","url":"https://api.github.com/users/xdralex","html_url":"https://github.com/xdralex","followers_url":"https://api.github.com/users/xdralex/followers","following_url":"https://api.github.com/users/xdralex/following{/other_user}","gists_url":"https://api.github.com/users/xdralex/gists{/gist_id}","starred_url":"https://api.github.com/users/xdralex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xdralex/subscriptions","organizations_url":"https://api.github.com/users/xdralex/orgs","repos_url":"https://api.github.com/users/xdralex/repos","events_url":"https://api.github.com/users/xdralex/events{/privacy}","received_events_url":"https://api.github.com/users/xdralex/received_events","type":"User","site_admin":false},"body":"This is an updated version of https://issues.apache.org/jira/browse/KAFKA-1614 patch which was made for 0.8.1.1 version. \r\n\r\nIt makes partition log directory and single segments information exposed via JMX. This is useful to:\r\n* monitor disks usage in a cluster and on single broker;\r\n* calculate disk space taken by different topics;\r\n* estimate space to be freed when segments are expired.\r\n\r\nYahoo's Kafka Manager uses it to show information about topics and partitions sizes:\r\n\r\n![topics](https://cloud.githubusercontent.com/assets/1021271/14336342/aa3a197a-fc17-11e5-9ae8-7a4a8bf32562.png)\r\n![partitions](https://cloud.githubusercontent.com/assets/1021271/14336348/b38e2354-fc17-11e5-930d-9b36c7aae1e8.png)\r\n\r\nOur internal tool uses it to show how segments sizes were changing over time:\r\n\r\n![segments](https://cloud.githubusercontent.com/assets/1021271/14336349/b566ed8c-fc17-11e5-811f-d9bca5e2e099.png)\r\n\r\n@junrao could you please review when you have time?","created_at":"2016-04-06T23:55:10Z","updated_at":"2016-06-02T23:28:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fd7fda31af4b45252f87551c908a8fd696795aee","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/1196/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/1196/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/1196/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/1699b67ef60ec8c15ffd3fddb59a775e76ac12cb","head":{"label":"metamx:KAFKA-1614","ref":"KAFKA-1614","sha":"1699b67ef60ec8c15ffd3fddb59a775e76ac12cb","user":{"login":"metamx","id":299329,"avatar_url":"https://avatars.githubusercontent.com/u/299329?v=3","gravatar_id":"","url":"https://api.github.com/users/metamx","html_url":"https://github.com/metamx","followers_url":"https://api.github.com/users/metamx/followers","following_url":"https://api.github.com/users/metamx/following{/other_user}","gists_url":"https://api.github.com/users/metamx/gists{/gist_id}","starred_url":"https://api.github.com/users/metamx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metamx/subscriptions","organizations_url":"https://api.github.com/users/metamx/orgs","repos_url":"https://api.github.com/users/metamx/repos","events_url":"https://api.github.com/users/metamx/events{/privacy}","received_events_url":"https://api.github.com/users/metamx/received_events","type":"Organization","site_admin":false},"repo":{"id":46791414,"name":"kafka","full_name":"metamx/kafka","owner":{"login":"metamx","id":299329,"avatar_url":"https://avatars.githubusercontent.com/u/299329?v=3","gravatar_id":"","url":"https://api.github.com/users/metamx","html_url":"https://github.com/metamx","followers_url":"https://api.github.com/users/metamx/followers","following_url":"https://api.github.com/users/metamx/following{/other_user}","gists_url":"https://api.github.com/users/metamx/gists{/gist_id}","starred_url":"https://api.github.com/users/metamx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metamx/subscriptions","organizations_url":"https://api.github.com/users/metamx/orgs","repos_url":"https://api.github.com/users/metamx/repos","events_url":"https://api.github.com/users/metamx/events{/privacy}","received_events_url":"https://api.github.com/users/metamx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metamx/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/metamx/kafka","forks_url":"https://api.github.com/repos/metamx/kafka/forks","keys_url":"https://api.github.com/repos/metamx/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metamx/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metamx/kafka/teams","hooks_url":"https://api.github.com/repos/metamx/kafka/hooks","issue_events_url":"https://api.github.com/repos/metamx/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/metamx/kafka/events","assignees_url":"https://api.github.com/repos/metamx/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/metamx/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/metamx/kafka/tags","blobs_url":"https://api.github.com/repos/metamx/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metamx/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metamx/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/metamx/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metamx/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/metamx/kafka/languages","stargazers_url":"https://api.github.com/repos/metamx/kafka/stargazers","contributors_url":"https://api.github.com/repos/metamx/kafka/contributors","subscribers_url":"https://api.github.com/repos/metamx/kafka/subscribers","subscription_url":"https://api.github.com/repos/metamx/kafka/subscription","commits_url":"https://api.github.com/repos/metamx/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/metamx/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/metamx/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/metamx/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/metamx/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/metamx/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metamx/kafka/merges","archive_url":"https://api.github.com/repos/metamx/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metamx/kafka/downloads","issues_url":"https://api.github.com/repos/metamx/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/metamx/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/metamx/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/metamx/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metamx/kafka/labels{/name}","releases_url":"https://api.github.com/repos/metamx/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/metamx/kafka/deployments","created_at":"2015-11-24T12:51:38Z","updated_at":"2016-04-06T21:28:49Z","pushed_at":"2016-04-07T01:27:22Z","git_url":"git://github.com/metamx/kafka.git","ssh_url":"git@github.com:metamx/kafka.git","clone_url":"https://github.com/metamx/kafka.git","svn_url":"https://github.com/metamx/kafka","homepage":null,"size":29000,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"trunk"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"9791401a778fee5a165373b923bbe0ece70defbe","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","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,"name":"kafka","full_name":"apache/kafka","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","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},"private":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":"2016-06-02T18:10:55Z","pushed_at":"2016-06-02T22:51:36Z","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":43106,"stargazers_count":3194,"watchers_count":3194,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1953,"mirror_url":"git://git.apache.org/kafka.git","open_issues_count":189,"forks":1953,"open_issues":189,"watchers":3194,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/1196"},"html":{"href":"https://github.com/apache/kafka/pull/1196"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/1196"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/1196/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/1196/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/1196/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/1699b67ef60ec8c15ffd3fddb59a775e76ac12cb"}}}}
{"actor":{"display_login":"junrao"}}