[Commotion-admin] [mlab-observatory] Changing semantics of ObservatoryFileWriter so that the caller does not ... (#35)

mtlynch notifications at github.com
Wed Jan 7 16:18:43 EST 2015


>      for date, values in hourly_items:
>        values['month'] = date.month
>        values['hour'] = date.hour
>        values['year'] = date.year
> -    fields = ['month', 'hour', 'year',]
> -    fields.extend(self._metric_field_names)
> +      for field_name in sorted(values.keys()):

It's kind of silly awkwardness because I wanted the month, hour, year fields to be first so that they're the first columns. Partly because I was concerned that the Observatory code might depend on column order (which is why it's month/hour/year instead of year/month/hour) but I just checked and it doesn't, so I should make it a reasonable order.

The other reason is that when you visually inspect the CSV (which will need to happen), it's a lot easier to read if the dates are the leftmost columns. I think I can still use sets and do this in a pretty simple way.

---
Reply to this email directly or view it on GitHub:
https://github.com/opentechinstitute/mlab-observatory/pull/35/files#r22616757
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.chambana.net/pipermail/commotion-admin/attachments/20150107/f4d08ba3/attachment.html>


More information about the Commotion-admin mailing list