Skip to content

Instantly share code, notes, and snippets.

@danudey
Created August 6, 2009 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danudey/163505 to your computer and use it in GitHub Desktop.
Save danudey/163505 to your computer and use it in GitHub Desktop.
>>> 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