Why is an output like this possible in InfluxDB?

28 Views Asked by At

I have a database which measures ping times between certain servers. This is my aggregated query for plotting a history of the ping times:

from(bucket: "{self.team.id}")
    |> range(start: {from_ts.isoformat()}, stop: {to_ts.isoformat()})
    |> filter(fn: (r) => r["_measurement"] == "{self.id}" and (r["_field"] == "ping_time"))
    |> aggregateWindow(every: 5m, fn: max, createEmpty: true)
    |> yield(name: "high_ping")
    |> aggregateWindow(every: 5m, fn: min, createEmpty: true)
    |> yield(name: "low_ping")
    |> aggregateWindow(every: 5m, fn: mean, createEmpty: true)
    |> yield(name: "avg_ping")
from(bucket: "{self.team.id}")
    |> range(start: {from_ts.isoformat()}, stop: {to_ts.isoformat()})
    |> filter(fn: (r) => r["_measurement"] == "{self.id}" and (r["_field"] == "is_success" and r["_value"] == true))
    |> aggregateWindow(every: 5m, fn: count, createEmpty: true)
    |> yield(name: "up_count")
from(bucket: "{self.team.id}")
    |> range(start: {from_ts.isoformat()}, stop: {to_ts.isoformat()})
    |> filter(fn: (r) => r["_measurement"] == "{self.id}" and (r["_field"] == "is_success" and r["_value"] == false))
    |> aggregateWindow(every: 5m, fn: count, createEmpty: true)
    |> yield(name: "down_count")
from(bucket: "{self.team.id}")
    |> range(start: {from_ts.isoformat()}, stop: {to_ts.isoformat()})
    |> filter(fn: (r) => r["_measurement"] == "{self.id}" and (r["_field"] == "is_success"))
    |> aggregateWindow(every: 5m, fn: count, createEmpty: true)
    |> yield(name: "all_count")

The (formatted) output it gives me over a certain period of time is as follows:

23:15: {'all_count': 1, 'high_ping': 445, 'low_ping': None, 'avg_ping': None, 'up_count': 1}
23:20: {'all_count': 6, 'high_ping': 332, 'low_ping': 445, 'avg_ping': None, 'up_count': 6}
23:25: {'all_count': 0, 'high_ping': None, 'low_ping': 332, 'avg_ping': 445.0, 'up_count': 0}
23:30: {'all_count': 0, 'high_ping': None, 'low_ping': None, 'avg_ping': 332.0, 'up_count': 0}

How is this output possible? If there is a Point at 23:15 (indicated by the all_count and the high_ping), how is it possible to have no avg_ping and no low_ping?

0

There are 0 best solutions below