Katja Echo

Build StatusCoverage Status

Katja Echo is a test library tool that helps performing tests on these specific use cases:

Besides the above listed itens, riemann.io implements a simple protocol and query parsing which are good exercises as well suitable to use Erlang.

This project has an aim to help testing and not intends to be a full Riemann implementation.

Build

This project uses rebar3 as main build tool.

How to use

Add katja_echo as an application dependency (use test profile if needed):

{deps, [
    {katja_echo, "0.1.0"}
]}.

The following configuration is assumed as default values:

[
    {katja_echo, [
        {port, 5555},
        {pool, []},
        {callback, katja_echo_user}
    ]}
].

When testing, a typical test case looks like this:

    Fun = fun (_Event) -> ok end,
    {ok, Pid} = katja_echo:start_link(),

    % sending riemann events using any client

    % call katja_echo query. Or call the riemann client query function
    Events = katja_echo:query(Fun, "service = \"my service\"").

Resources

Riemann

Katja Echo can receive and send messages using Riemann Protocol Buffer.

Also query message was based on Riemann Query and the respective tests implementation.

The grammar was implemented based on Riemann antlr grammar.

Scanner and Parser

The following links are great source of knowledge about how to write a scanner and parer using yecc/leex:

License

MIT.