Closed kvc0 closed 8 years ago
Please note that avg:key
works as expected, giving 3.75 after considering all values for key
.
Hilarious (obvious) workaround I've been using in case an intrepid Googler finds this:
.es(q="*",metric="sum:key").divide(.es(q="*",metric="avg:key"))
The count agg is a pseudo-agg that counts the number of documents, not the length of an array: Eg "sum:bytes", or just "count"
Currently if you have documents like
{"key":2}
{"key":[4,4,5]}
in Elasticsearch and try to do a.es(q="*",metric="count:key")
, Timelion validation passes and I expect a data point with 4 (1 from the first document, 3 from the second) - however, I get 2. Count is unaware of arrays, though it lets you specify fields to count: Count should count values, not keys.