mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
Fix an issue when data was not present in the collector
When you ran this test in isolation it failed to find the corresponding metric, Changed the behavior to force a collect before running the tests. Fixes #5446
This commit is contained in:
parent
d02d4e4429
commit
21a47b8db9
1 changed files with 6 additions and 3 deletions
|
@ -1,8 +1,10 @@
|
|||
require 'spec_helper'
|
||||
require 'logstash/instrument/periodic_poller/jvm'
|
||||
# encoding: utf-8
|
||||
require "spec_helper"
|
||||
require "logstash/instrument/periodic_poller/jvm"
|
||||
require "logstash/instrument/collector"
|
||||
|
||||
describe LogStash::Instrument::PeriodicPoller::JVM do
|
||||
let(:metric) { LogStash::Instrument::Metric.new }
|
||||
let(:metric) { LogStash::Instrument::Metric.new(LogStash::Instrument::Collector.new) }
|
||||
let(:options) { {} }
|
||||
subject(:jvm) { described_class.new(metric, options) }
|
||||
|
||||
|
@ -18,6 +20,7 @@ describe LogStash::Instrument::PeriodicPoller::JVM do
|
|||
end
|
||||
|
||||
describe "metrics" do
|
||||
before(:each) { jvm.collect }
|
||||
let(:snapshot_store) { metric.collector.snapshot_metric.metric_store }
|
||||
subject(:jvm_metrics) { snapshot_store.get_shallow(:jvm, :process) }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue