Commit 9bc1b933 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

doc: events and gauges

parent 03c2cca0
Loading
Loading
Loading
Loading
+29 −2
Original line number Diff line number Diff line
Event Handler
-------------

here be dragons
The basic unit of input data in FnordMetric is called an event. These events
are JSON objects (arbitrary hashmaps) A event may look like this:

    { "_type": "sale", "product_id": 534221, "purchase_value": 2999 }


Some events have a special format and meaning (like "increment this counter by 4"
or "add this sample to the average query time gauge"). You can just send these
special events and FnordMetric will know what do to with them.

_Example: increment something by four_

    ...

_Example_

You can also send completely custom events and write a piece of ruby code that
processes them. In this case the only requirement is that the event has a
`_type` key, which is used to identify the correct event handler. All other fields
can be completely custom. This is useful if you want to perform actions on more
than one gauge but only want to send one piece of data from your app to FnordMetric.

_Example: send a "user signed up" event and increment two gauges_

    fnord...



There is a small number of keys which have a special meaning, all of them
are prefixed with an underscore:

    fixpaul: special key table
    - events containing user data (_session, _name)
    - _namespace

### Sessions

  here be dragons
+4 −10
Original line number Diff line number Diff line
Sending Data
------------

FnordMetric operates on an input stream of "events". These events are JSON
objects (arbitrary hashmaps). A event may look like this:
The basic unit of input data in FnordMetric is called an event. These events
are JSON objects (arbitrary hashmaps)  A event may look like this:

    { "_type": "sale", "product_id": 534221, "purchase_value": 2999 }


There is a small number of keys which have a special meaning, all of them
are prefixed with an underscore:

    fixpaul: special key table
    - events containing user data (_session, _name)
    - _namespace

This page describes how to send these events to FnordMetric. To read more
about the semantics of the events please see Events and Gauges (FIXPAUL)

You can choose between a variety of ways to submit these events to FnordMetric: