diff --git a/logstash-core/lib/logstash/api/commands/node.rb b/logstash-core/lib/logstash/api/commands/node.rb index e27ecc3c9..816d6be8f 100644 --- a/logstash-core/lib/logstash/api/commands/node.rb +++ b/logstash-core/lib/logstash/api/commands/node.rb @@ -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()), diff --git a/logstash-core/lib/logstash/pipeline.rb b/logstash-core/lib/logstash/pipeline.rb index 7fdb679f7..9b0c56d54 100644 --- a/logstash-core/lib/logstash/pipeline.rb +++ b/logstash-core/lib/logstash/pipeline.rb @@ -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, diff --git a/logstash-core/spec/api/lib/api/node_spec.rb b/logstash-core/spec/api/lib/api/node_spec.rb index 357b3b5ba..17cf56209 100644 --- a/logstash-core/spec/api/lib/api/node_spec.rb +++ b/logstash-core/spec/api/lib/api/node_spec.rb @@ -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 diff --git a/logstash-core/spec/api/lib/api/support/resource_dsl_methods.rb b/logstash-core/spec/api/lib/api/support/resource_dsl_methods.rb index 03ee08f41..f014f9740 100644 --- a/logstash-core/spec/api/lib/api/support/resource_dsl_methods.rb +++ b/logstash-core/spec/api/lib/api/support/resource_dsl_methods.rb @@ -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={})