Class: InfluxDB::Config
- Inherits:
-
Object
- Object
- InfluxDB::Config
- Defined in:
- lib/influxdb/config.rb
Overview
InfluxDB client configuration
Constant Summary collapse
- AUTH_METHODS =
["params".freeze, "basic_auth".freeze, "none".freeze].freeze
Instance Attribute Summary collapse
-
#async ⇒ Object
readonly
Returns the value of attribute async.
-
#auth_method ⇒ Object
Returns the value of attribute auth_method.
-
#chunk_size ⇒ Object
Returns the value of attribute chunk_size.
-
#database ⇒ Object
Returns the value of attribute database.
-
#denormalize ⇒ Object
Returns the value of attribute denormalize.
-
#discard_write_errors ⇒ Object
Returns the value of attribute discard_write_errors.
-
#epoch ⇒ Object
Returns the value of attribute epoch.
-
#initial_delay ⇒ Object
Returns the value of attribute initial_delay.
-
#max_delay ⇒ Object
Returns the value of attribute max_delay.
-
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
-
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
-
#retry ⇒ Object
Returns the value of attribute retry.
-
#ssl_ca_cert ⇒ Object
Returns the value of attribute ssl_ca_cert.
-
#time_precision ⇒ Object
Returns the value of attribute time_precision.
-
#udp ⇒ Object
readonly
Returns the value of attribute udp.
-
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
-
#username ⇒ Object
Returns the value of attribute username.
-
#verify_ssl ⇒ Object
Returns the value of attribute verify_ssl.
Instance Method Summary collapse
- #async? ⇒ Boolean
- #hosts ⇒ Object
-
#initialize(opts = {}) ⇒ Config
constructor
A new instance of Config.
- #next_host ⇒ Object
- #udp? ⇒ Boolean
Constructor Details
#initialize(opts = {}) ⇒ Config
Returns a new instance of Config.
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/influxdb/config.rb', line 30 def initialize(opts = {}) (opts) (opts) (opts) (opts) (opts) configure_retry! opts.fetch(:retry, nil) configure_hosts! opts[:hosts] || opts[:host] || "localhost".freeze end |
Instance Attribute Details
#async ⇒ Object (readonly)
Returns the value of attribute async.
28 29 30 |
# File 'lib/influxdb/config.rb', line 28 def async @async end |
#auth_method ⇒ Object
Returns the value of attribute auth_method.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def auth_method @auth_method end |
#chunk_size ⇒ Object
Returns the value of attribute chunk_size.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def chunk_size @chunk_size end |
#database ⇒ Object
Returns the value of attribute database.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def database @database end |
#denormalize ⇒ Object
Returns the value of attribute denormalize.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def denormalize @denormalize end |
#discard_write_errors ⇒ Object
Returns the value of attribute discard_write_errors.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def discard_write_errors @discard_write_errors end |
#epoch ⇒ Object
Returns the value of attribute epoch.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def epoch @epoch end |
#initial_delay ⇒ Object
Returns the value of attribute initial_delay.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def initial_delay @initial_delay end |
#max_delay ⇒ Object
Returns the value of attribute max_delay.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def max_delay @max_delay end |
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def open_timeout @open_timeout end |
#password ⇒ Object
Returns the value of attribute password.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def port @port end |
#prefix ⇒ Object
Returns the value of attribute prefix.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def prefix @prefix end |
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def read_timeout @read_timeout end |
#retry ⇒ Object
Returns the value of attribute retry.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def retry @retry end |
#ssl_ca_cert ⇒ Object
Returns the value of attribute ssl_ca_cert.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def ssl_ca_cert @ssl_ca_cert end |
#time_precision ⇒ Object
Returns the value of attribute time_precision.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def time_precision @time_precision end |
#udp ⇒ Object (readonly)
Returns the value of attribute udp.
28 29 30 |
# File 'lib/influxdb/config.rb', line 28 def udp @udp end |
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def use_ssl @use_ssl end |
#username ⇒ Object
Returns the value of attribute username.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def username @username end |
#verify_ssl ⇒ Object
Returns the value of attribute verify_ssl.
8 9 10 |
# File 'lib/influxdb/config.rb', line 8 def verify_ssl @verify_ssl end |
Instance Method Details
#async? ⇒ Boolean
45 46 47 |
# File 'lib/influxdb/config.rb', line 45 def async? async != false end |
#hosts ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/influxdb/config.rb', line 55 def hosts Array.new(@hosts_queue.length) do host = @hosts_queue.pop @hosts_queue.push(host) host end end |
#next_host ⇒ Object
49 50 51 52 53 |
# File 'lib/influxdb/config.rb', line 49 def next_host host = @hosts_queue.pop @hosts_queue.push(host) host end |
#udp? ⇒ Boolean
41 42 43 |
# File 'lib/influxdb/config.rb', line 41 def udp? udp != false end |