title: elasticsearch avg query and fetch time
body: <p>how do i calculate average query and fetch time on my elasticsearch server. <a href="http://mysearver.com:9200/_stats" rel="nofollow">http://mysearver.com:9200/_stats</a> gives me the query_time and fetch_time. But this values keep incrementing on each search. I need avg query time and fetch time of the querys and plot it on a graph. </p>
  
  <p>I tried query_time/query_total , this value also increase on each query and then stays on that after the query has stopped. </p>
  
  <p>This is what i have tried so far</p>
  
  <pre><code>url = 'http://localhost:9200/_stats'
  raw_data = urllib2.urlopen(url)
  data = json.loads(raw_data.readline())
  QueryTime = data['_all']['total']['search']['query_time_in_millis']
  QueryTotal = data['_all']['total']['search']['query_total']
  AvgQueryTime = QueryTime/flaot(QueryTotal)
  </code></pre>