From: Siraaj Khandkar Date: Sun, 4 Oct 2015 05:50:01 +0000 (-0400) Subject: Move schema version definition to a macro. X-Git-Tag: 1.0.0~3 X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=40dcb7826352be754bb5148c7b5d97c709244fde;p=beam_stats.git Move schema version definition to a macro. --- diff --git a/src/beam_stats_msg_graphite.erl b/src/beam_stats_msg_graphite.erl index 1cade91..bd5f3b4 100644 --- a/src/beam_stats_msg_graphite.erl +++ b/src/beam_stats_msg_graphite.erl @@ -19,6 +19,7 @@ , node_id_to_bin/1 ]). +-define(SCHEMA_VERSION, <<"beam_stats_v0">>). -define(T, #?MODULE). -type t() :: @@ -97,18 +98,13 @@ node_id_to_bin(NodeID) -> -spec path_prefix_schema_version(t()) -> t(). path_prefix_schema_version(?T{}=T) -> - path_prefix(T, schema_version()). + path_prefix(T, ?SCHEMA_VERSION). -spec path_prefix(t(), binary()) -> t(). path_prefix(?T{path=Path}=T, <>) -> T?T{path = [Prefix | Path]}. --spec schema_version() -> - binary(). -schema_version() -> - <<"beam_stats_v0">>. - -spec interleave([A], A) -> [A]. interleave([], _) ->