Try to fix some warnings detected by Dialyzer about unused cases
This commit is contained in:
parent
5b1402f033
commit
3293ba1cfe
|
@ -115,12 +115,8 @@ push(Host, Probe) ->
|
||||||
encode_metrics(Host, Probe) ->
|
encode_metrics(Host, Probe) ->
|
||||||
[_, NodeId] = str:tokens(misc:atom_to_binary(node()), <<"@">>),
|
[_, NodeId] = str:tokens(misc:atom_to_binary(node()), <<"@">>),
|
||||||
[Node | _] = str:tokens(NodeId, <<".">>),
|
[Node | _] = str:tokens(NodeId, <<".">>),
|
||||||
Data = case Probe of
|
Key = Probe,
|
||||||
{Key, Val} ->
|
Data = encode(gauge, ?GRAFITE_KEY(Node, Host, Probe), 1, 1.0),
|
||||||
encode(gauge, ?GRAFITE_KEY(Node, Host, Probe), Val, 1.0);
|
|
||||||
Key ->
|
|
||||||
encode(gauge, ?GRAFITE_KEY(Node, Host, Probe), 1, 1.0)
|
|
||||||
end,
|
|
||||||
?INFO_MSG("Stats: ~p ~p ~n", [Data, encode(gauge, Key, 1, undefined)]),
|
?INFO_MSG("Stats: ~p ~p ~n", [Data, encode(gauge, Key, 1, undefined)]),
|
||||||
Data.
|
Data.
|
||||||
|
|
||||||
|
@ -132,10 +128,7 @@ encode(gauge, Key, Value, _SampleRate) ->
|
||||||
[Key, ":", format_value(Value), "|g"].
|
[Key, ":", format_value(Value), "|g"].
|
||||||
|
|
||||||
format_value(Value) when is_integer(Value) ->
|
format_value(Value) when is_integer(Value) ->
|
||||||
integer_to_list(Value);
|
integer_to_list(Value).
|
||||||
format_value(Value) when is_float(Value) ->
|
|
||||||
float_to_list(Value, [{decimals, 2}]).
|
|
||||||
|
|
||||||
|
|
||||||
%%====================================================================
|
%%====================================================================
|
||||||
%% UDP Utils
|
%% UDP Utils
|
||||||
|
|
Loading…
Reference in New Issue