fix
This commit is contained in:
parent
b2d56f628e
commit
8b4c149651
@ -14,6 +14,10 @@
|
|||||||
-define(HOST_STATUS_OFFLINE, 2).
|
-define(HOST_STATUS_OFFLINE, 2).
|
||||||
-define(HOST_STATUS_DELETE, 3).
|
-define(HOST_STATUS_DELETE, 3).
|
||||||
|
|
||||||
|
%% 终端状态
|
||||||
|
-define(TERMINAL_STATUS_OFFLINE, 0).
|
||||||
|
-define(TERMINAL_STATUS_ONLINE, 1).
|
||||||
|
|
||||||
%% cpu相关
|
%% cpu相关
|
||||||
-record(cpu_metric, {
|
-record(cpu_metric, {
|
||||||
%% cpu编号
|
%% cpu编号
|
||||||
@ -48,6 +52,20 @@
|
|||||||
status
|
status
|
||||||
}).
|
}).
|
||||||
|
|
||||||
|
%% 终端指标收集
|
||||||
|
-record(terminal_metric, {
|
||||||
|
%% 标识
|
||||||
|
symbol :: binary(),
|
||||||
|
%% 名称
|
||||||
|
name :: binary(),
|
||||||
|
%% 当前最新值
|
||||||
|
last_value = 0 :: number(),
|
||||||
|
%% 历史值序列, 队列;保存最近的100数值, 格式为: [{ts, value}]
|
||||||
|
serial_values = [] :: queue(),
|
||||||
|
%% 最后更新时间
|
||||||
|
update_ts = 0 :: integer()
|
||||||
|
}).
|
||||||
|
|
||||||
%% 主机定义
|
%% 主机定义
|
||||||
-record(host, {
|
-record(host, {
|
||||||
%% ID
|
%% ID
|
||||||
@ -66,10 +84,10 @@
|
|||||||
status = ?HOST_STATUS_INACTIVE :: integer()
|
status = ?HOST_STATUS_INACTIVE :: integer()
|
||||||
}).
|
}).
|
||||||
|
|
||||||
%% 主机指标
|
%% 主机指标, 主机和指标之间是一对一的关系,可以分离出新的表
|
||||||
-record(host_metric, {
|
-record(host_metric, {
|
||||||
%% ID
|
%% ID
|
||||||
id :: binary(),
|
host_id :: binary(),
|
||||||
%% cpu相关
|
%% cpu相关
|
||||||
cpus = [],
|
cpus = [],
|
||||||
%% cpu温度
|
%% cpu温度
|
||||||
@ -82,14 +100,18 @@
|
|||||||
interfaces = []
|
interfaces = []
|
||||||
}).
|
}).
|
||||||
|
|
||||||
%% 终端表
|
%% 终端设备表
|
||||||
-record(terminal, {
|
-record(terminal, {
|
||||||
%% ID
|
%% 设备ID
|
||||||
id :: binary(),
|
id :: binary(),
|
||||||
%% 关联主机
|
%% 关联主机
|
||||||
host_id :: binary(),
|
host_id :: binary(),
|
||||||
%% 名称
|
%% 名称
|
||||||
name :: binary(),
|
name :: binary(),
|
||||||
|
%% 设备编码
|
||||||
|
code :: binary(),
|
||||||
|
%% 接入协议
|
||||||
|
access_protocol :: binary(),
|
||||||
%% 产品ID,枚举类型
|
%% 产品ID,枚举类型
|
||||||
product_id :: integer(),
|
product_id :: integer(),
|
||||||
%% 厂商ID,枚举类型
|
%% 厂商ID,枚举类型
|
||||||
@ -98,6 +120,8 @@
|
|||||||
model :: binary(),
|
model :: binary(),
|
||||||
%% 所在单元ID,管理系统负责
|
%% 所在单元ID,管理系统负责
|
||||||
cell_id :: integer(),
|
cell_id :: integer(),
|
||||||
|
%% 指标, 终端指标涉及到查询效率和更新效率的问题,因此合并到一起
|
||||||
|
metrics = [] :: [#terminal_metric{}],
|
||||||
%% 终端状态
|
%% 终端状态
|
||||||
status = 0 :: integer(),
|
status = 0 :: integer(),
|
||||||
%% 最后上线时间
|
%% 最后上线时间
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
[iot,
|
[iot,
|
||||||
sasl]},
|
sasl]},
|
||||||
|
|
||||||
{mode, dev},
|
% {mode, dev},
|
||||||
|
|
||||||
%% automatically picked up if the files
|
%% automatically picked up if the files
|
||||||
%% exist but can be set manually, which
|
%% exist but can be set manually, which
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user