Adding the values for the automatic reloading to the API

```
config_reload_automatic: true,
config_reload_interval: 3
```

Fixes: #5681

Fixes #5780
This commit is contained in:
Pier-Hugues Pellerin 2016-08-18 13:47:01 -04:00
parent 2abbe64e99
commit 7312a12f36
4 changed files with 20 additions and 6 deletions

View file

@ -20,7 +20,7 @@ module LogStash
def pipeline
extract_metrics(
[:stats, :pipelines, :main, :config],
:workers, :batch_size, :batch_delay
:workers, :batch_size, :batch_delay, :config_reload_automatic, :config_reload_interval
)
end

View file

@ -95,7 +95,7 @@ module LogStash; class Pipeline
queue = LogStash::Util::WrappedSynchronousQueue.new
@input_queue_client = queue.write_client
@filter_queue_client = queue.read_client
# Note that @infilght_batches as a central mechanism for tracking inflight
# Note that @inflight_batches as a central mechanism for tracking inflight
# batches will fail if we have multiple read clients here.
@filter_queue_client.set_events_metric(metric.namespace([:stats, :events]))
@filter_queue_client.set_pipeline_metric(
@ -206,6 +206,8 @@ module LogStash; class Pipeline
config_metric.gauge(:workers, pipeline_workers)
config_metric.gauge(:batch_size, batch_size)
config_metric.gauge(:batch_delay, batch_delay)
config_metric.gauge(:config_reload_automatic, @settings.get("config.reload.automatic"))
config_metric.gauge(:config_reload_interval, @settings.get("config.reload.interval"))
@logger.info("Starting pipeline",
"id" => self.pipeline_id,

View file

@ -111,7 +111,9 @@ describe LogStash::Api::Modules::Node do
"pipeline" => {
"workers" => Numeric,
"batch_size" => Numeric,
"batch_delay" => Numeric
"batch_delay" => Numeric,
"config_reload_automatic" => Boolean,
"config_reload_interval" => Numeric
},
"os" => {
"name" => String,

View file

@ -1,3 +1,13 @@
# Ruby doesn't have common class for boolean,
# And to simplify the ResourceDSLMethods check it make sense to have it.
module Boolean; end
class TrueClass
include Boolean
end
class FalseClass
include Boolean
end
module ResourceDSLMethods
# Convert a nested hash to a mapping of key paths to expected classes
def hash_to_mapping(h, path=[], mapping={})