Class: InfluxDB2::WriteOptions
- Inherits:
-
Object
- Object
- InfluxDB2::WriteOptions
- Defined in:
- lib/influxdb2/client/write_api.rb
Overview
Creates write api configuration.
Instance Attribute Summary collapse
-
#batch_abort_on_exception ⇒ Object
readonly
Returns the value of attribute batch_abort_on_exception.
-
#batch_size ⇒ Object
readonly
Returns the value of attribute batch_size.
-
#exponential_base ⇒ Object
readonly
Returns the value of attribute exponential_base.
-
#flush_interval ⇒ Object
readonly
Returns the value of attribute flush_interval.
-
#jitter_interval ⇒ Object
readonly
Returns the value of attribute jitter_interval.
-
#max_retries ⇒ Object
readonly
Returns the value of attribute max_retries.
-
#max_retry_delay ⇒ Object
readonly
Returns the value of attribute max_retry_delay.
-
#max_retry_time ⇒ Object
readonly
Returns the value of attribute max_retry_time.
-
#retry_interval ⇒ Object
readonly
Returns the value of attribute retry_interval.
-
#write_type ⇒ Object
readonly
Returns the value of attribute write_type.
Instance Method Summary collapse
- #_check_not_negative(key, value) ⇒ Object
- #_check_positive(key, value) ⇒ Object
-
#initialize(write_type: WriteType::SYNCHRONOUS, batch_size: 1_000, flush_interval: 1_000, retry_interval: 5_000, jitter_interval: 0, max_retries: 5, max_retry_delay: 125_000, max_retry_time: 180_000, exponential_base: 2, batch_abort_on_exception: false) ⇒ WriteOptions
constructor
A new instance of WriteOptions.
Constructor Details
#initialize(write_type: WriteType::SYNCHRONOUS, batch_size: 1_000, flush_interval: 1_000, retry_interval: 5_000, jitter_interval: 0, max_retries: 5, max_retry_delay: 125_000, max_retry_time: 180_000, exponential_base: 2, batch_abort_on_exception: false) ⇒ WriteOptions
Returns a new instance of WriteOptions.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/influxdb2/client/write_api.rb', line 46 def initialize(write_type: WriteType::SYNCHRONOUS, batch_size: 1_000, flush_interval: 1_000, retry_interval: 5_000, jitter_interval: 0, max_retries: 5, max_retry_delay: 125_000, max_retry_time: 180_000, exponential_base: 2, batch_abort_on_exception: false) _check_not_negative('batch_size', batch_size) _check_not_negative('flush_interval', flush_interval) _check_not_negative('retry_interval', retry_interval) _check_positive('jitter_interval', jitter_interval) _check_positive('max_retries', max_retries) _check_positive('max_retry_delay', max_retry_delay) _check_positive('max_retry_time', max_retry_time) _check_positive('exponential_base', exponential_base) @write_type = write_type @batch_size = batch_size @flush_interval = flush_interval @retry_interval = retry_interval @jitter_interval = jitter_interval @max_retries = max_retries @max_retry_delay = max_retry_delay @max_retry_time = max_retry_time @exponential_base = exponential_base @batch_abort_on_exception = batch_abort_on_exception end |
Instance Attribute Details
#batch_abort_on_exception ⇒ Object (readonly)
Returns the value of attribute batch_abort_on_exception.
69 70 71 |
# File 'lib/influxdb2/client/write_api.rb', line 69 def batch_abort_on_exception @batch_abort_on_exception end |
#batch_size ⇒ Object (readonly)
Returns the value of attribute batch_size.
69 70 71 |
# File 'lib/influxdb2/client/write_api.rb', line 69 def batch_size @batch_size end |
#exponential_base ⇒ Object (readonly)
Returns the value of attribute exponential_base.
69 70 71 |
# File 'lib/influxdb2/client/write_api.rb', line 69 def exponential_base @exponential_base end |
#flush_interval ⇒ Object (readonly)
Returns the value of attribute flush_interval.
69 70 71 |
# File 'lib/influxdb2/client/write_api.rb', line 69 def flush_interval @flush_interval end |
#jitter_interval ⇒ Object (readonly)
Returns the value of attribute jitter_interval.
69 70 71 |
# File 'lib/influxdb2/client/write_api.rb', line 69 def jitter_interval @jitter_interval end |
#max_retries ⇒ Object (readonly)
Returns the value of attribute max_retries.
69 70 71 |
# File 'lib/influxdb2/client/write_api.rb', line 69 def max_retries @max_retries end |
#max_retry_delay ⇒ Object (readonly)
Returns the value of attribute max_retry_delay.
69 70 71 |
# File 'lib/influxdb2/client/write_api.rb', line 69 def max_retry_delay @max_retry_delay end |
#max_retry_time ⇒ Object (readonly)
Returns the value of attribute max_retry_time.
69 70 71 |
# File 'lib/influxdb2/client/write_api.rb', line 69 def max_retry_time @max_retry_time end |
#retry_interval ⇒ Object (readonly)
Returns the value of attribute retry_interval.
69 70 71 |
# File 'lib/influxdb2/client/write_api.rb', line 69 def retry_interval @retry_interval end |
#write_type ⇒ Object (readonly)
Returns the value of attribute write_type.
69 70 71 |
# File 'lib/influxdb2/client/write_api.rb', line 69 def write_type @write_type end |
Instance Method Details
#_check_not_negative(key, value) ⇒ Object
72 73 74 |
# File 'lib/influxdb2/client/write_api.rb', line 72 def _check_not_negative(key, value) raise ArgumentError, "The '#{key}' should be positive or zero, but is: #{value}" if value <= 0 end |
#_check_positive(key, value) ⇒ Object
76 77 78 |
# File 'lib/influxdb2/client/write_api.rb', line 76 def _check_positive(key, value) raise ArgumentError, "The '#{key}' should be positive number, but is: #{value}" if value < 0 end |