botify-labs / simpleflow

Python library for dataflow programming.
https://botify-labs.github.com/simpleflow/
MIT License
68 stars 24 forks source link

Workflow history : ISO dates #81

Closed zallek closed 8 years ago

zallek commented 8 years ago

Dates in workflow history doesn't have their timezone making it really hard to compare with other dates like in this example https://github.com/botify-hq/botify-workflow-dashboard/blob/master/test/utils/workflowFile/input-0.json where tasks and metrology steps aren't in the same timezone.

https://github.com/botify-labs/simpleflow/blob/4317a13b78de57f4394882e13abafcba0fc1651e/simpleflow/history.py#L31

"scheduled_timestamp": "2015-12-02T10:42:27.045000",
"started_timestamp": "2015-12-02T10:42:27.145000",
"completed_timestamp": "2015-12-02T10:47:01.593000",
"timed_out_timestamp":
"failed_timestamp"
"cancelled_timestamp"

BTW: timestamps are number of milliseconds since 1 jan 1970. So in the workflow history file, timestamps are actually datetimes and times are timestamps.

ybastide commented 8 years ago

swf.models.event.base.Event#timestamp:

return datetime.fromtimestamp(self._timestamp, tz=pytz.UTC)

?

jbbarth commented 8 years ago

See #91, the timezone problem should be fixed when we deploy simpleflow 0.11.4 ; as for the fact we call "timestamp" things that are in fact "dates", we'll address that later, it won't be nice to change :/