Skip to content

Instantly share code, notes, and snippets.

@danudey danudey/gist:163505
Created Aug 6, 2009

Embed
What would you like to do?
>>> start = time.gmtime(time.time()-(3600*24*10))
>>> end = time.gmtime()
>>> downtimes = p.downtimesFor(p.checks[0],start,end)
>>> for downtime in downtimes:
... print downtime
...
{'duration': 0, 'to': (2009, 7, 28, 19, 0, 0.0), 'from': (2009, 7, 27, 19, 0, 0.0)}
{'duration': 0, 'to': (2009, 7, 29, 19, 0, 0.0), 'from': (2009, 7, 28, 19, 0, 0.0)}
{'duration': 0, 'to': (2009, 7, 30, 19, 0, 0.0), 'from': (2009, 7, 29, 19, 0, 0.0)}
{'duration': 0, 'to': (2009, 7, 31, 19, 0, 0.0), 'from': (2009, 7, 30, 19, 0, 0.0)}
{'duration': 0, 'to': (2009, 8, 1, 19, 0, 0.0), 'from': (2009, 7, 31, 19, 0, 0.0)}
{'duration': 0, 'to': (2009, 8, 2, 19, 0, 0.0), 'from': (2009, 8, 1, 19, 0, 0.0)}
{'duration': 0, 'to': (2009, 8, 3, 19, 0, 0.0), 'from': (2009, 8, 2, 19, 0, 0.0)}
{'duration': 0, 'to': (2009, 8, 4, 19, 0, 0.0), 'from': (2009, 8, 3, 19, 0, 0.0)}
{'duration': 900, 'to': (2009, 8, 5, 19, 0, 0.0), 'from': (2009, 8, 4, 19, 0, 0.0)}
{'duration': 0, 'to': (2009, 8, 6, 19, 0, 0.0), 'from': (2009, 8, 5, 19, 0, 0.0)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.