Using ES 1.2.2

The below aggregation will give me my average requests per second and the 
average response times for each second.
Is this the only way to do it or is there better way? Since scripting is a 
bit slow?

"aggs": {
        "tps": {
          "date_histogram": {
            "field": "stampStart",
            "interval": "second",
            "order": {
              "_key": "asc"
            }
          },
          "aggs": {
            "avg_resp": {
              "avg": {
                "script": "doc.stampEnd.value - doc.stampStart.value"
              }
            }
          }
        }
      }

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/a618c94b-f79a-494a-9d12-0327cb9eff5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to