fix
This commit is contained in:
parent
0f8ef428b5
commit
dc218e1d4f
@ -244,12 +244,12 @@ search_stream_id(StreamPid, StreamMap) when is_pid(StreamPid), is_map(StreamMap)
|
|||||||
|
|
||||||
-spec map_metric(Metric :: any()) -> {ok, binary()} | error.
|
-spec map_metric(Metric :: any()) -> {ok, binary()} | error.
|
||||||
map_metric(Metric) when is_binary(Metric) ->
|
map_metric(Metric) when is_binary(Metric) ->
|
||||||
Metric;
|
{ok, Metric};
|
||||||
map_metric(Metric) when is_map(Metric) orelse is_list(Metric) ->
|
map_metric(Metric) when is_map(Metric) orelse is_list(Metric) ->
|
||||||
jiffy:encode(Metric, [force_utf8]);
|
{ok, jiffy:encode(Metric, [force_utf8])};
|
||||||
map_metric(Metric) when is_integer(Metric) ->
|
map_metric(Metric) when is_integer(Metric) ->
|
||||||
integer_to_binary(Metric);
|
{ok, integer_to_binary(Metric)};
|
||||||
map_metric(Metric) when is_float(Metric) ->
|
map_metric(Metric) when is_float(Metric) ->
|
||||||
erlang:float_to_binary(Metric, [compact, {decimals, 10}]);
|
{ok, erlang:float_to_binary(Metric, [compact, {decimals, 10}])};
|
||||||
map_metric(_) ->
|
map_metric(_) ->
|
||||||
error.
|
error.
|
||||||
Loading…
x
Reference in New Issue
Block a user