计数如何在ScadaLTS中每秒保存数据

时间:2017-09-28 11:56:09

标签: scadalts

为ScadaLTS创建基准, 谁检查每秒在数据库中存储的数据量。

创建数据源

enter image description here

复制三次

enter image description here

启用每个数据源和数据点。

如何计算ScadaLTS中的每秒数据?

1 个答案:

答案 0 :(得分:1)

您可以使用SQL执行此操作:

select 
count(*),
 YEAR(from_unixtime(ts/1000)),
        MONTH(from_unixtime(ts/1000)),
        DAY(from_unixtime(ts/1000)),
        hour(from_unixtime(ts/1000)),
        minute(from_unixtime(ts/1000)),
        second(from_unixtime(ts/1000))
from pointValues 
where
  YEAR(from_unixtime(ts/1000))  = YEAR(NOW()) and
  MONTH(from_unixtime(ts/1000))  = Month(NOW()) and
  DAY(from_unixtime(ts/1000))  = DAY(NOW())
group by
    YEAR(from_unixtime(ts/1000)),
        MONTH(from_unixtime(ts/1000)),
        DAY(from_unixtime(ts/1000)),
        hour(from_unixtime(ts/1000)),
        minute(from_unixtime(ts/1000)),
        second(from_unixtime(ts/1000))
Having count(*) >5
order by count(*) DESC