forked from elastic/logstash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:logstash/logstash
- Loading branch information
Showing
12 changed files
with
156 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
require "test_utils" | ||
require "ftw" | ||
|
||
describe "outputs/elasticsearch" do | ||
extend LogStash::RSpec | ||
|
||
describe "ship lots of events" do | ||
# Generate a random index name | ||
index = 10.times.collect { rand(10).to_s }.join("") | ||
|
||
# Write about 10000 events. Add jitter to increase likeliness of finding | ||
# boundary-related bugs. | ||
event_count = 10000 + rand(500) | ||
|
||
embedded_http_port = rand(20000) + 10000 | ||
|
||
config <<-CONFIG | ||
input { | ||
generator { | ||
message => "hello world" | ||
count => #{event_count} | ||
type => "generator" | ||
} | ||
} | ||
output { | ||
elasticsearch { | ||
embedded => true | ||
embedded_http_port => #{embedded_http_port} | ||
cluster => "#{index}" | ||
index => "#{index}" | ||
index_type => "testing" | ||
} | ||
} | ||
CONFIG | ||
|
||
agent do | ||
# Try a few times to check if we have the correct number of events stored | ||
# in ES. | ||
# | ||
# We try multiple times to allow final agent flushes as well as allowing | ||
# elasticsearch to finish processing everything. | ||
Stud::try(10.times) do | ||
ftw = FTW::Agent.new | ||
data = "" | ||
response = ftw.get!("http://127.0.0.1:#{embedded_http_port}/#{index}/_count?q=*") | ||
response.read_body { |chunk| data << chunk } | ||
count = JSON.parse(data)["count"] | ||
insist { count } == event_count | ||
end | ||
|
||
puts "Rate: #{event_count / @duration}/sec" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
VERSION?=2.4.17 | ||
TARBALL=redis-$(VERSION).tar.gz | ||
DIR=redis-$(VERSION) | ||
BASEURL=http://redis.googlecode.com/files | ||
|
||
default: build | ||
|
||
run: | build | ||
$(DIR)/src/redis-server | ||
|
||
fetch: $(TARBALL) | ||
extract: $(DIR) | fetch | ||
|
||
build: $(DIR)/src/redis-server | ||
|
||
$(DIR)/src/redis-server: | extract | ||
cd $(DIR); make | ||
|
||
clean: | ||
-rm -rf $(DIR) | ||
|
||
distclean: | ||
-rm -f $(TARBALL) | ||
|
||
$(TARBALL): | ||
wget $(BASEURL)/$@ | ||
|
||
$(DIR): | $(TARBALL) | ||
tar -zxf $(TARBALL) |