Thanks, I have updated the code changes by incorporating your comments, please let me know whether that is ok to go in.

Shaoshan

From: Ritesh Maheshwari <notifications@github.com<mailto:notifications@github.com>>
Reply-To: linkedin/naarad <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Friday, February 21, 2014 10:47 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 Android RUM support to Naarad (#124)


In src/naarad/metrics/android_rum_metric.py:

> +    if not os.path.isdir(self.outdir):
> +      os.makedirs(self.outdir)
> +    if not os.path.isdir(self.resource_directory):
> +      os.makedirs(self.resource_directory)
> +
> +    results = {}
> +    ts = None
> +
> +    # set output csv
> +    launch_time_file = self.get_csv('launchtime')
> +    nus_update_time_file = self.get_csv('nusupdatetime')
> +
> +    # get Android RUM input data: for each line, generate (timestamp, launch_time, nus_update_time)
> +    with open(self.infile, 'r') as inf:
> +      for line in inf:
> +        data = json.loads(line)


I think its ValueError, but the point is that if the input file has some bad data which cannot be converted into JSON, we don't want the whole parsing to fail. Without catching the exception, naarad will die right now if it encounters bad data.

—
Reply to this email directly or view it on GitHub<https://github.com/linkedin/naarad/pull/124/files#r9956574>.