elastic / elastic/logstash-devutils
LogStash configuration is compiled for every sample
- Dominant language
- Ruby
- Stars
- 17
- Forks
- 27
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 1
Description
We have a quite complex configuration file (approximately 1500 lines) and I believe that this line is costly: https://github.com/elastic/logstash/blob/master/lib/logstash/pipeline.rb#L26
If I understand correctly [this code](https://github.com/elastic/logstash-devutils/blob/master/lib/logstash/devutils/rspec/logstash_helpers.rb#L34), a new pipeline is created for every `sample()` method, meaning that the configuration is compiled every time.
Meaning that the following test will load and compile 3 times the same configuration:
``` ruby
require "test_utils"
describe "apache common log format" do
extend LogStash::RSpec
config %q{
# Your logstash filter config here
}
sample "apache log in debug" do
insist { subject["level"] } == "DEBUG"
end
sample "apache log in info" do
insist { subject["level"] } == "INFO"
end
sample "apache log with stack trace" do
insist { subject["stacktrace"] } == "oups!"
end
end
```
Would it be possible to configure this behavior ? We have 300+ samples and running our tests suite is really slow.
Having said that I think that this behavior should be the default. If I do want to use a different configuration I can call `config` again with the new configuration, no ?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.