shutdown after spec

Fixes #6236
This commit is contained in:
Suyog Rao 2016-11-10 18:18:31 -08:00
parent b41407c99b
commit 183ab07ec0
2 changed files with 8 additions and 4 deletions

View file

@ -46,7 +46,7 @@ module LogStash module Instrument module PeriodicPoller
collect_pools_metrics(raw)
collect_threads_metrics
collect_process_metrics
collect_gc_stats
collect_gc_stats
end
private
@ -104,10 +104,10 @@ module LogStash module Instrument module PeriodicPoller
metric.gauge([:jvm], :uptime_in_millis, runtime_mx_bean.getUptime())
collect_heap_metrics(data)
collect_non_heap_metrics(data)
end
end
def collect_heap_metrics(data)
heap = aggregate_information_for(data["heap"].values)
heap = aggregate_information_for(data["heap"].values)
heap[:used_percent] = (heap[:used_in_bytes] / heap[:max_in_bytes].to_f)*100.0
heap.each_pair do |key, value|

View file

@ -12,6 +12,10 @@ describe "Test Monitoring API" do
@fixture.teardown
}
after(:each) {
@fixture.get_service("logstash").teardown
}
let(:number_of_events) { 5 }
let(:max_retry) { 120 }
@ -19,7 +23,7 @@ describe "Test Monitoring API" do
logstash_service = @fixture.get_service("logstash")
logstash_service.start_with_stdin
number_of_events.times { logstash_service.write_to_stdin("Hello world") }
begin
sleep(1) while (result = logstash_service.monitoring_api.event_stats).nil?
rescue