Wikia/clojure-commons — pull request #1 by nmonterroso (2014-12-02 19:53:05+00:00)
Title: Influxdb

@drsnyder @wladekb
Adding library to send data to influxdb. [capacitor](https://github.com/olauzon/capacitor) always uses http, so this implementation is custom, but the data that's sent to influxdb is pretty simple. The API for this is:

```clojure
(publish [series-name point])
(publish [point])
(timing [metric & body])
(series-timing [series-name metric & body])
```

`series-timing` is the same as `timing`, except that the `series-name` can be provided. This was done because we can't have multiple variadic overloads (`& body`). Example usages:

```clojure
(publish {:my-column 2})
(timing :my-column (+ 1 1) (+ 2 2) (do-some-other-thing))
(series-timing :my-series :my-column (do-some-stuff) (and-other-stuff))
```

Data is batched and sent every X milliseconds or X events, whichever comes first. These are configureable via environment config.