This commit is contained in:
安礼成 2023-02-16 16:13:59 +08:00
parent b2d56f628e
commit 8b4c149651
2 changed files with 29 additions and 5 deletions

View File

@ -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(),
%% 线 %% 线

View File

@ -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