title: Grafana: How to have the duration for a selected period
body: <p>I can't find the correct mathematical formula to compute a SLA (availability) with Grafana:
  I have graph to show the duration of downtime for each days:
  <a href="https://i.stack.imgur.com/jzChI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jzChI.png" alt="Graph here" /></a>
  From this, i would like to compute the SLA (eg: 99,5%).</p>
  <p>On the graph for the selected period (Last 7 days) i can to have this data:</p>
  <ul>
  <li>71258 is the sum of duration of downtime in second. I have this with summarize(1day, max, false)</li>
  <li>I need to have the sum of duration of time for the selected period (here 7 days = 604800second). But how ?</li>
  </ul>
  <p>If i have this last data, after i will do :</p>
  <blockquote>
  <p>(100% * 604800) / 71258 = X %</p>
  <p>100% - X % = My SLA!!</p>
  </blockquote>
  <p>My question is: Which formula use to have the duration for a selected period in Grafana ?</p>