Client library for pushing data to, and querying information from InfluxDB v2.x.
Add the dependency to your
dependencies: flux: github: aca-labs/flux
Configure the client
Define your client configuration with
Flux.configure. This yields an
with appriopriate setters.
Flux.configure do |settings| settings.host = ENV["INFLUX_HOST"]? || abort "INFLUX_HOST env var not set" settings.api_key = ENV["INFLUX_API_KEY"]? || abort "INFLUX_API_KEY env var not set" settings.org = ENV["INFLUX_ORG"]? || "vandelay-industries" settings.bucket = ENV["INFLUX_BUCKET"]? || "latex-sales" end
Flux.write to enqueue a point. Writes are automatically buffered and
flushed after either a time delay or optimal write size.
Once information is available in the bucket, queries are executed with
Flux.query. This accepts a Flux
If your application requires connectivity with more that one InfluxDB instance
or bucket, clients can be directly created with
- Fork it (https://github.com/aca-labs/flux/fork)
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request
- Kim Burgess - creator and maintainer