From 3293ba1cfe0e38cdec3cf4935800c575cf5d4d84 Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 12 Aug 2022 19:18:53 +0200 Subject: [PATCH] Try to fix some warnings detected by Dialyzer about unused cases --- mod_grafite/src/mod_grafite.erl | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/mod_grafite/src/mod_grafite.erl b/mod_grafite/src/mod_grafite.erl index b54333b..c201ef9 100644 --- a/mod_grafite/src/mod_grafite.erl +++ b/mod_grafite/src/mod_grafite.erl @@ -115,12 +115,8 @@ push(Host, Probe) -> encode_metrics(Host, Probe) -> [_, NodeId] = str:tokens(misc:atom_to_binary(node()), <<"@">>), [Node | _] = str:tokens(NodeId, <<".">>), - Data = case Probe of - {Key, Val} -> - encode(gauge, ?GRAFITE_KEY(Node, Host, Probe), Val, 1.0); - Key -> - encode(gauge, ?GRAFITE_KEY(Node, Host, Probe), 1, 1.0) - end, + Key = Probe, + Data = encode(gauge, ?GRAFITE_KEY(Node, Host, Probe), 1, 1.0), ?INFO_MSG("Stats: ~p ~p ~n", [Data, encode(gauge, Key, 1, undefined)]), Data. @@ -132,10 +128,7 @@ encode(gauge, Key, Value, _SampleRate) -> [Key, ":", format_value(Value), "|g"]. format_value(Value) when is_integer(Value) -> - integer_to_list(Value); -format_value(Value) when is_float(Value) -> - float_to_list(Value, [{decimals, 2}]). - + integer_to_list(Value). %%==================================================================== %% UDP Utils