JeetShetty / GreenPiThumb

https://mtlynch.io/greenpithumb/
Apache License 2.0
82 stars 12 forks source link

Changing timestamp serialization for database #101

Closed mtlynch closed 7 years ago

mtlynch commented 7 years ago

dateutil's parsing is apparently very slow because it has to do a lot of regexing on the date string to figure out its format automatically. We don't strictly need this because we can just serialize it to a format that's easier to parse back.

This changes the date serialization so that dates are always stored as UTC times (so that we don't have to try to serialize/deserialize time zone). This also removes milliseconds precision from the serialized format because it wasn't a deliberate choice to add it and the timestamps probably aren't precise to the millisecond of when the sensor was read.

This should fix #98.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.1%) to 81.299% when pulling 1b2b3dc7390e6520fc1e9fcaff907a6e1da049ce on mtlynch:faster-parsing into a4c037958cb092233f2a6c2ab893cae407c26d48 on JeetShetty:master.