Skip to content

Instantly share code, notes, and snippets.

@bdkosher
Created December 18, 2014 21:01
Show Gist options
  • Save bdkosher/8481f6ad645f476a5c3f to your computer and use it in GitHub Desktop.
Save bdkosher/8481f6ad645f476a5c3f to your computer and use it in GitHub Desktop.
What's the impact on availability due to a single outage?
import groovy.time.*
def (from, to) = ['12/16/2014 2:52 PM','12/18/2014 3:32 PM'].collect { Date.parse('MM/dd/yyyy h:mm a', it) }
int minutesDown = TimeCategory.minus(to, from).toMilliseconds() / 1000 / 60
int minutesPerYear = 365 * 24 * 60
(minutesPerYear - minutesDown) / minutesPerYear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment