Granfana+PostgreSQL

 

 

建表:

create table pdm_log(
    id serial primary key,
    date_time timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
    Sealing_Press_Band_Temperature numeric,
    Sealing_Anvil_Band_Temperature numeric,
Cooling_Anvil_Peltier_Temperature numeric, E_Stage_Motor_Temperature numeric, X_Stage_Motor_Temperature numeric, Z_Stage_Motor_Temperature numeric, Cooling_Press_Motor_Temperature numeric, Cooling_Anvil_Motor_Temperature numeric, units varchar )

注意检查和修改时区:

SHOW timezone; //显示时区

SET timezone TO 'US/Pacific'

set timezone to 'prc'; //设置时区为china

  

metrics

SELECT
  $__timeGroup(date_time,'5m') as time,
  min(measurement) as min_value,
  max(measurement) as max_value
FROM cms_log
WHERE $__timeFilter(date_time) and units='Celsius'
GROUP BY time
ORDER BY time

SELECT
  $__time(date_time),
  measurement
FROM
  cms_log
WHERE
  $__timeFilter(date_time)

  

  

posted @ 2017-11-02 11:10  小金乌会发光-Z&M  阅读(1130)  评论(0编辑  收藏  举报