home
/
code
/
beam_stats.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use iolists, where appropriate
[beam_stats.git]
/
src
/
beam_stats_msg_statsd_gauge.erl
diff --git
a/src/beam_stats_msg_statsd_gauge.erl
b/src/beam_stats_msg_statsd_gauge.erl
index
8da0198
..
4f4c533
100644
(file)
--- a/
src/beam_stats_msg_statsd_gauge.erl
+++ b/
src/beam_stats_msg_statsd_gauge.erl
@@
-9,7
+9,7
@@
-export(
[ of_msg_graphite/1
-export(
[ of_msg_graphite/1
- , to_
bin
/1
+ , to_
iolist
/1
]).
-define(T, #?MODULE).
]).
-define(T, #?MODULE).
@@
-26,24
+26,24
@@
of_msg_graphite(
, timestamp = _Timestamp
}
) ->
, timestamp = _Timestamp
}
) ->
- Path
Bin = beam_stats_msg_graphite:path_to_bin
(Path),
- cons(Path
Bin
, Value).
+ Path
IOList = beam_stats_msg_graphite:path_to_iolist
(Path),
+ cons(Path
IOList
, Value).
--spec cons(
binary
(), non_neg_integer()) ->
+-spec cons(
iolist
(), non_neg_integer()) ->
t().
t().
-cons(
<<Name/binary>>
, Value) ->
+cons(
Name
, Value) ->
?T
{ name = Name
, value = Value
}.
?T
{ name = Name
, value = Value
}.
--spec to_
bin
(t()) ->
-
binary
().
-to_
bin
(
+-spec to_
iolist
(t()) ->
+
iolist
().
+to_
iolist
(
?T
?T
- { name =
<<Name/binary>>
+ { name =
Name
, value = Value
}
) when Value >= 0 ->
ValueBin = integer_to_binary(Value),
, value = Value
}
) when Value >= 0 ->
ValueBin = integer_to_binary(Value),
-
<< Name/binary, ":", ValueBin/binary, "|g\n">>
.
+
[Name, <<":">>, ValueBin, <<"|g\n">>]
.
This page took
0.027708 seconds
and
4
git commands to generate.