Average of new sample data each 10secs

Hello,
First thanks for your help. I do have the following question. I do have data incoming every 10 secondes as :

state
name : srv1
value : 30

state
name : srv3
value : 15

state
name : srv2
value : 20

I’ve used the top hit with size = 3, than the aggregate SUM. So far everything is fine.

However, If one server do not send anymore data (ex : srv1) I do have twice either srv3 or srv2 value leading to a false average.

Any idea how to by-pass this issue ?
Dynamic size limit ? Enforce distinct values before top hit ?
Thanks

One way I would consider doing this is by bucketing the top hit aggregation by server in a data table visualization. Then you can add a total column that averages or sums the total value for all three servers. It does not enforce any constraint on having all three servers, but at least you would notice if one or more servers are missing.