grafana query
This commit is contained in:
19
Schema/grafana-throughput-query.sql
Normal file
19
Schema/grafana-throughput-query.sql
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
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;
|
@ -9,7 +9,8 @@ create or replace view grafana_v as
|
|||||||
collecteddata_t da
|
collecteddata_t da
|
||||||
where de.id = ddi.device and
|
where de.id = ddi.device and
|
||||||
di.id = ddi.dataitem and
|
di.id = ddi.dataitem and
|
||||||
da.devicedataitem = ddi.id;
|
da.devicedataitem = ddi.id and
|
||||||
|
di.multiplicator != 0;
|
||||||
|
|
||||||
|
|
||||||
create or replace view grafana_plain_v as
|
create or replace view grafana_plain_v as
|
||||||
|
Reference in New Issue
Block a user