Handle the proper existing metric error atom
Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-stats/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-stats/commit/dfc415cd Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-stats/tree/dfc415cd Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-stats/diff/dfc415cd Branch: refs/heads/master Commit: dfc415cd5e88b7f39999442e8e4cd435502e47d8 Parents: e51375d Author: Benjamin Anderson <b...@banjiewen.net> Authored: Tue Feb 4 16:00:32 2014 -0800 Committer: Robert Newson <rnew...@apache.org> Committed: Tue Aug 19 14:48:31 2014 +0100 ---------------------------------------------------------------------- src/couch_stats.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch-stats/blob/dfc415cd/src/couch_stats.erl ---------------------------------------------------------------------- diff --git a/src/couch_stats.erl b/src/couch_stats.erl index 563a67c..4668064 100644 --- a/src/couch_stats.erl +++ b/src/couch_stats.erl @@ -37,18 +37,18 @@ sample(Name) -> new(counter, Name) -> case folsom_metrics:new_counter(Name) of ok -> ok; - {error, Name, metric_exists} -> {error, metric_exists} + {error, Name, metric_already_exists} -> {error, metric_exists} end; new(histogram, Name) -> {ok, Time} = application:get_env(couch_stats, collection_interval), case folsom_metrics:new_histogram(Name, slide_uniform, {Time, 1024}) of ok -> ok; - {error, Name, metric_exists} -> {error, metric_exists} + {error, Name, metric_already_exists} -> {error, metric_exists} end; new(gauge, Name) -> case folsom_metrics:new_gauge(Name) of ok -> ok; - {error, Name, metric_exists} -> {error, metric_exists} + {error, Name, metric_already_exists} -> {error, metric_exists} end; new(_, _) -> {error, unsupported_type}.