1. 统计程序-模板格式定义
- 1. 统计程序-模板格式定义
- 1.1. 修订记录
- 1.2. 文档说明
- 1.3. 概念介绍
- 1.4. 示例
- 1.5. 参数说明
1.1. 修订记录
日期 | 版本 | 说明 | 编写 |
---|---|---|---|
2019-02-22 | 1.4.0(R5) | 增加分析统计 | Zoe |
2019-02-27 | 1.5.0(R1) | 1.统计配置脚本增加rewrite_collectos字段</br>2.修改所有设备读取的一样的离线数据的问题 | Zoe |
2019-04-03 | 2.1.0(R1) | 1.统计增加方差(variance)和协方差(covariance)函数</br>2.修改statistics_extend定时器定时触发逻辑,首次运行会立马执行定时任务,created固定为统一约定的时间</br>3.增加范围过滤,由filter来指定,兼容force_filter | Zoe |
2019-05-14 | 2.2.0(R1) | 1.统计增加标准差(stddev)函数</br>2.统计增加欧几里得距离(euclidean_distance)函数</br>3.统计增加皮尔逊相关系数(pearson)函数</br>4.统计增加综合趋势微分(integrated_trend_differential)函数 | Zoe |
2020-05-06 | 2.2.0(R2) | 文档格式修改 | Roy |
1.2. 文档说明
本文档适用于
statistics_keeper V2.2.0
版本
1.3. 概念介绍
一个统计程序由一个统计由3大要素组成:统计对象,统计方法,统计区间。
1.3.1. 统计对象
- 支持针对标准统计的
GR
,MO
,CU
,EQ
,EV
,FA
,AL
,ME
,ST
,CO
10类统计对象和分析统计的Index
,Stability
,Tendency
,Risk
4类统计对象 总共 14类统计对象的统计。 - 支持四则表达式运算。
1.3.2. 统计方法
表示对统计对象做什么样的统计,计数(
count
),累加(sum
)还是平均数(average
)等等,目前支持15种。
1.3.3. 统计区间
表示对统计对象的取值的采样区间,使用cycle表示。
1.4. 示例
{
"params": {
"connector": {
"INFLUXDB": {
"host": "127.0.0.1:8086"
},
"MYSQL": {
"host": "127.0.0.1:3306"
}
},
"source": {
"MO": {
"object": [
"S54;S54 > 150 || S54 < 120"
]
},
"CO": {
"object": ["PowerMeterRatio;collect_id = 'PowerMeterRatio'"]
}
},
"expr": "accumulate(S54)",
"selection": {
"filter_not": {
"customerID": [
"1004"
]
},
"filter_and": {
"mappingID": [
"1002"
]
}
},
"track": true,
"duration": {
"start": "2018-07-01 00:00:00",
"end": "2018-08-01 12:00:00"
},
"result": {
"precision": 3
},
"cycle": "60m"
},
"force_filter": false,
"tag": "ABC",
"rewrite_collectos":{
"collect_id":"PowerMeterRatio2",
"enable":true
},
"fiilter":{
"force_filter":true,
"min":0,
"max":1000
},
"statistics_id": "totalCumulativeActivePower",
"statos_name": "每小时用电量",
"description": "每小时用电量的统计",
"name": "totalCumulativeActivePower",
"type": "statistics"
}
1.5. 参数说明
1.5.1. connector
- INFLUXDB:
- 定义连接influxdb的参数,格式:
ip:port
- 定义连接influxdb的参数,格式:
- MYSQL:
- 定义连接MYSQL的参数,格式:
ip:port
- 定义连接MYSQL的参数,格式:
1.5.2. source
定义统计的数据源,就是对哪些数据进行统计,支持
MO
,CU
,EQ
,EV
,FA
,AL
,ME
,ST
,CO
,四则运算(+
,-
,*
,/
)总共11大类。
MO
:就是 MOSAIC ,获取 mosaic 的数据CU
:就是 CUSTOMER ,对应的是数据库的 admin_customerEQ
:就是 EQUIPMENT ,对应的是数据库的 admin_equipmentEV
:就是 EVENT ,对应的是数据库的 admin_eventFA
:就是 FAULT ,对应的是数据库的 admin_faultAL
:就是 ALARM ,对应的是数据库的 admin_alarmME
:就是 MESSAGE ,对应的是数据库的 admin_messageST
:就是 STATOS ,对应的是数据库的 admin_statosCO
:就是 COLLECTOS ,对应的是数据库的 admin_collectosIndex
: 对应的是分析项目的 Index(指数)表Stability
:对应的是分析项目的 Stability(稳定性)表Tendency
:对应的是分析项目的 Tendency(趋势)表Risk
:对应的是分析项目的 Risk(风险)表object
: 表示实体对象。- 格式
name[=default_value];condition
- 格式
- 支持逻辑表达式
&&
,||
,>
,>=
,<
,<=
MO
的source目前只能配置一个,其他的source源可以配置多个。示例:配置MO/GR数据源:
"source": {
"MO": {
"object": [
"S02;S02 > 100 && S02 < 120"
"S03" // 配置错误,MO的source配置仅支持一个源
]
}
}
定义数据源S02,并且取值值区间范围为 S02 > 100 && S02 < 120
CU
,EQ
,EV
,FA
,AL
,ME
,ST
,CO
这8类统计数据源是数据库的某个field,支持条件- field必须是数据库存在的.
针对这类统计,表达式
expr
必须是有意义的.示例:配置CU数据源:
"expr":"count(euipment_id)",
"source": {
"CU": {
"object": ["customer_id; customer_id >= '1001'"]
}
}
定义数据源customer_id,并且取值条件为:customer_id >= '1001'
统计customer_id>=1001
另外:1001 必须添加单引号
- 示例:配置EQ数据源:
"expr":"count(euipment_id)",
"source": {
"EQ": {
"object": ["euipment_id; euipment_id >= '1004' && customer_id = '1001' "]
}
}
定义数据源customer_id,并且取值条件为:customer_id >= '1001'
统计设备号>='1004' 并且customer_id = '1001' 的设备有多少
- 错误示例:配置CU数据源:
"expr":"accumulate(euipment_id)",
"source": {
"CU": {
"object": ["customer_id; customer_id >= '1001'"]
}
}
定义数据源customer_id,并且取值条件为:customer_id >= '1001'
统计方法accumulate是错误的表述,相同的有错误表述的统计方法有:max,min,average,sum,accumulate,integral,hour
- 示例:配置CO默认值:
"expr":"accumulate(S04) * A",
"source": {
"MO": {
"object": ["S04"]
},
"CO": {
"object":["A = 1;collect_id = 'OriginalGasElectricityRatio'"]
}
}
配置source
MO的key是S04
CO的key是A,并且A的默认值是1,当任何原因导致没有查询到CO的值的时候,会用设置的默认值替代,如何没有设置默认值,则默认值为0
- 示例:配置分析项目:
"expr":"max(Grad)",
"source": {
"Index": {
"object": ["Grad"]
}
}
配置source
Index的key是Grad
1.5.3. expr
表达式,统计的表达式,针对source块里面定义的值的表达式
- 支持聚合函数
max
,min
,count
,average
,sum
,accumulate
,integral
,hour
,interval
函数内不可嵌套四则运算 - 支持四则运算
- 示例:
"expr":"max(A) + min(B)"
"expr":"accumulate(A) * B"
"expr":"max(A + B)" // 不支持
1.5.3.1. max
- 格式:max(object)
- 说明:在指定范围内对object取最大值
- 示例:
{
"expr":"max(S01)",
"cycle":"60m"
}
取出1小时内的S01值得最大值
1.5.3.2. min
- 格式:min(object)
- 说明:在指定范围内对object取最小值
- 示例:
{
"expr":"min(S01)",
"cycle":"60m"
}
取出1小时内的S01值得最小值
1.5.3.3. count
- 格式:count(object)
- 说明:在指定范围内对object做计数统计
- 示例:
{
"expr":"count(S01)",
"cycle":"60m"
}
取出1小时内的S01值的计数统计
1.5.3.4. average
- 格式:average(object)
- 说明:在指定范围内对object做平均数统计
- 示例:
{
"expr":"average(S01)",
"cycle":"60m"
}
取出1小时内的S01值做平均数统计
1.5.3.5. sum
- 格式:sum(object)
- 说明:在指定范围内对object做求和统计
- 示例:
{
"expr":"sum(S01)",
"cycle":"60m"
}
取出1小时内的S01值做求和统计
1.5.3.6. accumulate
- 格式:accumulate(object)
- 说明:在指定范围内对object做累计值统计(读数转用量)
- 示例:
{
"expr":"accumulate(S01)",
"cycle":"60m"
}
取出1小时内的S01值做累计值统计
1.5.3.7. integral
- 格式:integral(object)
- 说明:在指定范围内对object做积分统计
- 示例:
{
"expr":"integral(S01)",
"cycle":"60m"
}
取出1小时内的S01值做积分统计
1.5.3.8. hour
- 格式:hour(object)
- 说明:在指定范围内对object做耗时统计(非连续)
- 示例:
{
"expr":"hour(S01)",
"cycle":"60m"
}
取出1小时内的S01值做耗时统计(非连续)
1.5.3.9. interval
- 格式:interval(object1,object2)
- 说明:在指定范围内 object1 到 object2 持续多长时间
- 示例:
"source": {
"EV": {
"object": ["code_start;code = 1161",
"code_stop;code = 1160"]
}
},
"expr": "interval(code_start,code_stop)",
"cycle":"60m"
取出1小时内 code_start 到 code_stop 持续多少时间
1.5.3.10. variance
- 格式:variance(object)
- 说明:计算object的方差,object必须是mosaic的单值或者vector,不可配置matrix
- 示例:
> select * from mosaic_1002 where time >= '2019-03-22 18:00:00' and time <= '2019-03-22 19:00:00' order by time desc limit 10;
name: mosaic_1002
time equipmentid gridtime sorttime value
---- ----------- -------- -------- -----
2019-03-22T18:58:09.298177821Z 1002 1553281089297178893 1553252289298177821 {"S01":4717,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4717,2.3,4717,1],"S22":[[4717,2.3],[3,4]]}
2019-03-22T18:58:08.28036485Z 1002 1553281088279344937 1553252288280364850 {"S01":4716,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4716,2.3,4716,1],"S22":[[4716,2.3],[3,4]]}
2019-03-22T18:58:07.260233525Z 1002 1553281087259394265 1553252287260233525 {"S01":4715,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4715,2.3,4715,1],"S22":[[4715,2.3],[3,4]]}
2019-03-22T18:58:06.092396052Z 1002 1553281086091579615 1553252286092396052 {"S01":4714,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4714,2.3,4714,1],"S22":[[4714,2.3],[3,4]]}
2019-03-22T18:58:04.864876839Z 1002 1553281084863705716 1553252284864876839 {"S01":4713,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4713,2.3,4713,1],"S22":[[4713,2.3],[3,4]]}
2019-03-22T18:58:03.854390154Z 1002 1553281083853549670 1553252283854390154 {"S01":4712,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4712,2.3,4712,1],"S22":[[4712,2.3],[3,4]]}
2019-03-22T18:58:02.819916627Z 1002 1553281082818837575 1553252282819916627 {"S01":4711,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4711,2.3,4711,1],"S22":[[4711,2.3],[3,4]]}
2019-03-22T18:58:01.81190973Z 1002 1553281081811070227 1553252281811909730 {"S01":4710,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4710,2.3,4710,1],"S22":[[4710,2.3],[3,4]]}
2019-03-22T18:58:00.803793213Z 1002 1553281080802776365 1553252280803793213 {"S01":4709,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4709,2.3,4709,1],"S22":[[4709,2.3],[3,4]]}
2019-03-22T18:57:59.792919202Z 1002 1553281079792024744 1553252279792919202 {"S01":4708,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4708,2.3,4708,1],"S22":[[4708,2.3],[3,4]]}
示例一:
"source": {
"MO": {
"object": ["S01"]
}
},
"expr": "variance(S01)",
"cycle":"60m"
输出结果是单值 output = variance(vector(S01))
示例二:
"source": {
"MO": {
"object": ["S21"]
}
},
"expr": "variance(S21)",
"cycle":"60m"
S21 是由S01,S02,S01,1组成,所以输出结果是vector
output = [variance(vector(S01)),variance(vector(S02)),variance(vector(S01)),variance(vector(1))]
示例三:
"source": {
"MO": {
"object": ["S22"]
}
},
"expr": "variance(S22)",
"cycle":"60m"
配置方法错误,variance不支持配置的source为matrix
1.5.3.11. covariance
- 格式:covariance(object)
- 说明:计算object的协方差矩阵,object只能是mosaic的vector,不可配置matrix和单值.
- 示例:
> select * from mosaic_1002 where time >= '2019-03-22 18:00:00' and time <= '2019-03-22 19:00:00' order by time desc limit 10;
name: mosaic_1002
time equipmentid gridtime sorttime value
---- ----------- -------- -------- -----
2019-03-22T18:58:09.298177821Z 1002 1553281089297178893 1553252289298177821 {"S01":4717,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4717,2.3,4717,1],"S22":[[4717,2.3],[3,4]]}
2019-03-22T18:58:08.28036485Z 1002 1553281088279344937 1553252288280364850 {"S01":4716,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4716,2.3,4716,1],"S22":[[4716,2.3],[3,4]]}
2019-03-22T18:58:07.260233525Z 1002 1553281087259394265 1553252287260233525 {"S01":4715,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4715,2.3,4715,1],"S22":[[4715,2.3],[3,4]]}
2019-03-22T18:58:06.092396052Z 1002 1553281086091579615 1553252286092396052 {"S01":4714,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4714,2.3,4714,1],"S22":[[4714,2.3],[3,4]]}
2019-03-22T18:58:04.864876839Z 1002 1553281084863705716 1553252284864876839 {"S01":4713,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4713,2.3,4713,1],"S22":[[4713,2.3],[3,4]]}
2019-03-22T18:58:03.854390154Z 1002 1553281083853549670 1553252283854390154 {"S01":4712,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4712,2.3,4712,1],"S22":[[4712,2.3],[3,4]]}
2019-03-22T18:58:02.819916627Z 1002 1553281082818837575 1553252282819916627 {"S01":4711,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4711,2.3,4711,1],"S22":[[4711,2.3],[3,4]]}
2019-03-22T18:58:01.81190973Z 1002 1553281081811070227 1553252281811909730 {"S01":4710,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4710,2.3,4710,1],"S22":[[4710,2.3],[3,4]]}
2019-03-22T18:58:00.803793213Z 1002 1553281080802776365 1553252280803793213 {"S01":4709,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4709,2.3,4709,1],"S22":[[4709,2.3],[3,4]]}
2019-03-22T18:57:59.792919202Z 1002 1553281079792024744 1553252279792919202 {"S01":4708,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4708,2.3,4708,1],"S22":[[4708,2.3],[3,4]]}
"source": {
"MO": {
"object": ["S21"]
}
},
"expr": "covariance(S21)",
"cycle":"60m"
S21 为 mosaic的vector
表示计算60m内S22 的协方差矩阵
结果为矩阵
1.5.3.12. stddev
- 格式:stddev(object)
- 说明:计算object的标准差,object只能是mosaic的单值或者vector,不可配置matrix.
- 示例: 参考variance
1.5.3.13. euclidean_distance
- 格式:euclidean_distance(object,{targetvalue1,targetvalue2,targetvalue3...targetvalueN})
- 说明:
- 计算object的欧几里得距离,object只能是mosaic的单值或者vector,不可配置matrix.
- {targetvalue1,targetvalue2,targetvalue3...targetvalueN}为设置的目标值,如果object为单值,则设置目标值为{targetvalue1},如果object为vector,则设置目标值原色个数根据object个数来定
- 示例:
> select * from mosaic_1002 where time >= '2019-03-22 18:00:00' and time <= '2019-03-22 19:00:00' order by time desc limit 10;
name: mosaic_1002
time equipmentid gridtime sorttime value
---- ----------- -------- -------- -----
2019-03-22T18:58:09.298177821Z 1002 1553281089297178893 1553252289298177821 {"S01":4717,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4717,2.3,4717,1],"S22":[[4717,2.3],[3,4]]}
2019-03-22T18:58:08.28036485Z 1002 1553281088279344937 1553252288280364850 {"S01":4716,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4716,2.3,4716,1],"S22":[[4716,2.3],[3,4]]}
2019-03-22T18:58:07.260233525Z 1002 1553281087259394265 1553252287260233525 {"S01":4715,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4715,2.3,4715,1],"S22":[[4715,2.3],[3,4]]}
2019-03-22T18:58:06.092396052Z 1002 1553281086091579615 1553252286092396052 {"S01":4714,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4714,2.3,4714,1],"S22":[[4714,2.3],[3,4]]}
2019-03-22T18:58:04.864876839Z 1002 1553281084863705716 1553252284864876839 {"S01":4713,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4713,2.3,4713,1],"S22":[[4713,2.3],[3,4]]}
2019-03-22T18:58:03.854390154Z 1002 1553281083853549670 1553252283854390154 {"S01":4712,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4712,2.3,4712,1],"S22":[[4712,2.3],[3,4]]}
2019-03-22T18:58:02.819916627Z 1002 1553281082818837575 1553252282819916627 {"S01":4711,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4711,2.3,4711,1],"S22":[[4711,2.3],[3,4]]}
2019-03-22T18:58:01.81190973Z 1002 1553281081811070227 1553252281811909730 {"S01":4710,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4710,2.3,4710,1],"S22":[[4710,2.3],[3,4]]}
2019-03-22T18:58:00.803793213Z 1002 1553281080802776365 1553252280803793213 {"S01":4709,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4709,2.3,4709,1],"S22":[[4709,2.3],[3,4]]}
2019-03-22T18:57:59.792919202Z 1002 1553281079792024744 1553252279792919202 {"S01":4708,"S02":2.3,"S03":3,"S04":4,"S05":["111","222","333"],"S06":1,"S07":200,"S08":300,"S21":[4708,2.3,4708,1],"S22":[[4708,2.3],[3,4]]}
示例一:
"source": {
"MO": {
"object": ["S02"]
}
},
"expr": "euclidean_distance(S02,{2.3})",
"cycle":"60m"
S02 为 mosaic的 单值
表示计算60m内S02 的欧几里得距离
结果为[0]
示例二:
"source": {
"MO": {
"object": ["S05"]
}
},
"expr": "euclidean_distance(S05,{111,222,33})",
"cycle":"60m"
S05 为 mosaic的 vector
表示计算60m内S05 的欧几里得距离
结果为[0,0,0]
1.5.3.14. pearson
- 格式:pearson(object)
- 说明:计算object的皮尔逊相关系数,object只能是mosaic的vector,并且vector只能有两个元素;不可配置单值或者matrix
- 示例: 配置方法参考variance
1.5.3.15. integrated_trend_differential
- 格式:integrated_trend_differential(object)
- 说明:计算object的综合趋势微分,object只能是mosaic的单值.
- 示例: 配置方法参考variance
1.5.4. selection
对哪些设备进行统计.
- filter_and: 表示可以选择多个,
and
的意思理解为和
- filter_not: 表示排除之外选择。
支持四种类型的方式过滤设备
equipmentID
,customerID
,mappingID
,projectID
projectID
只针对分析项目的统计- 分析统计项目的projectID 有几种写法:
分析项目:设备
表示对分析项目下的某个设备进行分析统计,例如"projectID":["test:1010"]
分析项目:
表示对分析项目下的所有设备进行分析统计,例如"projectID":["test:"]
填写多个分析项目
例如"projectID":["test:","ABC:1001"]
1.5.4.1. 示例1
"selection": {
"filter_not":{
"customerID":["1004"]
},
"filter_and":{
"equipmentID":["1006","1007","1008","1002"]
}
}
对customerID=1004之外设备并且 加上equipmentID=1006,1007,1008,1002的设备进行统计
1.5.4.2. 示例2
"selection": {
"filter_not":{
}
}
对目前系统的所有设备进行统计
1.5.4.3. 示例3
"selection": {
"filter_and":{
"projectID":["test:1010","abc:1010","ABC:1100","jichai:"]
}
}
表示对test分析项目下面的1010 设备,abc分析项目下面的1010设备,ABC分析项目下面的1100设备,jichai分析项目下面的所有设备进行分析统计
1.5.4.4. 示例4
"selection": {
"filter_and":{
"equipmentID":["1006","1007","1008","1002"]
}
}
对equipmentID=1006,1007,1008,1002的设备进行统计
1.5.5. rewrite_collectos
是否将expr的结果同时回写到admin_collectos数据库表,只有配置了CO的source,并且CO的source源只有一个的时候,rewrite_collectos的选项才能够起作用,rewrite_collectos一般用作维保任务。
"expr": "PowerMeterRatio - int(max(PowerConsumption))",
"source": {
"MO": {
"object": ["PowerConsumption"]
},
"CO": {
"object": ["PowerMeterRatio;collect_id = 'PowerMeterRatio'"]
}
},
"rewrite_collectos":{
"collect_id":"PowerMeterRatio2",
"enable":true
}
上面的配置表示将expr计算的结果的值会同时保存admin_statos和admin_collectos表,保存admin_collectos表的时候,collect_id是PowerMeterRatio2
1.5.6. track
调试开关,开启之后程序会打印更多的信息.
1.5.7. duration
统计的时间范围,主要用于手动运行统计程序.配合cycle一起使用
1.5.7.1. 示例
"duration":{
"start":"2018-07-01 00:00:00",
"end":"2018-08-01 00:00:00"
},
"cycle":"60m"
表示统计时间段2018-07-01 00:00:00 - 2018-08-01 00:00:00,统计程序取数据的范围是60m
1.5.8. cycle
统计程序统计累积量的计算范围.
1.5.9. statistics_id
统计程序的统计ID
1.5.10. statos_name
统计程序的名称
1.5.11. name
统计程序可执行文件的名称
1.5.12. result
1.5.12.1. precision
统计结果的精度
1.5.13. type
标识这个统计脚本是用于统计还是计算 type的值有
statistics
,calculate
;statistics用于统计,calculate用于计算
1.5.14. force_filter
是否启动强制过滤的功能,读数转用量的函数accumulate,对于适配器上报的数据,是否需要对增长幅度进行过滤,默认值为false
1.5.15. filter
范围过滤,需要指定最大值(默认不指定为600000),最小值(默认不指定为0)
示例:
"force":{
"force_filter":true,
"min":0,
"max":10000
}
只有指定force_filter = true 的时候,范围过滤才有效。
范围过滤针对accumulate函数,对用量进行过滤min和max之间指的是不被过滤掉的范围.
1.5.16. 注意
- 如果要单独执行统计程序要将statistics_id,statos_name,name 写入到parmas的json块,并且把params保存为json文件
- 分析项目的函数只有
max
,min
,average
,integral
,hour
5种