Ignore system logging in quries
This commit is contained in:
@@ -50,7 +50,7 @@ export async function queryCurrent() {
|
|||||||
const flux = `
|
const flux = `
|
||||||
from(bucket: "${c.INFLUX_BUCKET}")
|
from(bucket: "${c.INFLUX_BUCKET}")
|
||||||
|> range(start: -1h)
|
|> range(start: -1h)
|
||||||
|> filter(fn: (r) => r._measurement =~ /.*/)
|
|> filter(fn: (r) => r._measurement != "system")
|
||||||
|> last()
|
|> last()
|
||||||
|> pivot(rowKey: ["_time"], columnKey: ["_field"], valueColumn: "_value")
|
|> pivot(rowKey: ["_time"], columnKey: ["_field"], valueColumn: "_value")
|
||||||
`
|
`
|
||||||
@@ -67,7 +67,7 @@ export async function queryHourly(start, end) {
|
|||||||
const flux = `
|
const flux = `
|
||||||
from(bucket: "${c.INFLUX_BUCKET}")
|
from(bucket: "${c.INFLUX_BUCKET}")
|
||||||
|> range(start: ${start}, stop: ${end})
|
|> range(start: ${start}, stop: ${end})
|
||||||
|> filter(fn: (r) => r._measurement =~ /.*/)
|
|> filter(fn: (r) => r._measurement != "system")
|
||||||
|> aggregateWindow(every: 1h, fn: mean, createEmpty: false)
|
|> aggregateWindow(every: 1h, fn: mean, createEmpty: false)
|
||||||
|> pivot(rowKey: ["_time"], columnKey: ["_field"], valueColumn: "_value")
|
|> pivot(rowKey: ["_time"], columnKey: ["_field"], valueColumn: "_value")
|
||||||
`
|
`
|
||||||
@@ -80,7 +80,7 @@ export async function queryHourly(start, end) {
|
|||||||
|
|
||||||
export async function queryDaily(start, end) {
|
export async function queryDaily(start, end) {
|
||||||
const { c } = getClient()
|
const { c } = getClient()
|
||||||
const measurements = ['environment', 'light', 'seismic', 'compass', 'accumulation', 'lightning', 'gps']
|
const measurements = ['accumulation', 'environment', 'light', 'lightning', 'seismic']
|
||||||
const results = {}
|
const results = {}
|
||||||
|
|
||||||
for (const m of measurements) {
|
for (const m of measurements) {
|
||||||
|
|||||||
Reference in New Issue
Block a user