[Commotion-admin] [mlab-observatory] Adding sample checking module, Telescope data parser (#29)
Peter Boothe
notifications at github.com
Tue Dec 9 17:57:32 EST 2014
> + the same dataset and aggregating the results).
> +
> + Args:
> + filename: (str) Name of file to add to blacklist database.
> + """
> + parsed_metadata = telescope_data_parser.parse_filename_for_metadata(
> + filename)
> +
> + # only base list on download throughput
> + if parsed_metadata['metric_name'] != 'download_throughput':
> + return
> +
> + with open(filename, 'r') as data_file:
> + parsed_data = telescope_data_parser.parse_data_file(data_file)
> +
> + self._sample_counter.add_to_counts(parsed_metadata, parsed_data)
Should go in the with:, otherwise will crash when we can't open the filename
---
Reply to this email directly or view it on GitHub:
https://github.com/opentechinstitute/mlab-observatory/pull/29/files#r21570517
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.chambana.net/pipermail/commotion-admin/attachments/20141209/dd65a69f/attachment.html>
More information about the Commotion-admin
mailing list