logstash-input-heartbeat 1.0.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c6ed21d3597533a4db1bed30c7a7fc13bd37d13
4
- data.tar.gz: 609031c0c9872b2600bc1a61d1a351a0aac8c255
3
+ metadata.gz: 630264b9dd2fd566e3464843a932a391afaba518
4
+ data.tar.gz: 6fe312ae35eccdcd86fab4ad2bc86165b22a50da
5
5
  SHA512:
6
- metadata.gz: b748154c51d5acb2308c66a3d7779bbf0e830c562e43f99ada83f895ee0e6ee856799dcec3a2db8b408a837cfc0f45d1def844ac78a96a3c02da82ba627898ca
7
- data.tar.gz: 3d2f4d0a276a6d21718af2e1713555abea730de8455e2efe7ee73e2ffb2f90883a4df6e85c280c91817ec9545934aeb0b14007ae8b76704b5fb124f4a5bde88d
6
+ metadata.gz: 804c64aa3f61246affd13b418141bdc25683da7c6b00a03411bf886fc3d59791968d53ee60bdfcb3a3dc657f9e50249ab01bec34da709a3df5fbf697ba13071e
7
+ data.tar.gz: fdd51bd76558e2912ad4d0cf9fb18b1dc91ddc2ab58de30b50525c9d63a8bccda86140ff3fced157d41bbc1bb9b8db0835602ea17967e1091ec83247e44d24d7
data/README.md CHANGED
@@ -1,15 +1,15 @@
1
1
  # Logstash Plugin
2
2
 
3
- This is a plugin for [Logstash](https://github.com/elasticsearch/logstash).
3
+ This is a plugin for [Logstash](https://github.com/elastic/logstash).
4
4
 
5
5
  It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
6
6
 
7
7
  ## Documentation
8
8
 
9
- Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elasticsearch.org/guide/en/logstash/current/).
9
+ Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elastic.co/guide/en/logstash/current/).
10
10
 
11
11
  - For formatting code or config example, you can use the asciidoc `[source,ruby]` directive
12
- - For more asciidoc formatting tips, see the excellent reference here https://github.com/elasticsearch/docs#asciidoc-guide
12
+ - For more asciidoc formatting tips, see the excellent reference here https://github.com/elastic/docs#asciidoc-guide
13
13
 
14
14
  ## Need Help?
15
15
 
@@ -83,4 +83,4 @@ Programming is not a required skill. Whatever you've seen about open source and
83
83
 
84
84
  It is more important to the community that you are able to contribute.
85
85
 
86
- For more information about contributing, see the [CONTRIBUTING](https://github.com/elasticsearch/logstash/blob/master/CONTRIBUTING.md) file.
86
+ For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.
@@ -45,13 +45,14 @@ class LogStash::Inputs::Heartbeat < LogStash::Inputs::Threadable
45
45
 
46
46
  def run(queue)
47
47
  sequence = 0
48
+ @thread = Thread.current
48
49
 
49
50
  Stud.interval(@interval) do
50
51
  sequence += 1
51
52
  event = generate_message(sequence)
52
53
  decorate(event)
53
54
  queue << event
54
- break if sequence == @count
55
+ break if sequence == @count || stop?
55
56
  end # loop
56
57
 
57
58
  end # def run
@@ -67,4 +68,7 @@ class LogStash::Inputs::Heartbeat < LogStash::Inputs::Threadable
67
68
  end
68
69
  end
69
70
 
71
+ def stop
72
+ Stud.stop!(@thread)
73
+ end
70
74
  end # class LogStash::Inputs::Heartbeat
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-heartbeat'
4
- s.version = '1.0.0'
4
+ s.version = '2.0.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "This input generates a heartbeat pattern to aid in monitoring Logstash performance & availability"
7
7
  s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.require_paths = ["lib"]
12
12
 
13
13
  # Files
14
- s.files = `git ls-files`.split($\)
14
+ s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
15
15
 
16
16
  # Tests
17
17
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "input" }
21
21
 
22
22
  # Gem dependencies
23
- s.add_runtime_dependency "logstash-core", '>= 1.4.0', '< 2.0.0'
23
+ s.add_runtime_dependency "logstash-core", "~> 2.0.0.snapshot"
24
24
  s.add_runtime_dependency 'logstash-codec-plain'
25
25
  s.add_runtime_dependency 'stud'
26
26
 
@@ -2,6 +2,11 @@ require "logstash/devutils/rspec/spec_helper"
2
2
  require "logstash/inputs/heartbeat"
3
3
 
4
4
  describe LogStash::Inputs::Heartbeat do
5
+
6
+ it_behaves_like "an interruptible input plugin" do
7
+ let(:config) { { "interval" => 100 } }
8
+ end
9
+
5
10
  sequence = 1
6
11
  context "Default message test" do
7
12
  subject { LogStash::Inputs::Heartbeat.new({}) }
@@ -37,22 +42,14 @@ describe LogStash::Inputs::Heartbeat do
37
42
  end # it "should return an event with the current time (as epoch)"
38
43
  end # context "Epoch test"
39
44
 
40
- it "should generate a fixed number of events then stop" do
41
- count = 4
42
- config = <<-CONFIG
43
- input {
44
- heartbeat {
45
- interval => 1
46
- message => "sequence"
47
- count => #{count}
48
- }
49
- }
50
- CONFIG
51
-
52
- events = input(config) do |pipeline, queue|
53
- count.times.map{queue.pop}
54
- end
45
+ context "with a fixed count" do
46
+ let(:events) { [] }
47
+ let(:count) { 4 }
48
+ subject { LogStash::Inputs::Heartbeat.new("interval" => 1, "message" => "sequence", "count" => count) }
55
49
 
56
- events.each_with_index{|event, i| expect(event['clock']).to eq(i + 1)}
50
+ it "should generate a fixed number of events then stop" do
51
+ subject.run(events)
52
+ events.each_with_index{|event, i| expect(event['clock']).to eq(i + 1)}
53
+ end
57
54
  end
58
55
  end
metadata CHANGED
@@ -1,84 +1,77 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-heartbeat
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-24 00:00:00.000000000 Z
11
+ date: 2015-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: logstash-core
15
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '>='
18
- - !ruby/object:Gem::Version
19
- version: 1.4.0
20
- - - <
21
- - !ruby/object:Gem::Version
22
- version: 2.0.0
23
14
  requirement: !ruby/object:Gem::Requirement
24
15
  requirements:
25
- - - '>='
16
+ - - ~>
26
17
  - !ruby/object:Gem::Version
27
- version: 1.4.0
28
- - - <
29
- - !ruby/object:Gem::Version
30
- version: 2.0.0
18
+ version: 2.0.0.snapshot
19
+ name: logstash-core
31
20
  prerelease: false
32
21
  type: :runtime
33
- - !ruby/object:Gem::Dependency
34
- name: logstash-codec-plain
35
22
  version_requirements: !ruby/object:Gem::Requirement
36
23
  requirements:
37
- - - '>='
24
+ - - ~>
38
25
  - !ruby/object:Gem::Version
39
- version: '0'
26
+ version: 2.0.0.snapshot
27
+ - !ruby/object:Gem::Dependency
40
28
  requirement: !ruby/object:Gem::Requirement
41
29
  requirements:
42
30
  - - '>='
43
31
  - !ruby/object:Gem::Version
44
32
  version: '0'
33
+ name: logstash-codec-plain
45
34
  prerelease: false
46
35
  type: :runtime
47
- - !ruby/object:Gem::Dependency
48
- name: stud
49
36
  version_requirements: !ruby/object:Gem::Requirement
50
37
  requirements:
51
38
  - - '>='
52
39
  - !ruby/object:Gem::Version
53
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
54
42
  requirement: !ruby/object:Gem::Requirement
55
43
  requirements:
56
44
  - - '>='
57
45
  - !ruby/object:Gem::Version
58
46
  version: '0'
47
+ name: stud
59
48
  prerelease: false
60
49
  type: :runtime
61
- - !ruby/object:Gem::Dependency
62
- name: logstash-devutils
63
50
  version_requirements: !ruby/object:Gem::Requirement
64
51
  requirements:
65
52
  - - '>='
66
53
  - !ruby/object:Gem::Version
67
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
68
56
  requirement: !ruby/object:Gem::Requirement
69
57
  requirements:
70
58
  - - '>='
71
59
  - !ruby/object:Gem::Version
72
60
  version: '0'
61
+ name: logstash-devutils
73
62
  prerelease: false
74
63
  type: :development
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
75
69
  description: This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
76
70
  email: info@elastic.co
77
71
  executables: []
78
72
  extensions: []
79
73
  extra_rdoc_files: []
80
74
  files:
81
- - .gitignore
82
75
  - CHANGELOG.md
83
76
  - CONTRIBUTORS
84
77
  - DEVELOPER.md
@@ -86,7 +79,6 @@ files:
86
79
  - LICENSE
87
80
  - NOTICE.TXT
88
81
  - README.md
89
- - Rakefile
90
82
  - lib/logstash/inputs/heartbeat.rb
91
83
  - logstash-input-heartbeat.gemspec
92
84
  - spec/inputs/heartbeat_spec.rb
@@ -112,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
104
  version: '0'
113
105
  requirements: []
114
106
  rubyforge_project:
115
- rubygems_version: 2.2.2
107
+ rubygems_version: 2.4.8
116
108
  signing_key:
117
109
  specification_version: 4
118
110
  summary: This input generates a heartbeat pattern to aid in monitoring Logstash performance & availability
data/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- *.gem
2
- Gemfile.lock
3
- Gemfile.bak
4
- .bundle
5
- vendor
data/Rakefile DELETED
@@ -1 +0,0 @@
1
- require "logstash/devutils/rake"