title: Grafana - How to build a singlestat with a percentage uptime
body: <p>I'm collecting a series of http response time of a web site, i'd would create a single stat to display the uptime of the web service based on the interval of the dashboard (in case the response time has been above a X ms or any datapoints aren't available)</p>
  
  <p>Is there a way to generate a singlestat in grafana with a percentage of this kind of data?</p>
  
  <p>For example, my data is stored in a influxdb as:</p>
  
  <pre><code>time                | host   |http_response_code | response_time | url
  --------------------| ------ |------------------ |-------------- |----
  1485441250000000000 | Server1|             200   | 0.005797832   | url1
  </code></pre>
  
  <p>UPDATE FOR MICHAEL QUESTION:</p>
  
  <p>The metric used is built-in in telegraf inputs as:</p>
  
  <pre><code># # HTTP/HTTPS request given an address a method and a timeout
  [[inputs.http_response]]
    address = "http://www.customurl.com/pingpage.html"
    response_timeout = "10s"
    method = "GET"
  </code></pre>
  
  <p>I guess the point in line protocol is:</p>
  
  <pre><code>http_response,
  host=hosttag,
  http_response_code=200,
  method=GET,
  server=servertag response_time=0,01202
  </code></pre>