Snmp2Mysql/Schema/grafana-throughput-query.sql
Wolfgang Hottgenroth 161472ad5c grafana query
2017-12-08 12:06:20 +01:00

20 lines
762 B
SQL

select
UNIX_TIMESTAMP(g1.ts) as time_sec,
g1.description as metric,
non_negative_value(
((g1.value - (select g2.value from grafana_v g2 where g2.ts < g1.ts and g2.description = metric order by ts desc limit 1)) / (UNIX_TIMESTAMP(g1.ts) - UNIX_TIMESTAMP((select g3.ts from grafana_v g3 where g3.ts < g1.ts and g3.description = metric order by ts desc limit 1)))),
((4294967296 + g1.value - (select g2.value from grafana_v g2 where g2.ts < g1.ts and g2.description = metric order by ts desc limit 1)) / (UNIX_TIMESTAMP(g1.ts) - UNIX_TIMESTAMP((select g3.ts from grafana_v g3 where g3.ts < g1.ts and g3.description = metric order by ts desc limit 1))))
) as value
from grafana_v g1
where g1.description = 'VDSL In-gateway'
order by g1.ts asc;