logstash-perftool 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/.rspec +3 -0
  4. data/CONTRIBUTORS +11 -0
  5. data/Gemfile +3 -0
  6. data/LICENSE +13 -0
  7. data/README.md +119 -0
  8. data/Rakefile +10 -0
  9. data/bin/lsperfm +9 -0
  10. data/bin/lsperfm-deps +32 -0
  11. data/examples/config/complex_syslog.conf +46 -0
  12. data/examples/config/json_inout_codec.conf +11 -0
  13. data/examples/config/json_inout_filter.conf +11 -0
  14. data/examples/config/simple.conf +11 -0
  15. data/examples/config/simple_grok.conf +13 -0
  16. data/examples/config/simple_json_out.conf +11 -0
  17. data/examples/input/apache_log.txt +30 -0
  18. data/examples/input/json_medium.txt +10 -0
  19. data/examples/input/simple_10.txt +10 -0
  20. data/examples/input/syslog_acl_10.txt +10 -0
  21. data/examples/suite/basic_performance_long.rb +18 -0
  22. data/examples/suite/basic_performance_quick.rb +18 -0
  23. data/lib/lsperfm.rb +22 -0
  24. data/lib/lsperfm/core.rb +81 -0
  25. data/lib/lsperfm/core/reporter.rb +21 -0
  26. data/lib/lsperfm/core/run.rb +139 -0
  27. data/lib/lsperfm/core/stats.rb +64 -0
  28. data/lib/lsperfm/defaults/config/complex_syslog.conf +46 -0
  29. data/lib/lsperfm/defaults/config/json_inout_codec.conf +11 -0
  30. data/lib/lsperfm/defaults/config/json_inout_filter.conf +11 -0
  31. data/lib/lsperfm/defaults/config/simple.conf +11 -0
  32. data/lib/lsperfm/defaults/config/simple_grok.conf +13 -0
  33. data/lib/lsperfm/defaults/config/simple_json_out.conf +11 -0
  34. data/lib/lsperfm/defaults/input/apache_log.txt +30 -0
  35. data/lib/lsperfm/defaults/input/json_medium.txt +10 -0
  36. data/lib/lsperfm/defaults/input/simple_10.txt +10 -0
  37. data/lib/lsperfm/defaults/input/syslog_acl_10.txt +10 -0
  38. data/lib/lsperfm/defaults/suite.rb +12 -0
  39. data/lib/lsperfm/defaults/suite/long.rb +18 -0
  40. data/lib/lsperfm/defaults/suite/quick.rb +18 -0
  41. data/lib/lsperfm/version.rb +5 -0
  42. data/logstash-perftool.gemspec +24 -0
  43. data/scripts/loader.rb +114 -0
  44. data/scripts/setup.sh +63 -0
  45. data/spec/fixtures/basic_suite.rb +4 -0
  46. data/spec/fixtures/config.yml +4 -0
  47. data/spec/fixtures/simple.conf +11 -0
  48. data/spec/fixtures/simple_10.txt +10 -0
  49. data/spec/fixtures/wrong_config.yml +4 -0
  50. data/spec/lib/runner_spec.rb +35 -0
  51. data/spec/lib/suite_spec.rb +51 -0
  52. data/spec/spec_helper.rb +9 -0
  53. data/suite.rb +46 -0
  54. metadata +154 -0
@@ -0,0 +1,9 @@
1
+ ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
2
+ $LOAD_PATH.unshift File.join(ROOT, 'lib')
3
+ $LOAD_PATH.unshift File.join(ROOT, 'spec')
4
+
5
+ require 'lsperfm'
6
+
7
+ def load_fixture(name)
8
+ IO.read("spec/fixtures/#{name}")
9
+ end
data/suite.rb ADDED
@@ -0,0 +1,46 @@
1
+ # encoding: utf-8
2
+
3
+ require_relative 'run'
4
+
5
+ RUNNER = File.join(File.expand_path(File.dirname(__FILE__)), "run.rb")
6
+ BASE_DIR = File.expand_path(File.dirname(__FILE__))
7
+
8
+ ## script main
9
+
10
+ if ARGV.size < 1 or ARGV.size > 2
11
+ $stderr.puts("usage: ruby suite.rb [suite file] [logstash path]")
12
+ exit(1)
13
+ end
14
+
15
+ @debug = !!ENV["DEBUG"]
16
+
17
+ logstash_home = ENV['LOGSTASH_HOME'] || 'logstash'
18
+ install_path = ARGV.size > 1 ? ARGV[1] : logstash_home
19
+
20
+ tests = eval(IO.read(ARGV[0]))
21
+ lines = ["name, #{Runner.headers.join(',')}"]
22
+ first = true
23
+
24
+ reporter = Thread.new do
25
+ loop do
26
+ $stderr.print "."
27
+ sleep 1
28
+ end
29
+ end
30
+
31
+ tests.each do |test|
32
+
33
+ events = test[:events].to_i # total number of events to feed, independant of input file size
34
+ time = test[:time].to_i
35
+ config = File.join(BASE_DIR, test[:config])
36
+ input = File.join(BASE_DIR, test[:input])
37
+
38
+ runner = Runner.new(config, @debug, install_path)
39
+ p, elaspsed, events_count = runner.run(events, time, runner.read_input_file(input))
40
+
41
+ lines << "#{test[:name]}, #{"%.2f" % elaspsed}, #{events_count}, #{"%.0f" % (events_count / elaspsed)},#{p.last}, #{"%.0f" % (p.reduce(:+) / p.size)}"
42
+ first = false
43
+ end
44
+
45
+ reporter.kill
46
+ puts lines.join("\n")
metadata ADDED
@@ -0,0 +1,154 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: logstash-perftool
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Pere Urbon-Bayes
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ version_requirements: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ requirement: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ~>
23
+ - !ruby/object:Gem::Version
24
+ version: '1.7'
25
+ prerelease: false
26
+ type: :development
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ~>
37
+ - !ruby/object:Gem::Version
38
+ version: '10.0'
39
+ prerelease: false
40
+ type: :development
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '3.3'
48
+ - - '>='
49
+ - !ruby/object:Gem::Version
50
+ version: 3.3.0
51
+ requirement: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: '3.3'
56
+ - - '>='
57
+ - !ruby/object:Gem::Version
58
+ version: 3.3.0
59
+ prerelease: false
60
+ type: :development
61
+ description: A performance testing tool for Logstash
62
+ email:
63
+ - pere.urbon@elastic.co
64
+ executables:
65
+ - lsperfm
66
+ - lsperfm-deps
67
+ extensions: []
68
+ extra_rdoc_files: []
69
+ files:
70
+ - .gitignore
71
+ - .rspec
72
+ - CONTRIBUTORS
73
+ - Gemfile
74
+ - LICENSE
75
+ - README.md
76
+ - Rakefile
77
+ - bin/lsperfm
78
+ - bin/lsperfm-deps
79
+ - examples/config/complex_syslog.conf
80
+ - examples/config/json_inout_codec.conf
81
+ - examples/config/json_inout_filter.conf
82
+ - examples/config/simple.conf
83
+ - examples/config/simple_grok.conf
84
+ - examples/config/simple_json_out.conf
85
+ - examples/input/apache_log.txt
86
+ - examples/input/json_medium.txt
87
+ - examples/input/simple_10.txt
88
+ - examples/input/syslog_acl_10.txt
89
+ - examples/suite/basic_performance_long.rb
90
+ - examples/suite/basic_performance_quick.rb
91
+ - lib/lsperfm.rb
92
+ - lib/lsperfm/core.rb
93
+ - lib/lsperfm/core/reporter.rb
94
+ - lib/lsperfm/core/run.rb
95
+ - lib/lsperfm/core/stats.rb
96
+ - lib/lsperfm/defaults/config/complex_syslog.conf
97
+ - lib/lsperfm/defaults/config/json_inout_codec.conf
98
+ - lib/lsperfm/defaults/config/json_inout_filter.conf
99
+ - lib/lsperfm/defaults/config/simple.conf
100
+ - lib/lsperfm/defaults/config/simple_grok.conf
101
+ - lib/lsperfm/defaults/config/simple_json_out.conf
102
+ - lib/lsperfm/defaults/input/apache_log.txt
103
+ - lib/lsperfm/defaults/input/json_medium.txt
104
+ - lib/lsperfm/defaults/input/simple_10.txt
105
+ - lib/lsperfm/defaults/input/syslog_acl_10.txt
106
+ - lib/lsperfm/defaults/suite.rb
107
+ - lib/lsperfm/defaults/suite/long.rb
108
+ - lib/lsperfm/defaults/suite/quick.rb
109
+ - lib/lsperfm/version.rb
110
+ - logstash-perftool.gemspec
111
+ - scripts/loader.rb
112
+ - scripts/setup.sh
113
+ - spec/fixtures/basic_suite.rb
114
+ - spec/fixtures/config.yml
115
+ - spec/fixtures/simple.conf
116
+ - spec/fixtures/simple_10.txt
117
+ - spec/fixtures/wrong_config.yml
118
+ - spec/lib/runner_spec.rb
119
+ - spec/lib/suite_spec.rb
120
+ - spec/spec_helper.rb
121
+ - suite.rb
122
+ homepage: http://logstash.net/
123
+ licenses:
124
+ - Apache License (2.0)
125
+ metadata: {}
126
+ post_install_message:
127
+ rdoc_options: []
128
+ require_paths:
129
+ - lib
130
+ required_ruby_version: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - '>='
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
135
+ required_rubygems_version: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - '>='
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ requirements: []
141
+ rubyforge_project:
142
+ rubygems_version: 2.4.5
143
+ signing_key:
144
+ specification_version: 4
145
+ summary: With this gem you can run core performance test for your logstash-core pipeline
146
+ test_files:
147
+ - spec/fixtures/basic_suite.rb
148
+ - spec/fixtures/config.yml
149
+ - spec/fixtures/simple.conf
150
+ - spec/fixtures/simple_10.txt
151
+ - spec/fixtures/wrong_config.yml
152
+ - spec/lib/runner_spec.rb
153
+ - spec/lib/suite_spec.rb
154
+ - spec/spec_helper.rb