class Flux::Client

Defined in:

flux/client.cr

Constant Summary

Log = ::Log.for(self)

Constructors

Instance Method Summary

Constructor Detail

def self.new(uri : String, token : String, org : String) #

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.


[View source]

Instance Method Detail

def query(expression : String) #

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.


[View source]
def query(expression : String, &block : QueryResult::Row, Array(QueryResult::Column) -> T) forall T #

Runs a query on the connected InfluxDB instance.

expression must be a valid Flux expression.


[View source]
def write(bucket : String, point : Point) #

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.


[View source]
def write(bucket : String, points : Enumerable(Point)) #

Perform a synchronous write of a set of points to the passed bucket.


[View source]