Collector

Collector modules aims to aggregate data from multiple instances.

Features

Default implementation only store data in memory but you can easily extend it to store data in MongoDB or whatever you want.

Note: this is on our roadmap

For the impatient

Take a servlet container and deploy sirona-collector-[version].war. Collection is done on /collector endpoint and reporting view is accesible through /sirona endpoint.

Configuration

Just use the collector DataStoreFactory: org.apache.sirona.store.CollectorDataStoreFactory.

For instance your sirona.properties can look like:

org.apache.sirona.store.DataStoreFactory = org.apache.sirona.store.CollectorDataStoreFactory

The GaugeDataStore can be configured through org.apache.sirona.collector.gauge.store-class property. By default it uses the in memory implementation but you can set your own one if you want.

Note: if your GaugeDataStore has a constructor with a String, the marker of the store will be passed to the GaugeDataStore.

The CounterDataStore needs to be an instance of org.apache.sirona.store.counter.CollectorCounterStore. By default it is in memory too but it is easily extensible to be persisted if needed.

Installing the collector

To setup the collector you just need to configure the DataStoreFactory (see configuration part) and configure the servlet org.apache.sirona.collector.server.Collector.

Pushing data

The input is an array of event. Events are either gauges or counters.

Here is an array with a single gauge:

[
    {
        "type": "gauge",
        "time": "-",
        "data": {
            "unit": "u",
            "marker": "client1",
            "value": 0.0,
            "role": "mock"
        }
    }
]

And here is an array with a single counter:

[
    {
        "type": "counter",
        "time": "2013-10-21T12:50:40Z",
        "data": {
            "min": 1.4,
            "unit": "ns",
            "hits": 4,
            "max": 2.9,
            "marker": "client1",
            "name": "test",
            "concurrency": 0,
            "m2": 1.4099999999999997,
            "sum": 8.2,
            "mean": 2.05,
            "role": "performances",
            "variance": 0.4699999999999999
        }
    }
]