Commit c0ff8737 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

doc: typo fixes

parent 7414a2c6
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
Events and Gauges
-----------------

A "gauge" in FnordMetric is basically a bucket that stoes a numerical value. It has has two
A "gauge" in FnordMetric is basically a bucket that stores a numerical value. It has has two
dimensions: time and value. Each gauge is identified by a uniqe key (for example
"number_of_singups_per_minute"). The value of a gauge is periodically aggregated and persisted
`number_of_singups_per_minute`). The value of a gauge is periodically aggregated and persisted
into redis.

Gauges can be used in different modes: They can act as simple counters with an increment and
@@ -11,7 +11,7 @@ a decrement operation, but you can also use them to record the mean / average or
value.

An Event is a piece of input data that is sent to FnordMetric through one of the various
sources. These events are JSON objects (arbitrary hashmaps) with almost no contraints on
sources. These events are JSON objects (arbitrary associative maps) with almost no contraints on
the schema. A event may look like this:

    { "_type": "sale", "product_id": 534221, "purchase_value": 2999 }
@@ -109,10 +109,11 @@ one action but only want to send one piece of data from your app to FnordMetric.

#### Example: send a "user logged in up" event and increment two gauges

First we need to create a gauge. When using the predefined _incr, _decr, etc.. events
First we need to create a gauge. When using the predefined events (like `\_incr` and `\_avg`)
gauges are created on-the-fly, but when writing custom event handlers we need to do
this by hand. We create a gauge that stores the number of logins with a granularity (`flush_interval`)
of 1 minute and a another gauge that stores the number of total conversions per day.
this by hand. We create a gauge that stores the number of logins with a granularity
of 1 minute (this is called the `flush_interval`) and a another gauge that stores the number
of total conversions per day.

    gauge :logins_per_minute,
      :tick => 1.minute.to_i,
+2 −3
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ Sending Data

An Event is a piece of input data that is sent to FnordMetric through one of the various
sources. These events are JSON objects (arbitrary hashmaps) with almost no contraints on
the schema. A event may look like this:
the schema. An event may look like this:

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

@@ -11,7 +11,6 @@ the schema. A event may look like this:
This page describes how to send these events to FnordMetric. To read more
about the semantics of the events please see [Events and Gauges](/documentation/classic_event_handlers)

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

### HTTP API

@@ -70,7 +69,7 @@ This example assumes you have `redis_prefix` set to the default value

_Example: push event 123123 to the internal redis queue with a ttl of 10 minutes__

    set     "fnotmetric-event-123123"   "{ \"_type\": \"test\" }"
    set     "fnordmetric-event-123123"   "{ \"_type\": \"test\" }"
    lpush   "fnordmetric-queue"         "123"
    expire  "fnordmetric-event-123123"  "600"

+8 −8
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ Classic and FnordMetric Enterprise, but you can [download a copy here](http://gi

FnordMetric UI requires jQuery 1.6.2+. We set up the basic HTML structure (this
assumes you have either FnordMetric Classic or FnordMetric Enterprise running
on port 4242) and save this to a fil `my_dashboard.html`
on port 4242) and save this to a file `my_dashboard.html`

    <!DOCTYPE html>
    <html>
@@ -30,8 +30,8 @@ on port 4242) and save this to a fil `my_dashboard.html`
    </html>


We will display on counter "total revenue in the last hour" on our page. First we
have to connect to the FnordMetric Backend using WebSockets (_Make sure you set the
We will display one counter "total sales in the last hour" on our page. To do that we
first have to connect to the FnordMetric Backend using WebSockets (_Make sure you set the
correct namespace, it's "myapp" in the example_):

    <script>
@@ -44,8 +44,8 @@ correct namespace, it's "myapp" in the example_):
_Note: When using FnordMetric Enterprise the namespace is always "fnordmetric"_

Now the FnordMetric UI library is loaded and we can plug widgets into the page
using HTML5 elements. Let's start with a simple counter that display the sum of
sales in the last hour. And update every second:
using HTML5 elements. Let's start with a simple counter that displays the sum of
sales in the last hour and updates itself every second:

    Total Sales in the last hour:
    <span
@@ -57,7 +57,7 @@ sales in the last hour. And update every second:
      >0</span>


Now open my_dashboard.html in the browser of your choice. You should see a
If you open `my_dashboard.html` in your browser, You should see a
page displaying "0". It's a good idea to open the JavaScript / Inspector
console of your browser as FnordMetric UI will print error messages using `console.log`

@@ -80,11 +80,11 @@ For fun and profit, we can display a timeseries graph of sales in the last 10 mi
Now your dashboard should look like this:

<img src="/img/fnordmetric_ui_example_screen.png" width="630" class="shadow" />

<br />

#### But wait, my dashboard is white?

Yes, I skipped this part to make the getting started a bit shorter. The example above
Yes, I skipped this part to make the into a bit shorter. The example above
uses a "custom" styesheet. Since all widgets are rendered with HTML5 + SVG (d3.js) you
can control the style with CSS.