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 1327fab555
commit aaa3352d0f
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
@ -42,7 +42,7 @@ module LogStash
:vm_name => java.lang.System.getProperty("java.vm.name"),
:vm_version => java.lang.System.getProperty("java.version"),
:vm_vendor => java.lang.System.getProperty("java.vendor"),
:vm_name => java.lang.System.getProperty("java.vm.name"),
:vm_name => java.lang.System.getProperty("java.vm.name"),
:start_time_in_millis => started_at,
:mem => {
:heap_init_in_bytes => (memory_bean.getHeapMemoryUsage().getInit() < 0 ? 0 : memory_bean.getHeapMemoryUsage().getInit()),

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,
@ -140,8 +142,8 @@ describe LogStash::Api::Modules::Node do
"threads" => Array
}
}
test_api_and_resources(root_structure, :exclude_from_root => ["hot_threads"])
end
end
end
end

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={})