This commit is contained in:
anlicheng 2023-06-15 12:01:37 +08:00
parent d2c57bc2bf
commit f5defe2638

View File

@ -223,25 +223,17 @@ handle_info({timeout, _, data_ticker}, State = #state{aes = Aes, topic = Topic})
<<"service_name">> => <<"shuibiao">>, <<"service_name">> => <<"shuibiao">>,
<<"at">> => iot_util:timestamp(), <<"at">> => iot_util:timestamp(),
<<"fields">> => [ <<"fields">> => [
#{ #{<<"used">> => rand:uniform(2048 * 2)}
<<"used">> => rand:uniform(2048 * 2)
}
], ],
<<"tags">> => #{ <<"tags">> => #{}
}
}, },
#{ #{
<<"service_name">> => <<"shuibiao:123">>, <<"service_name">> => <<"shuibiao:123">>,
<<"at">> => iot_util:timestamp(), <<"at">> => iot_util:timestamp(),
<<"fields">> => [ <<"fields">> => [
#{ #{<<"used">> => rand:uniform(2048 * 2)}
<<"used">> => rand:uniform(2048 * 2)
}
], ],
<<"tags">> => #{ <<"tags">> => #{}
}
} }
], ],
@ -260,7 +252,7 @@ handle_info({timeout, _, data_ticker}, State = #state{aes = Aes, topic = Topic})
lager:debug("[host_mocker] send data failed, reason: ~p", [Reason]) lager:debug("[host_mocker] send data failed, reason: ~p", [Reason])
end, end,
erlang:start_timer(?TICKER_INTERVAL + 2000 + rand:uniform(5000), self(), data_ticker), % erlang:start_timer(?TICKER_INTERVAL + 2000 + rand:uniform(5000), self(), data_ticker),
{noreply, State}; {noreply, State};
@ -300,8 +292,6 @@ handle_info({timeout, _, inform_ticker}, State = #state{aes = Aes, topic = Topic
lager:debug("[host_mocker] send inform failed, reason: ~p", [Reason]) lager:debug("[host_mocker] send inform failed, reason: ~p", [Reason])
end, end,
erlang:start_timer(?TICKER_INTERVAL + 2000 + rand:uniform(5000), self(), data_ticker),
{noreply, State}; {noreply, State};
%% feedback_result信息 %% feedback_result信息
@ -328,8 +318,6 @@ handle_info({timeout, _, feedback_ticker}, State = #state{aes = Aes, topic = Top
lager:debug("[host_mocker] send inform failed, reason: ~p", [Reason]) lager:debug("[host_mocker] send inform failed, reason: ~p", [Reason])
end, end,
erlang:start_timer(?TICKER_INTERVAL + 2000 + rand:uniform(5000), self(), data_ticker),
{noreply, State}; {noreply, State};
%% ping逻辑 %% ping逻辑