Hey guys,
first off: great library guys, really makes working with the atlas nodes easy :-)
Right now I am having some trouble seeting up measurments on nodes, as it keeps exploding in my face due to some problem with the time stamps.
Right now I just want to make sure I didn't make some stupid mistake....
So, I was following your basic examples in your documention and therefore stated the start time by using:
datetime.datetime.utcnow()
Which then gives my this as on output:
Current time UTC is: 2016-02-17 05:42:14.802293 == 1455655334
Current time is: 2016-02-17 14:42:14.802372 == 1455687734
Measurement starts at: 2016-02-17 05:44:14.802278 == 1455655454
--->Shit went wrong
Atlas start: 1455655454
T_Time: 1455655454
{'status': 400, 'detail': 'start_time: Ensure this value is greater than or equal to 1455687970.', 'title': None, 'code': 104}
from a starting a simple DNS query following the example "Creating a measurment" in your docs.
I am currently working in Japan, therefore UTC and my timestamp differ.
So far, no harm done - I can just use my currenty time stamp - meaning
I can submit those request, but then my measurments will not start right away but in 8 hours (=time difference between UTC and Tokyo time).
As far as I see, somewhere along the way, something gets mixed up with the time stamps!
No I am not sure if I missinterpreted the documention of your tools somehow and made a mistake along the way or if this is acutally an issue.
e.g. in ripe-atlas-cousteau/ripe/atlas/cousteau/api_listing.py, l.63ff., you reduce several objects to simpler objects, i.e.:
for k, v in self.api_filters.items():
if isinstance(v, datetime): # datetime > UNIX timestamp
self.api_filters[k] = int(calendar.timegm(v.timetuple()))
if isinstance(v, (tuple, list)): # tuples & lists > x,y,z
self.api_filters[k] = ",".join([str(_) for _ in v])
Yet, on my computer, I get this:
>>> import datetime
>>> import calendar
>>> datetime.datetime.utcnow()
datetime.datetime(2016, 2, 17, 5, 33, 34, 832888)
>>> datetime.datetime.utcnow().timetuple()
time.struct_time(tm_year=2016, tm_mon=2, tm_mday=17, tm_hour=5, tm_min=34, tm_sec=16, tm_wday=2, tm_yday=48, tm_isdst=-1)
>>> datetime.datetime.utcnow().strftime("%s")
'1455654879'
>>> calendar.timegm(datetime.datetime.utcnow().timetuple())
1455687298
This explains at least why I get an error when using the normal UTC time...
Anyways, sorry for the long text, hope it is all understandable.
I'd love your oppinion on this :)
Cheers,
Chris