Updated pull request based on your latest comments.

Thanks!

Shaoshan

From: Sharad Gandhi <notifications@github.com<mailto:notifications@github.com>>
Reply-To: linkedin/naarad <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Thursday, March 6, 2014 10:10 AM
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] Add CDF support to Naarad (#143)


In src/naarad/reporting/diff.py:

> +    Extract SLAs from a set of rules
> +    """
> +    rules_list = rules.split()
> +    for rule in rules_list:
> +      if '<' in rule:
> +        stat, threshold = rule.split('<')
> +        sla = SLA(sub_metric, stat, float(threshold), 'lt')
> +      elif '>' in rule:
> +        stat, threshold = rule.split('>')
> +        sla = SLA(sub_metric, stat, float(threshold), 'gt')
> +      else:
> +        logger.error('Unsupported SLA type defined : ' + rule)
> +        sla = None
> +      self.sla_map[sub_metric][stat] = sla
> +
> +  def extract_sla_from_config_file(self, optf):


We should move this to naarad.utils.parse_basic_metric_options() and pass the kwargs into diff

—
Reply to this email directly or view it on GitHub<https://github.com/linkedin/naarad/pull/143/files#r10352783>.