class Flux::Client
- Flux::Client
- Reference
- Object
Defined in:
flux/client.crConstant Summary
-
Log =
::Log.for(self)
Constructors
-
.new(uri : String, token : String, org : String)
Creates a new InfluxDB client for the instance running at the specified uri.
Instance Method Summary
-
#query(expression : String)
Runs a query on the connected InfluxDB instance.
-
#query(expression : String, &block : QueryResult::Row, Array(QueryResult::Column) -> T) forall T
Runs a query on the connected InfluxDB instance.
-
#write(bucket : String, point : Point)
Perform a synchronous write of a single point to the passed bucket.
-
#write(bucket : String, points : Enumerable(Point))
Perform a synchronous write of a set of points to the passed bucket.
Constructor Detail
Creates a new InfluxDB client for the instance running at the specified uri.
token must be a valid API token on the instance that provides sufficient privaleges for the buckets being interact with. Similarly org must match the appropriate org name these buckets sit under.
Instance Method Detail
Runs a query on the connected InfluxDB instance.
expression must be a valid Flux expression. All returned records will by a Hash of String => String. To parse into stricter types, use variant of this method accepting a block.
Runs a query on the connected InfluxDB instance.
expression must be a valid Flux expression.
Perform a synchronous write of a single point to the passed bucket.
In most cases this should not be used due the associated request overhead.
When writing points intermittently a Writer
can be used to provide
buffering and batching.
Perform a synchronous write of a set of points to the passed bucket.