{"action":"created","comment":{"url":"https://api.github.com/repos/apache/drill/pulls/comments/42888749","id":42888749,"diff_hunk":"@@ -130,4 +136,48 @@ public void addSummary(TableBuilder tb) {\n     tb.appendBytes(Math.round(memSum / size), null);\n     tb.appendBytes(peakMem.getLeft().getPeakLocalMemoryAllocated(), null);\n   }\n+\n+  public String getMetricsTable() {\n+    final String[] metricNames = OperatorMetricRegistry.getMetricNames(operatorType.getNumber());\n+    if (metricNames == null) {\n+      return \"\";\n+    }\n+\n+    final String[] metricsTableColumnNames = new String[metricNames.length + 1];\n+    metricsTableColumnNames[0] = \"Minor Fragment\";\n+    int i = 1;\n+    for (final String metricName : metricNames) {\n+      metricsTableColumnNames[i++] = metricName;\n+    }\n+    final TableBuilder builder = new TableBuilder(metricsTableColumnNames);\n+    for (final ImmutablePair<OperatorProfile, Integer> ip : ops) {\n+      final OperatorProfile op = ip.getLeft();\n+\n+      builder.appendCell(\n+          new OperatorPathBuilder()\n+              .setMajor(major)\n+              .setMinor(ip.getRight())\n+              .setOperator(op)\n+              .build(),\n+          null);\n+\n+      final Map<Integer, Number> valueMap = Maps.newHashMap(); // metric id --> metric value","path":"exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/OperatorWrapper.java","position":81,"original_position":81,"commit_id":"13fc00981def6d0aebe4368dbf1906688030ce20","original_commit_id":"13fc00981def6d0aebe4368dbf1906688030ce20","user":{"login":"adeneche","id":8422943,"avatar_url":"https://avatars.githubusercontent.com/u/8422943?v=3","gravatar_id":"","url":"https://api.github.com/users/adeneche","html_url":"https://github.com/adeneche","followers_url":"https://api.github.com/users/adeneche/followers","following_url":"https://api.github.com/users/adeneche/following{/other_user}","gists_url":"https://api.github.com/users/adeneche/gists{/gist_id}","starred_url":"https://api.github.com/users/adeneche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adeneche/subscriptions","organizations_url":"https://api.github.com/users/adeneche/orgs","repos_url":"https://api.github.com/users/adeneche/repos","events_url":"https://api.github.com/users/adeneche/events{/privacy}","received_events_url":"https://api.github.com/users/adeneche/received_events","type":"User","site_admin":false},"body":"we don't really need a Map here, right ?","created_at":"2015-10-23T17:05:29Z","updated_at":"2015-10-23T17:05:29Z","html_url":"https://github.com/apache/drill/pull/216#discussion_r42888749","pull_request_url":"https://api.github.com/repos/apache/drill/pulls/216","_links":{"self":{"href":"https://api.github.com/repos/apache/drill/pulls/comments/42888749"},"html":{"href":"https://github.com/apache/drill/pull/216#discussion_r42888749"},"pull_request":{"href":"https://api.github.com/repos/apache/drill/pulls/216"}}},"pull_request":{"url":"https://api.github.com/repos/apache/drill/pulls/216","id":48415065,"html_url":"https://github.com/apache/drill/pull/216","diff_url":"https://github.com/apache/drill/pull/216.diff","patch_url":"https://github.com/apache/drill/pull/216.patch","issue_url":"https://api.github.com/repos/apache/drill/issues/216","number":216,"state":"open","locked":false,"title":"DRILL-3340: Add operator metrics registry for metric definitions","user":{"login":"sudheeshkatkam","id":3272600,"avatar_url":"https://avatars.githubusercontent.com/u/3272600?v=3","gravatar_id":"","url":"https://api.github.com/users/sudheeshkatkam","html_url":"https://github.com/sudheeshkatkam","followers_url":"https://api.github.com/users/sudheeshkatkam/followers","following_url":"https://api.github.com/users/sudheeshkatkam/following{/other_user}","gists_url":"https://api.github.com/users/sudheeshkatkam/gists{/gist_id}","starred_url":"https://api.github.com/users/sudheeshkatkam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sudheeshkatkam/subscriptions","organizations_url":"https://api.github.com/users/sudheeshkatkam/orgs","repos_url":"https://api.github.com/users/sudheeshkatkam/repos","events_url":"https://api.github.com/users/sudheeshkatkam/events{/privacy}","received_events_url":"https://api.github.com/users/sudheeshkatkam/received_events","type":"User","site_admin":false},"body":"+ Display metrics as a table within an operator profile panel\r\n+ Rename FragmentStats#getOperatorStats to newOperatorStats","created_at":"2015-10-22T03:50:54Z","updated_at":"2015-10-23T17:05:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ce30fcb1fa63c239987a1e9b6cf50e656d64299f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/drill/pulls/216/commits","review_comments_url":"https://api.github.com/repos/apache/drill/pulls/216/comments","review_comment_url":"https://api.github.com/repos/apache/drill/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/drill/issues/216/comments","statuses_url":"https://api.github.com/repos/apache/drill/statuses/13fc00981def6d0aebe4368dbf1906688030ce20","head":{"label":"sudheeshkatkam:DRILL-3340","ref":"DRILL-3340","sha":"13fc00981def6d0aebe4368dbf1906688030ce20","user":{"login":"sudheeshkatkam","id":3272600,"avatar_url":"https://avatars.githubusercontent.com/u/3272600?v=3","gravatar_id":"","url":"https://api.github.com/users/sudheeshkatkam","html_url":"https://github.com/sudheeshkatkam","followers_url":"https://api.github.com/users/sudheeshkatkam/followers","following_url":"https://api.github.com/users/sudheeshkatkam/following{/other_user}","gists_url":"https://api.github.com/users/sudheeshkatkam/gists{/gist_id}","starred_url":"https://api.github.com/users/sudheeshkatkam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sudheeshkatkam/subscriptions","organizations_url":"https://api.github.com/users/sudheeshkatkam/orgs","repos_url":"https://api.github.com/users/sudheeshkatkam/repos","events_url":"https://api.github.com/users/sudheeshkatkam/events{/privacy}","received_events_url":"https://api.github.com/users/sudheeshkatkam/received_events","type":"User","site_admin":false},"repo":{"id":20229967,"name":"drill","full_name":"sudheeshkatkam/drill","owner":{"login":"sudheeshkatkam","id":3272600,"avatar_url":"https://avatars.githubusercontent.com/u/3272600?v=3","gravatar_id":"","url":"https://api.github.com/users/sudheeshkatkam","html_url":"https://github.com/sudheeshkatkam","followers_url":"https://api.github.com/users/sudheeshkatkam/followers","following_url":"https://api.github.com/users/sudheeshkatkam/following{/other_user}","gists_url":"https://api.github.com/users/sudheeshkatkam/gists{/gist_id}","starred_url":"https://api.github.com/users/sudheeshkatkam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sudheeshkatkam/subscriptions","organizations_url":"https://api.github.com/users/sudheeshkatkam/orgs","repos_url":"https://api.github.com/users/sudheeshkatkam/repos","events_url":"https://api.github.com/users/sudheeshkatkam/events{/privacy}","received_events_url":"https://api.github.com/users/sudheeshkatkam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sudheeshkatkam/drill","description":"Sudheesh's Drill Fork","fork":true,"url":"https://api.github.com/repos/sudheeshkatkam/drill","forks_url":"https://api.github.com/repos/sudheeshkatkam/drill/forks","keys_url":"https://api.github.com/repos/sudheeshkatkam/drill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sudheeshkatkam/drill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sudheeshkatkam/drill/teams","hooks_url":"https://api.github.com/repos/sudheeshkatkam/drill/hooks","issue_events_url":"https://api.github.com/repos/sudheeshkatkam/drill/issues/events{/number}","events_url":"https://api.github.com/repos/sudheeshkatkam/drill/events","assignees_url":"https://api.github.com/repos/sudheeshkatkam/drill/assignees{/user}","branches_url":"https://api.github.com/repos/sudheeshkatkam/drill/branches{/branch}","tags_url":"https://api.github.com/repos/sudheeshkatkam/drill/tags","blobs_url":"https://api.github.com/repos/sudheeshkatkam/drill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sudheeshkatkam/drill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sudheeshkatkam/drill/git/refs{/sha}","trees_url":"https://api.github.com/repos/sudheeshkatkam/drill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sudheeshkatkam/drill/statuses/{sha}","languages_url":"https://api.github.com/repos/sudheeshkatkam/drill/languages","stargazers_url":"https://api.github.com/repos/sudheeshkatkam/drill/stargazers","contributors_url":"https://api.github.com/repos/sudheeshkatkam/drill/contributors","subscribers_url":"https://api.github.com/repos/sudheeshkatkam/drill/subscribers","subscription_url":"https://api.github.com/repos/sudheeshkatkam/drill/subscription","commits_url":"https://api.github.com/repos/sudheeshkatkam/drill/commits{/sha}","git_commits_url":"https://api.github.com/repos/sudheeshkatkam/drill/git/commits{/sha}","comments_url":"https://api.github.com/repos/sudheeshkatkam/drill/comments{/number}","issue_comment_url":"https://api.github.com/repos/sudheeshkatkam/drill/issues/comments{/number}","contents_url":"https://api.github.com/repos/sudheeshkatkam/drill/contents/{+path}","compare_url":"https://api.github.com/repos/sudheeshkatkam/drill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sudheeshkatkam/drill/merges","archive_url":"https://api.github.com/repos/sudheeshkatkam/drill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sudheeshkatkam/drill/downloads","issues_url":"https://api.github.com/repos/sudheeshkatkam/drill/issues{/number}","pulls_url":"https://api.github.com/repos/sudheeshkatkam/drill/pulls{/number}","milestones_url":"https://api.github.com/repos/sudheeshkatkam/drill/milestones{/number}","notifications_url":"https://api.github.com/repos/sudheeshkatkam/drill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sudheeshkatkam/drill/labels{/name}","releases_url":"https://api.github.com/repos/sudheeshkatkam/drill/releases{/id}","created_at":"2014-05-27T18:08:52Z","updated_at":"2015-05-07T16:46:06Z","pushed_at":"2015-10-22T21:28:28Z","git_url":"git://github.com/sudheeshkatkam/drill.git","ssh_url":"git@github.com:sudheeshkatkam/drill.git","clone_url":"https://github.com/sudheeshkatkam/drill.git","svn_url":"https://github.com/sudheeshkatkam/drill","homepage":"","size":35461,"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":"apache:master","ref":"master","sha":"19b4b798b6756c6a140a05c2ca8e6e79778b1df1","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":5683653,"name":"drill","full_name":"apache/drill","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/drill","description":"Mirror of Apache Drill","fork":false,"url":"https://api.github.com/repos/apache/drill","forks_url":"https://api.github.com/repos/apache/drill/forks","keys_url":"https://api.github.com/repos/apache/drill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/drill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/drill/teams","hooks_url":"https://api.github.com/repos/apache/drill/hooks","issue_events_url":"https://api.github.com/repos/apache/drill/issues/events{/number}","events_url":"https://api.github.com/repos/apache/drill/events","assignees_url":"https://api.github.com/repos/apache/drill/assignees{/user}","branches_url":"https://api.github.com/repos/apache/drill/branches{/branch}","tags_url":"https://api.github.com/repos/apache/drill/tags","blobs_url":"https://api.github.com/repos/apache/drill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/drill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/drill/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/drill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/drill/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/drill/languages","stargazers_url":"https://api.github.com/repos/apache/drill/stargazers","contributors_url":"https://api.github.com/repos/apache/drill/contributors","subscribers_url":"https://api.github.com/repos/apache/drill/subscribers","subscription_url":"https://api.github.com/repos/apache/drill/subscription","commits_url":"https://api.github.com/repos/apache/drill/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/drill/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/drill/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/drill/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/drill/contents/{+path}","compare_url":"https://api.github.com/repos/apache/drill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/drill/merges","archive_url":"https://api.github.com/repos/apache/drill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/drill/downloads","issues_url":"https://api.github.com/repos/apache/drill/issues{/number}","pulls_url":"https://api.github.com/repos/apache/drill/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/drill/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/drill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/drill/labels{/name}","releases_url":"https://api.github.com/repos/apache/drill/releases{/id}","created_at":"2012-09-05T07:00:26Z","updated_at":"2015-10-23T09:14:35Z","pushed_at":"2015-10-23T06:29:09Z","git_url":"git://github.com/apache/drill.git","ssh_url":"git@github.com:apache/drill.git","clone_url":"https://github.com/apache/drill.git","svn_url":"https://github.com/apache/drill","homepage":"","size":47713,"stargazers_count":501,"watchers_count":501,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":318,"mirror_url":"git://git.apache.org/incubator-drill.git","open_issues_count":49,"forks":318,"open_issues":49,"watchers":501,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/drill/pulls/216"},"html":{"href":"https://github.com/apache/drill/pull/216"},"issue":{"href":"https://api.github.com/repos/apache/drill/issues/216"},"comments":{"href":"https://api.github.com/repos/apache/drill/issues/216/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/drill/pulls/216/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/drill/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/drill/pulls/216/commits"},"statuses":{"href":"https://api.github.com/repos/apache/drill/statuses/13fc00981def6d0aebe4368dbf1906688030ce20"}}}}