ex_flux v0.2.0 ExFlux.Database.Supervisor View Source

Orchestration and supervision of ex_influx database components

The two components of an ex_influx database process: a "sliding buffer" queue, ExFlux.Database.QueueWorker, and a pool of connections to the influxdb server, ExFlux.Database.PoolWorker.

Common options for the queue, pool and/or the query interface:

  • :database - the name of the database
  • :host - hostname of the influxdb server

The options required by the queue are:

  • :batch_size - an upper limit on the number of points to send at once
  • :max_queue_size - a limit to the number of points to attempt to hold if the data cannot be shipped to influxdb fast enough
  • :flush_interval - a time interval in seconds used to help drain the queue

The options required by the pool are:

  • :pool_size - the number of connections/workers to maintain (via :poolboy)
  • :pool_overflow - if set to a number > 0, this allows poolboy to create extra workers when the demand for workers exceeds the supply
  • :upd_conn_opts - a list of one or more UDP connection options required by :gen_udp, defaults to [:binary, {:active, false}] since we are exclusively writing
  • :udp_port - the port number influxdb is listening on for this particular database

The options required by the http interface:

  • :http_port - the port number for the query interface (defaults to 8086)
  • :json_encoder - encoder/decoder to use for responses, defaults to Poison
  • :http_opts - extra options passed to HTTPoison see HTTPoison.request/5 for more details (defaults to [timeout: 5000])

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Callback invoked to start the supervisor and during hot code upgrades.

Merge the config and defaults to create a single cohesive configuration map to be used by the pool worker, poolboy, and the queue worker.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Callback invoked to start the supervisor and during hot code upgrades.

Developers typically invoke Supervisor.init/2 at the end of their init callback to return the proper supervision flags.

Callback implementation for Supervisor.init/1.

Link to this function

process_env(mod, otp_app)

View Source
process_env(atom(), atom()) :: map()

Merge the config and defaults to create a single cohesive configuration map to be used by the pool worker, poolboy, and the queue worker.

Link to this function

start_link(mod, otp_app, opts)

View Source