Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 8 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
Commits on Dec 10, 2012
Andrey Vasenin Change dizzyd/protobuffs to basho/protobuffs 3af87eb
Commits on Dec 25, 2012
Andrey Vasenin fix tests 747670a
Commits on Jan 03, 2013
Andrey Vasenin Fix bstring to string in tags e84b682
Andrey Vasenin Temporary remove decode test 10f1828
Andrey Vasenin Revert "Temporary remove decode test"
This reverts commit 10f1828.
25d39ab
Commits on Jan 04, 2013
Andrey Vasenin Fix protobuffs bool decoding fff4ca3
Commits on Feb 20, 2013
Andrey Vasenin Send all riemann metrics as one message to zeta_zlient 7d44c93
Commits on Feb 27, 2013
Andrey Vasenin Change erlando supplier ea9763b
View
4 rebar.config
@@ -19,10 +19,10 @@
{deps, [{lager, ".*",
{git, "git://github.com/basho/lager.git", "HEAD"}},
{erlando, ".*",
- {git, "git://github.com/reifyhealth/erlando.git", "HEAD"}},
+ {git, "git://github.com/rabbitmq/erlando.git", "HEAD"}},
{proper, ".*",
{git, "https://github.com/manopapad/proper.git", "HEAD"}},
{protobuffs, ".*",
- {git, "https://github.com/dizzyd/protobuffs.git", "HEAD"}}]}.
+ {git, "https://github.com/basho/erlang_protobuffs.git", "HEAD"}}]}.
%% {covertool, ".*",
%% {git, "https://github.com/idubrov/covertool.git", "HEAD"}}]}.
View
5 src/zeta.erl
@@ -111,9 +111,8 @@ cv(Loc, Metric, State, Opts) ->
cv_batch([E]).
cv_batch(Es) ->
- M = #zeta_msg{zevents = Es},
- Data = zeta_pb:encode(M),
- do([error_m ||
+ Data = [zeta_pb:encode(#zeta_msg{zevents = [E]}) || E <- Es],
+ do([error_m ||
Client <- zeta_corral:client(),
gen_server:cast(Client, {events, Data})]).
View
6 src/zeta_client.erl
@@ -76,9 +76,9 @@ handle_call({events, Msg}, _From, St = #st{tcp = TCP}) ->
end;
handle_call(_Message, _From, State) -> {reply, ignored, State}.
-handle_cast({events, Msg}, St = #st{udp = UDP, host = Host, port = Port}) ->
- gen_udp:send(UDP, Host, Port, Msg),
- {noreply, St}.
+handle_cast({events, Messages}, State = #st{udp = UDP, host = Host, port = Port}) ->
+ [gen_udp:send(UDP, Host, Port, M) || M <- Messages],
+ {noreply, State}.
handle_info(_Message, State) -> {ok, State}.
code_change(_Vsn, State, _Extra) -> {ok, State}.
View
8 src/zeta_pb.erl
@@ -111,9 +111,9 @@ decode(Bin, Msg = #zeta_msg{zstates = States, zevents = Events}) ->
try protobuffs:read_field_num_and_wire_type(Bin) of
{{Slot, _}, _} ->
try protobuffs:decode(Bin, msg_t(Slot)) of
- {{?MSG_OK, 1}, Rest} ->
+ {{?MSG_OK, true}, Rest} ->
decode(Rest, Msg#zeta_msg{ok = true});
- {{?MSG_OK, 0}, Rest} ->
+ {{?MSG_OK, false}, Rest} ->
decode(Rest, Msg#zeta_msg{ok = false});
{{?MSG_ERROR, Value}, Rest} ->
decode(Rest, Msg#zeta_msg{error = Value});
@@ -158,8 +158,8 @@ decode(Bin, ZState = #zeta_state{tags = Tags}) ->
decode(Rest, ZState#zeta_state{description = Desc});
{{?STATE_ONCE, Once}, Rest} ->
case Once of
- 1 -> decode(Rest, ZState#zeta_state{once = true});
- 0 -> decode(Rest, ZState#zeta_state{once = false})
+ true -> decode(Rest, ZState#zeta_state{once = true});
+ false -> decode(Rest, ZState#zeta_state{once = false})
end;
{{?STATE_TAG, Tag}, Rest} ->
decode(Rest, ZState#zeta_state{tags = [Tag | Tags]});
View
7 test/pb.erl
@@ -7,8 +7,7 @@
-include("include/zeta.hrl").
n(G) -> union([undefined, G]).
-bstring() -> binary().
-nstring() -> n(bstring()).
+nstring() -> n(string()).
nfloat() -> n(?LET(Int, integer(), float(Int))).
nbool() -> n(boolean()).
zeta_state() ->
@@ -18,7 +17,7 @@ zeta_state() ->
host = nstring(),
description = nstring(),
once = nbool(),
- tags = list(bstring()),
+ tags = list(string()),
ttl = nfloat(),
metric_f = nfloat()}.
@@ -28,7 +27,7 @@ zeta_event() ->
service = nstring(),
host = nstring(),
description = nstring(),
- tags = list(bstring()),
+ tags = list(string()),
ttl = nfloat(),
metric_f = nfloat()}.

No commit comments for this range

Something went wrong with that request. Please try again.