Skip to content

Latest commit

 

History

History
42 lines (26 loc) · 943 Bytes

README.md

File metadata and controls

42 lines (26 loc) · 943 Bytes

cuberl

Erlang client for Square's Cube.

Sends events to Cube's collector over UDP.

Quick Start

Add cuberl to your rebar.config deps:

{cuberl, ".*", {git, "git://github.com/chaitanyapandit/cuberl.git"}}

Don't forget to include cuberl and jiffy in your application (in the reltool.config rel section):

...[
	 cuberl,
	 jiffy
	 ]...
	 
{app, cuberl, [{incl_cond, include}]},
{app, jiffy, [{incl_cond, include}]}

The cuberl application itself needs to be configured using the application's environment, this is generally done in app.config or sys.config.

{cuberl, [
    {host, "127.0.0.1"}, %% Or wherever the collector is running
    {port, 1180} %% UDP port
]}

Include cuberl.hrl:

-include("../deps/cuberl/include/cuberl.hrl").

Start sending events to Cube:

cuberl:send(#cuberl_event{type = <<"hits">>, data = [{<<"value">>, 1}]}).