/inflex_db

Elixir client for InfluxDB

Primary LanguageElixirApache License 2.0Apache-2.0

InflexDB

CI

Elixir client for InfluxDB

Installation

The package can be installed by adding inflex_db to your list of dependencies in mix.exs:

def deps do
  [
    {:inflex_db, "~> 0.1.2"},
    {:jason, "~> 1.1"}
  ]
end

Documentation can be found at https://hexdocs.pm/inflex_db.

Usage

client = %InflexDB.Client{
  url: "http://localhost:8086",
  username: "admin",
  password: "admin",
  auth_method: "basic"
}

points = [
  %InflexDB.Point{
    measurement: "weather",
    tag_set: %{location: "us-midwest"},
    field_set: %{temperature: 82}
  },
  %InflexDB.Point{
    measurement: "weather",
    tag_set: %{location: "us-midwest"},
    field_set: %{temperature: 76}
  }
]

InflexDB.write_points(client, "mydb", points)
# :ok

Checkout the docs for all the operations supported and more examples.

License

Apache License, Version 2.0 © Thiago Santos