From c0b4cdb5087d200538e701920ea869b281f1ad2e Mon Sep 17 00:00:00 2001 From: Kaise Cheng Date: Fri, 28 Feb 2025 17:07:19 +0000 Subject: [PATCH] add test --- qa/integration/services/monitoring_api.rb | 6 ++++++ x-pack/qa/integration/monitoring/direct_shipping_spec.rb | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/qa/integration/services/monitoring_api.rb b/qa/integration/services/monitoring_api.rb index 76372f25b5e..34b52634f11 100644 --- a/qa/integration/services/monitoring_api.rb +++ b/qa/integration/services/monitoring_api.rb @@ -31,6 +31,12 @@ def pipeline_stats(pipeline_id) stats_response.fetch("pipelines").fetch(pipeline_id) end + def pipelines_stats + resp = Manticore.get("http://localhost:#{@port}/_node/stats/pipelines").body + stats_response = JSON.parse(resp) + stats_response.fetch("pipelines") + end + def event_stats resp = Manticore.get("http://localhost:#{@port}/_node/stats").body stats_response = JSON.parse(resp) diff --git a/x-pack/qa/integration/monitoring/direct_shipping_spec.rb b/x-pack/qa/integration/monitoring/direct_shipping_spec.rb index 183f91906ed..2228c158c0e 100644 --- a/x-pack/qa/integration/monitoring/direct_shipping_spec.rb +++ b/x-pack/qa/integration/monitoring/direct_shipping_spec.rb @@ -31,6 +31,12 @@ include_examples "record monitoring data to es" + it "gives pipelines stats" do + api = MonitoringAPI.new + stats = api.pipelines_stats + expect(stats.keys).not_to be_nil + end + after :all do @logstash_service.stop unless @logstash_service.nil? @elasticsearch_service.stop unless @elasticsearch_service.nil?