Fixed and pushed

From: Ritesh Maheshwari <notifications@github.com<mailto:notifications@github.com>>
Reply-To: linkedin/naarad <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Thursday, March 13, 2014 2:33 PM
To: linkedin/naarad <naarad@noreply.github.com<mailto:naarad@noreply.github.com>>
Cc: Shaoshan Liu <shliu@linkedin.com<mailto:shliu@linkedin.com>>
Subject: Re: [naarad] Extend Diff to support URL based CDF csv file paths, also Fix issue 149: cdf not plotted for sar important metrics (#155)


In src/naarad/metrics/metric.py:

> @@ -284,6 +284,17 @@ def plot_timeseries(self, graphing_library = 'matplotlib'):
>        if graphed:
>          self.plot_files.append(div_file)
>      return True
> +
> +  def check_important_sub_metrics(self, sub_metric):
> +    """
> +    check whether the given sub metric is in important_sub_metrics list
> +    """
> +    items = sub_metric.split('.')
> +    if sub_metric in self.important_sub_metrics:
> +      return True
> +    if items[len(items)-1] in self.important_sub_metrics:


No need to do items[len(items)-1], python way is to do items[-1] directly to access last element.

—
Reply to this email directly or view it on GitHub<https://github.com/linkedin/naarad/pull/155/files#r10589800>.