GitHub PullRequestReviewCommentEvent at 2014-07-07 20:22:07
Repository: naarad
Actor: richardhsu
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/linkedin/naarad/pulls/comments/14619762","id":14619762,"diff_hunk":"@@ -0,0 +1,254 @@\n+# coding=utf-8\n+\"\"\"\n+© 2013 LinkedIn Corp. All rights reserved.\n+Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+\"\"\"\n+\n+from collections import defaultdict\n+import datetime\n+import logging\n+import gc\n+import os\n+import re\n+import numpy\n+from naarad.metrics.metric import Metric\n+import naarad.utils\n+\n+logger = logging.getLogger('naarad.metrics.top_metric')\n+\n+class TopMetric(Metric):\n+  \"\"\"\n+  The raw log file is like the following:\n+  2014-06-23\n+  top - 00:00:02 up 18 days,  7:08, 19 users,  load average: 0.05, 0.03, 0.00\n+  Tasks: 447 total,   1 running, 443 sleeping,   2 stopped,   1 zombie\n+  Cpu(s):  1.6%us,  0.5%sy,  0.0%ni, 97.9%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st\n+  Mem:    62.841G total,   15.167G used,   47.675G free,  643.434M buffers\n+  Swap:   63.998G total,    0.000k used,   63.998G free,   11.324G cached\n+\n+  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            \n+  1730 root      20   0 4457m  10m 3328 S  1.9  0.0  80:13.45 lwregd   \n+  The log lines can be generated by echo $t >> $RESULT/top.out &; top -b -M -n $COUNT -d $INTERVAL | grep -A 40 '^top' >> $RESULT/top.out &\n+  \"\"\"  \n+  \n+  def __init__ (self, metric_type, infile, hostname, output_directory, resource_path, label, ts_start, ts_end,\n+                rule_strings, important_sub_metrics, **other_options):\n+    Metric.__init__(self, metric_type, infile, hostname, output_directory, resource_path, label, ts_start, ts_end,\n+                    rule_strings, important_sub_metrics, )\n+    \n+    #allow user to specify interested processes; in the format of 'PID=11 22' and 'COMMAND=firefox top'                    ","path":"src/naarad/metrics/top_metric.py","position":41,"original_position":41,"commit_id":"e9968705d557cd9c5eaf9a72a11241376fd78ffb","original_commit_id":"e9968705d557cd9c5eaf9a72a11241376fd78ffb","user":{"login":"richardhsu","id":906880,"avatar_url":"https://avatars.githubusercontent.com/u/906880?","gravatar_id":"3ee1f6238a2196a9a80e88e51d605c00","url":"https://api.github.com/users/richardhsu","html_url":"https://github.com/richardhsu","followers_url":"https://api.github.com/users/richardhsu/followers","following_url":"https://api.github.com/users/richardhsu/following{/other_user}","gists_url":"https://api.github.com/users/richardhsu/gists{/gist_id}","starred_url":"https://api.github.com/users/richardhsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardhsu/subscriptions","organizations_url":"https://api.github.com/users/richardhsu/orgs","repos_url":"https://api.github.com/users/richardhsu/repos","events_url":"https://api.github.com/users/richardhsu/events{/privacy}","received_events_url":"https://api.github.com/users/richardhsu/received_events","type":"User","site_admin":false},"body":"Maybe add a comment that it'll search for any processes that match the PIDs listed or the commands listed. It's not an intersection of the PIDs and commands.","created_at":"2014-07-07T20:22:07Z","updated_at":"2014-07-07T20:22:07Z","html_url":"https://github.com/linkedin/naarad/pull/253#discussion_r14619762","pull_request_url":"https://api.github.com/repos/linkedin/naarad/pulls/253","_links":{"self":{"href":"https://api.github.com/repos/linkedin/naarad/pulls/comments/14619762"},"html":{"href":"https://github.com/linkedin/naarad/pull/253#discussion_r14619762"},"pull_request":{"href":"https://api.github.com/repos/linkedin/naarad/pulls/253"}}},"pull_request":{"url":"https://api.github.com/repos/linkedin/naarad/pulls/253","id":17499765,"html_url":"https://github.com/linkedin/naarad/pull/253","diff_url":"https://github.com/linkedin/naarad/pull/253.diff","patch_url":"https://github.com/linkedin/naarad/pull/253.patch","issue_url":"https://api.github.com/repos/linkedin/naarad/issues/253","number":253,"state":"open","title":"added TOP support","user":{"login":"zhenyun","id":5853125,"avatar_url":"https://avatars.githubusercontent.com/u/5853125?","gravatar_id":"eff9481cad3999b6edb1f98d5026503d","url":"https://api.github.com/users/zhenyun","html_url":"https://github.com/zhenyun","followers_url":"https://api.github.com/users/zhenyun/followers","following_url":"https://api.github.com/users/zhenyun/following{/other_user}","gists_url":"https://api.github.com/users/zhenyun/gists{/gist_id}","starred_url":"https://api.github.com/users/zhenyun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhenyun/subscriptions","organizations_url":"https://api.github.com/users/zhenyun/orgs","repos_url":"https://api.github.com/users/zhenyun/repos","events_url":"https://api.github.com/users/zhenyun/events{/privacy}","received_events_url":"https://api.github.com/users/zhenyun/received_events","type":"User","site_admin":false},"body":"- tested with the sample config and sample top.out. \r\n- allows the user to specify the processes to plot. ","created_at":"2014-06-23T21:15:43Z","updated_at":"2014-07-07T20:22:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4dbe4b8c6e20939f9a410c60b42fdc65fa873ab5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/linkedin/naarad/pulls/253/commits","review_comments_url":"https://api.github.com/repos/linkedin/naarad/pulls/253/comments","review_comment_url":"https://api.github.com/repos/linkedin/naarad/pulls/comments/{number}","comments_url":"https://api.github.com/repos/linkedin/naarad/issues/253/comments","statuses_url":"https://api.github.com/repos/linkedin/naarad/statuses/e9968705d557cd9c5eaf9a72a11241376fd78ffb","head":{"label":"zhenyun:master","ref":"master","sha":"e9968705d557cd9c5eaf9a72a11241376fd78ffb","user":{"login":"zhenyun","id":5853125,"avatar_url":"https://avatars.githubusercontent.com/u/5853125?","gravatar_id":"eff9481cad3999b6edb1f98d5026503d","url":"https://api.github.com/users/zhenyun","html_url":"https://github.com/zhenyun","followers_url":"https://api.github.com/users/zhenyun/followers","following_url":"https://api.github.com/users/zhenyun/following{/other_user}","gists_url":"https://api.github.com/users/zhenyun/gists{/gist_id}","starred_url":"https://api.github.com/users/zhenyun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhenyun/subscriptions","organizations_url":"https://api.github.com/users/zhenyun/orgs","repos_url":"https://api.github.com/users/zhenyun/repos","events_url":"https://api.github.com/users/zhenyun/events{/privacy}","received_events_url":"https://api.github.com/users/zhenyun/received_events","type":"User","site_admin":false},"repo":{"id":14151102,"name":"naarad","full_name":"zhenyun/naarad","owner":{"login":"zhenyun","id":5853125,"avatar_url":"https://avatars.githubusercontent.com/u/5853125?","gravatar_id":"eff9481cad3999b6edb1f98d5026503d","url":"https://api.github.com/users/zhenyun","html_url":"https://github.com/zhenyun","followers_url":"https://api.github.com/users/zhenyun/followers","following_url":"https://api.github.com/users/zhenyun/following{/other_user}","gists_url":"https://api.github.com/users/zhenyun/gists{/gist_id}","starred_url":"https://api.github.com/users/zhenyun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhenyun/subscriptions","organizations_url":"https://api.github.com/users/zhenyun/orgs","repos_url":"https://api.github.com/users/zhenyun/repos","events_url":"https://api.github.com/users/zhenyun/events{/privacy}","received_events_url":"https://api.github.com/users/zhenyun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zhenyun/naarad","description":"Naarad is a highly configurable system analysis tool that parses and plots timeseries data for better visual correlation. Naarad was built to help in performance analysis and investigations.","fork":true,"url":"https://api.github.com/repos/zhenyun/naarad","forks_url":"https://api.github.com/repos/zhenyun/naarad/forks","keys_url":"https://api.github.com/repos/zhenyun/naarad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zhenyun/naarad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zhenyun/naarad/teams","hooks_url":"https://api.github.com/repos/zhenyun/naarad/hooks","issue_events_url":"https://api.github.com/repos/zhenyun/naarad/issues/events{/number}","events_url":"https://api.github.com/repos/zhenyun/naarad/events","assignees_url":"https://api.github.com/repos/zhenyun/naarad/assignees{/user}","branches_url":"https://api.github.com/repos/zhenyun/naarad/branches{/branch}","tags_url":"https://api.github.com/repos/zhenyun/naarad/tags","blobs_url":"https://api.github.com/repos/zhenyun/naarad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zhenyun/naarad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zhenyun/naarad/git/refs{/sha}","trees_url":"https://api.github.com/repos/zhenyun/naarad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zhenyun/naarad/statuses/{sha}","languages_url":"https://api.github.com/repos/zhenyun/naarad/languages","stargazers_url":"https://api.github.com/repos/zhenyun/naarad/stargazers","contributors_url":"https://api.github.com/repos/zhenyun/naarad/contributors","subscribers_url":"https://api.github.com/repos/zhenyun/naarad/subscribers","subscription_url":"https://api.github.com/repos/zhenyun/naarad/subscription","commits_url":"https://api.github.com/repos/zhenyun/naarad/commits{/sha}","git_commits_url":"https://api.github.com/repos/zhenyun/naarad/git/commits{/sha}","comments_url":"https://api.github.com/repos/zhenyun/naarad/comments{/number}","issue_comment_url":"https://api.github.com/repos/zhenyun/naarad/issues/comments/{number}","contents_url":"https://api.github.com/repos/zhenyun/naarad/contents/{+path}","compare_url":"https://api.github.com/repos/zhenyun/naarad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zhenyun/naarad/merges","archive_url":"https://api.github.com/repos/zhenyun/naarad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zhenyun/naarad/downloads","issues_url":"https://api.github.com/repos/zhenyun/naarad/issues{/number}","pulls_url":"https://api.github.com/repos/zhenyun/naarad/pulls{/number}","milestones_url":"https://api.github.com/repos/zhenyun/naarad/milestones{/number}","notifications_url":"https://api.github.com/repos/zhenyun/naarad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zhenyun/naarad/labels{/name}","releases_url":"https://api.github.com/repos/zhenyun/naarad/releases{/id}","created_at":"2013-11-05T19:10:12Z","updated_at":"2014-06-23T21:15:43Z","pushed_at":"2014-06-23T21:14:29Z","git_url":"git://github.com/zhenyun/naarad.git","ssh_url":"git@github.com:zhenyun/naarad.git","clone_url":"https://github.com/zhenyun/naarad.git","svn_url":"https://github.com/zhenyun/naarad","homepage":"","size":23532,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"linkedin:master","ref":"master","sha":"22798e8b255da99c970465b90ba172b7c2101aa9","user":{"login":"linkedin","id":357098,"avatar_url":"https://avatars.githubusercontent.com/u/357098?","gravatar_id":"344449f21a57e790db8361d7970b731a","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"repo":{"id":14056753,"name":"naarad","full_name":"linkedin/naarad","owner":{"login":"linkedin","id":357098,"avatar_url":"https://avatars.githubusercontent.com/u/357098?","gravatar_id":"344449f21a57e790db8361d7970b731a","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/linkedin/naarad","description":"Naarad is a highly configurable system analysis tool that parses and plots timeseries data for better visual correlation. Naarad was built to help in performance analysis and investigations.","fork":false,"url":"https://api.github.com/repos/linkedin/naarad","forks_url":"https://api.github.com/repos/linkedin/naarad/forks","keys_url":"https://api.github.com/repos/linkedin/naarad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linkedin/naarad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linkedin/naarad/teams","hooks_url":"https://api.github.com/repos/linkedin/naarad/hooks","issue_events_url":"https://api.github.com/repos/linkedin/naarad/issues/events{/number}","events_url":"https://api.github.com/repos/linkedin/naarad/events","assignees_url":"https://api.github.com/repos/linkedin/naarad/assignees{/user}","branches_url":"https://api.github.com/repos/linkedin/naarad/branches{/branch}","tags_url":"https://api.github.com/repos/linkedin/naarad/tags","blobs_url":"https://api.github.com/repos/linkedin/naarad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linkedin/naarad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linkedin/naarad/git/refs{/sha}","trees_url":"https://api.github.com/repos/linkedin/naarad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linkedin/naarad/statuses/{sha}","languages_url":"https://api.github.com/repos/linkedin/naarad/languages","stargazers_url":"https://api.github.com/repos/linkedin/naarad/stargazers","contributors_url":"https://api.github.com/repos/linkedin/naarad/contributors","subscribers_url":"https://api.github.com/repos/linkedin/naarad/subscribers","subscription_url":"https://api.github.com/repos/linkedin/naarad/subscription","commits_url":"https://api.github.com/repos/linkedin/naarad/commits{/sha}","git_commits_url":"https://api.github.com/repos/linkedin/naarad/git/commits{/sha}","comments_url":"https://api.github.com/repos/linkedin/naarad/comments{/number}","issue_comment_url":"https://api.github.com/repos/linkedin/naarad/issues/comments/{number}","contents_url":"https://api.github.com/repos/linkedin/naarad/contents/{+path}","compare_url":"https://api.github.com/repos/linkedin/naarad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linkedin/naarad/merges","archive_url":"https://api.github.com/repos/linkedin/naarad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linkedin/naarad/downloads","issues_url":"https://api.github.com/repos/linkedin/naarad/issues{/number}","pulls_url":"https://api.github.com/repos/linkedin/naarad/pulls{/number}","milestones_url":"https://api.github.com/repos/linkedin/naarad/milestones{/number}","notifications_url":"https://api.github.com/repos/linkedin/naarad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linkedin/naarad/labels{/name}","releases_url":"https://api.github.com/repos/linkedin/naarad/releases{/id}","created_at":"2013-11-01T23:34:54Z","updated_at":"2014-07-02T08:43:35Z","pushed_at":"2014-07-03T23:40:06Z","git_url":"git://github.com/linkedin/naarad.git","ssh_url":"git@github.com:linkedin/naarad.git","clone_url":"https://github.com/linkedin/naarad.git","svn_url":"https://github.com/linkedin/naarad","homepage":"","size":28148,"stargazers_count":50,"watchers_count":50,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":13,"mirror_url":null,"open_issues_count":43,"forks":13,"open_issues":43,"watchers":50,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linkedin/naarad/pulls/253"},"html":{"href":"https://github.com/linkedin/naarad/pull/253"},"issue":{"href":"https://api.github.com/repos/linkedin/naarad/issues/253"},"comments":{"href":"https://api.github.com/repos/linkedin/naarad/issues/253/comments"},"review_comments":{"href":"https://api.github.com/repos/linkedin/naarad/pulls/253/comments"},"review_comment":{"href":"https://api.github.com/repos/linkedin/naarad/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/linkedin/naarad/pulls/253/commits"},"statuses":{"href":"https://api.github.com/repos/linkedin/naarad/statuses/e9968705d557cd9c5eaf9a72a11241376fd78ffb"}}}}