exometer_core
exometer_core copied to clipboard
Problem with spec of function match datapoints
There is a problem with the match spec when registering a datapoint like this:
ok = exometer:new([erlang, gc],
{function, erlang, statistics, [garbage_collection], match, {total_coll, rec_wrd, '_'}})
Dialyzer Error
289: The call exometer:new(['erlang', 'gc'], {'function', 'erlang', 'statistics', ['garbage_collection'], 'match', {'total_coll', 'rec_wrd', '_'}}) will never return since the success typing is ([any()], atom() | {atom(),_} | {'function',atom(),atom()} | {'function',atom(),atom(),[any()],atom(),[any()]}) -> 'ok' and the contract is (name(), type()) -> 'ok'
Dialyzer flags this as a type error because the datapoints() in match
expressions is defined as a list. But for match
expressions it is defined in the documentation that this should be a match expression. See: https://github.com/Feuerlabs/exometer_core/blob/master/doc/exometer_function.md