GitHub PullRequestReviewCommentEvent at 2014-03-05 20:24:26
Repository: naarad
Actor: SharadGandhi
Payload: {"comment":{"url":"https://api.github.com/repos/linkedin/naarad/pulls/comments/10316685","id":10316685,"diff_hunk":"@@ -331,3 +328,40 @@ def graph(self, graphing_library = 'matplotlib'):\n       if graphed:\n         self.plot_files.append(div_file)\n     return True\n+\n+  def plot_cdf(self, graphing_library = 'matplotlib'):\n+    \"\"\"\n+    plot CDF for important sub-metrics \n+    \"\"\"\n+    graphed = False\n+    for percentile_csv in self.percentiles_files:\n+      csv_filename = os.path.basename(percentile_csv)\n+      # The last element is .csv, don't need that in the name of the chart\n+      column = self.csv_column_map[percentile_csv.replace(\".percentiles.\", \".\")]\n+      column = naarad.utils.sanitize_string(column)\n+      if column not in self.important_sub_metrics:\n+        continue\n+      graph_title = '.'.join(csv_filename.split('.')[0:-1])\n+      if self.sub_metric_description and column in self.sub_metric_description.keys():\n+        graph_title += ' ('+self.sub_metric_description[column]+')'\n+      if self.sub_metric_unit and column in self.sub_metric_unit.keys():\n+        plot_data = [PD(input_csv=percentile_csv, csv_column=1, series_name=graph_title, y_label=column +' ('+ self.sub_metric_unit[column]+')', precision=None, graph_height=600, graph_width=1200, graph_type='line')]\n+      else:\n+        plot_data = [PD(input_csv=percentile_csv, csv_column=1, series_name=graph_title, y_label=column, precision=None, graph_height=600, graph_width=1200, graph_type='line')]\n+      graphed, div_file = Metric.graphing_modules[graphing_library].graph_data(plot_data, self.resource_directory, self.resource_path, graph_title, 'cdf')\n+      if graphed:\n+        self.plot_files.append(div_file)\n+    return True\n+\n+  def graph(self, graphing_library = 'matplotlib'):\n+    \"\"\" \n+    graph generates two types of graphs\n+    'time': generate a time-series plot for all submetrics (the x-axis is a time series)\n+    'cdf': generate a CDF plot for important submetrics (the x-axis shows percentiles)\n+    \"\"\"\n+    html_string = []\n+    html_string.append('<h1>Metric: {0}</h1>\\n'.format(self.metric_type))","path":"src/naarad/metrics/metric.py","position":75,"original_position":75,"commit_id":"ccab065777c2fdbbcf4c1dd85dca56e01972bc6e","original_commit_id":"22723fb62fe031c14cb5df0ece3d881486411fc7","user":{"login":"SharadGandhi","id":5845822,"avatar_url":"https://gravatar.com/avatar/a1e6f78e829a5cfae6f2088d09ee7d4f?d=https%3A%2F%2Fidenticons.github.com%2Ffacad4f5014a744bd6ad647255845cf2.png&r=x","gravatar_id":"a1e6f78e829a5cfae6f2088d09ee7d4f","url":"https://api.github.com/users/SharadGandhi","html_url":"https://github.com/SharadGandhi","followers_url":"https://api.github.com/users/SharadGandhi/followers","following_url":"https://api.github.com/users/SharadGandhi/following{/other_user}","gists_url":"https://api.github.com/users/SharadGandhi/gists{/gist_id}","starred_url":"https://api.github.com/users/SharadGandhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SharadGandhi/subscriptions","organizations_url":"https://api.github.com/users/SharadGandhi/orgs","repos_url":"https://api.github.com/users/SharadGandhi/repos","events_url":"https://api.github.com/users/SharadGandhi/events{/privacy}","received_events_url":"https://api.github.com/users/SharadGandhi/received_events","type":"User","site_admin":false},"body":"Ye, line 362 & 363 can be deleted. Its leftover of initial naarad report","created_at":"2014-03-05T20:24:26Z","updated_at":"2014-03-05T20:24:26Z","html_url":"https://github.com/linkedin/naarad/pull/143#discussion_r10316685","pull_request_url":"https://api.github.com/repos/linkedin/naarad/pulls/143","_links":{"self":{"href":"https://api.github.com/repos/linkedin/naarad/pulls/comments/10316685"},"html":{"href":"https://github.com/linkedin/naarad/pull/143#discussion_r10316685"},"pull_request":{"href":"https://api.github.com/repos/linkedin/naarad/pulls/143"}}}}