Skip to content

Commit

Permalink
Fix specs after the dialyzer checks
Browse files Browse the repository at this point in the history
  • Loading branch information
surik committed Jul 4, 2016
1 parent adfe7e5 commit e5c88f7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/exometer_report_influxdb.erl
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ exometer_terminate(Reason, _) ->
%% ===================================================================
%% Internal functions
%% ===================================================================
-spec connect(protocol(), binary(), integer(),
-spec connect(protocol(), string() | binary(), integer(),
undefined | iodata(), undefined | iodata()) ->
{ok, pid() | reference()} | {error, term()}.
connect(Proto, Host, Port, Username, Password) when ?HTTP(Proto) ->
Expand Down Expand Up @@ -403,7 +403,7 @@ value(V) when is_list(V) -> value(list_to_binary(V));
value(V) when is_binary(V) ->
[$", binary:replace(V, <<$">>, <<$\\, $">>, [global]), $"].

-spec flatten_fields(list()) -> list().
-spec flatten_fields(map()) -> list().
flatten_fields(Fields) ->
maps:fold(fun(K, V, Acc) ->
[Acc, ?SEP(Acc), key(K), $=, value(V)]
Expand All @@ -417,7 +417,7 @@ flatten_tags(Tags) ->
end, [], lists:keysort(1, Tags)).

-spec make_packet(exometer_report:metric(), map() | list(),
list(), boolean() | non_neg_integer(), precision()) ->
map(), boolean() | non_neg_integer(), precision()) ->
list().
make_packet(Measurement, Tags, Fields, Timestamping, Precision) ->
BinaryTags = flatten_tags(Tags),
Expand Down Expand Up @@ -476,12 +476,13 @@ evaluate_subscription_options(MetricId, Options, DefaultTags, DefaultSeriesName,
FinalTags = merge_tags(DefaultTags, TagMap),
{FinalMetricId, FinalTags}.

-spec evaluate_subscription_tags(list(), [{atom(), value()}]) -> {list(), map(), [integer()]}.
-spec evaluate_subscription_tags(list(), [{atom(), value()}]) ->
{list(), [{atom(), value()}], [integer()]}.
evaluate_subscription_tags(MetricId, TagOpts) ->
evaluate_subscription_tags(MetricId, TagOpts, [], []).

-spec evaluate_subscription_tags(list(), [{atom(), value()}], [{atom(), value()}], [integer()])
-> {list(), map(), [integer()]}.
-spec evaluate_subscription_tags(list(), [{atom(), value()}], [{atom(), value()}], [integer()]) ->
{list(), [{atom(), value()}], [integer()]}.
evaluate_subscription_tags(MetricId, [], TagAcc, PosAcc) ->
{MetricId, TagAcc, PosAcc};
evaluate_subscription_tags(MetricId, [{TagKey, {from_name, Pos}} | TagOpts], TagAcc, PosAcc)
Expand Down

0 comments on commit e5c88f7

Please sign in to comment.