title: Calculation average request time using InfluxDB on Grafana
body: <p>I am using influx to save metrics.
  I am trying to create a dashboard in grafana that will show the average execution time of a method per hour.</p>
  <p>This is my query for calculating execution time of a method:</p>
  <p><a href="https://i.stack.imgur.com/dlpIr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dlpIr.png" alt="enter image description here" /></a></p>
  <p>raw sql:
  <a href="https://i.stack.imgur.com/s3XRz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s3XRz.png" alt="enter image description here" /></a></p>
  <p>The query to calculate the average time.</p>
  <pre><code>SELECT MEAN(&quot;sum&quot;) FROM &quot;autogen&quot;.&quot;pfr_timed_http_request&quot; 
  WHERE &quot;method&quot;='request' AND $timeFilter 
  GROUP BY time(1h) fill(null)
  </code></pre>
  <p>But if the execution time graph looks like the truth, then the average execution time graph looks strange.
  The average should be about 4s, but it is even much less than 1. Perhaps this is due to the fact that the calculation includes null as 0. Can they be excluded from the calculation?
  What am I doing wrong?
  ![enter image description here
  <a href="https://i.stack.imgur.com/PN0rK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PN0rK.png" alt="enter image description here" /></a></p>