logstash-input-perfmon 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 601dbc961227dcfc88ff5824c38e77d07dc3813c
4
- data.tar.gz: 40e746091821835a2bd829fd8d7462a51bcbc5ca
3
+ metadata.gz: da5408d570f346b92be0025f5dd90e4b3f8c507f
4
+ data.tar.gz: b1fbda74d2668639848521a8d566e4167d64c6d1
5
5
  SHA512:
6
- metadata.gz: 2f9797ef221c5e1497414437b1c71ee144baf98e24bc02d7192e2ba7544b7a99c68d359849f1bfdda869246ed09a90cb7f97b986c974ecc542d2e178d1d4ecaa
7
- data.tar.gz: 0a26c01e5250c0d8be8d0cdb3a4d403a8a8250d1f8e966f5d1e9d3389e8af99d321c0586639066b5da38bc77781b8686b5a3a5da268238287e188a7c98246557
6
+ metadata.gz: 10590030edf6d9c413b32735bd792109fdb6d4cc4bf7787d0001d33e9714aa76fab9f1aef237fa3af2b351a1f96fe3c4b664568b76b658f22bf9ce8584e2adb4
7
+ data.tar.gz: 871bea6e2696241047add7160998cf8cc47dbf52a20cc909adc3ba50e6bdd21d6fe847e3f11031c32b7a1db9483a0441be6a5a867d363ec1e7c440c87df05982
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ # TODO: Uncomment when Windows OS is supported by Travis CI.
2
+ # We can only run the integration tests on Windows.
3
+
4
+ # language: ruby
5
+ #rvm:
6
+ # - jruby-head
7
+ #
8
+ #os:
9
+ # - windows
data/NOTICE.TXT ADDED
@@ -0,0 +1,5 @@
1
+ Elasticsearch
2
+ Copyright 2012-2015 Elasticsearch
3
+
4
+ This product includes software developed by The Apache Software
5
+ Foundation (http://www.apache.org/).
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Perfmon 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
 
@@ -15,7 +15,7 @@ git clone https://github.com/NickMRamirez/logstash-input-perfmon.git
15
15
  cd logstash-input-perfmon
16
16
  jruby -S gem install bundler
17
17
  jruby -S bundle install
18
- jruby -S bundle exec rspec spec
18
+ jruby -S bundle exec rake
19
19
  ```
20
20
 
21
21
  To build the gem:
data/Rakefile CHANGED
@@ -1 +1,8 @@
1
- require "logstash/devutils/rake"
1
+ require 'logstash/devutils/rake'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec) do |t|
5
+ t.rspec_opts = '--format documentation'
6
+ end
7
+
8
+ task :default => :spec
@@ -84,11 +84,19 @@ class LogStash::Inputs::Perfmon < LogStash::Inputs::Base
84
84
  end
85
85
  end
86
86
 
87
- # Cleans up any resources
87
+ # Cleans up any resources, called when Ctrl+C used
88
88
  def teardown
89
+ @logger.debug("Calling teardown on logstash-input-perfmon")
89
90
  @typeperf.stop_monitor
90
91
  @logger.debug("Stopped the perfmon monitor")
91
92
  finished
92
93
  end
94
+
95
+ # Manual way to stop the plugin
96
+ def stop
97
+ @logger.debug("Calling stop on logstash-input-perfmon")
98
+ @typeperf.stop_monitor
99
+ @logger.debug("Stopped the perfmon monitor")
100
+ end
93
101
 
94
102
  end
@@ -1,3 +1,5 @@
1
+ require 'open3'
2
+
1
3
  class PerfmonProcGetter
2
4
  attr_reader :pid
3
5
 
@@ -12,17 +14,19 @@ class PerfmonProcGetter
12
14
  # [output_queue] The queue to add each new message to
13
15
  def start_process(counters, interval, output_queue)
14
16
  cmd = get_typeperf_command(counters, interval)
15
-
16
- IO.popen(cmd) do |f|
17
- @pid = f.pid
18
-
19
- f.each do |line|
20
- next if counters.any? { |counter| line.include? counter } # don't show lines that contain headers
21
- line.gsub!('"', '') # remove quotes
22
- line.strip!
23
- output_queue << line
17
+
18
+ Open3.popen3(cmd) do |w, r, e, thr|
19
+ while line = r.gets
20
+ if @pid.nil?
21
+ @pid = thr.pid
22
+ end
23
+
24
+ next if counters.any? { |counter| line.include? counter } # don't show lines that contain headers
25
+ line.gsub!('"', '') # remove quotes
26
+ line.strip!
27
+ output_queue << line
24
28
  end
25
- end
29
+ end
26
30
  end
27
31
 
28
32
  # Kills the typeperf process
@@ -1,4 +1,3 @@
1
- require 'win32/process'
2
1
  require_relative 'perfmon_proc_getter'
3
2
 
4
3
  # Wraps the typeperf command-line tool, used to get
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-perfmon'
3
- s.version = '0.1.3'
3
+ s.version = '0.1.4'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "Logstash input for Windows Performance Monitor"
6
6
  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. Logstash input for Windows Performance Monitor metrics."
@@ -21,7 +21,6 @@ Gem::Specification.new do |s|
21
21
  # Gem dependencies
22
22
  s.add_runtime_dependency "logstash-core", '>= 1.4.0', '< 2.0.0'
23
23
  s.add_runtime_dependency 'logstash-codec-plain'
24
- s.add_runtime_dependency 'win32-process'
25
24
 
26
25
  s.add_development_dependency 'logstash-devutils'
27
26
  end
@@ -64,7 +64,7 @@ describe 'IntegrationTests' do
64
64
 
65
65
  expect(my_queue).not_to be_empty
66
66
 
67
- plugin.teardown
67
+ plugin.stop
68
68
  end
69
69
  end
70
70
 
metadata CHANGED
@@ -1,17 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-perfmon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Ramirez
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-10 00:00:00.000000000 Z
11
+ date: 2015-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: logstash-core
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - ">="
@@ -20,8 +19,9 @@ dependencies:
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
21
  version: 2.0.0
23
- type: :runtime
22
+ name: logstash-core
24
23
  prerelease: false
24
+ type: :runtime
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
@@ -31,61 +31,47 @@ dependencies:
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.0.0
33
33
  - !ruby/object:Gem::Dependency
34
- name: logstash-codec-plain
35
34
  requirement: !ruby/object:Gem::Requirement
36
35
  requirements:
37
36
  - - ">="
38
37
  - !ruby/object:Gem::Version
39
38
  version: '0'
40
- type: :runtime
39
+ name: logstash-codec-plain
41
40
  prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: '0'
47
- - !ruby/object:Gem::Dependency
48
- name: win32-process
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: '0'
54
41
  type: :runtime
55
- prerelease: false
56
42
  version_requirements: !ruby/object:Gem::Requirement
57
43
  requirements:
58
44
  - - ">="
59
45
  - !ruby/object:Gem::Version
60
46
  version: '0'
61
47
  - !ruby/object:Gem::Dependency
62
- name: logstash-devutils
63
48
  requirement: !ruby/object:Gem::Requirement
64
49
  requirements:
65
50
  - - ">="
66
51
  - !ruby/object:Gem::Version
67
52
  version: '0'
68
- type: :development
53
+ name: logstash-devutils
69
54
  prerelease: false
55
+ type: :development
70
56
  version_requirements: !ruby/object:Gem::Requirement
71
57
  requirements:
72
58
  - - ">="
73
59
  - !ruby/object:Gem::Version
74
60
  version: '0'
75
- description: This gem is a logstash plugin required to be installed on top of the
76
- Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not
77
- a stand-alone program. Logstash input for Windows Performance Monitor metrics.
61
+ 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. Logstash input for Windows Performance Monitor metrics.
78
62
  email: nickram44@hotmail.com
79
63
  executables: []
80
64
  extensions: []
81
65
  extra_rdoc_files: []
82
66
  files:
83
67
  - ".gitignore"
68
+ - ".travis.yml"
84
69
  - CHANGELOG.md
85
70
  - CONTRIBUTORS
86
71
  - DEVELOPER.md
87
72
  - Gemfile
88
73
  - LICENSE
74
+ - NOTICE.TXT
89
75
  - README.md
90
76
  - Rakefile
91
77
  - lib/logstash/inputs/perfmon.rb
@@ -101,7 +87,7 @@ licenses:
101
87
  metadata:
102
88
  logstash_plugin: 'true'
103
89
  logstash_group: input
104
- post_install_message:
90
+ post_install_message:
105
91
  rdoc_options: []
106
92
  require_paths:
107
93
  - lib
@@ -116,9 +102,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  requirements: []
119
- rubyforge_project:
120
- rubygems_version: 2.4.5
121
- signing_key:
105
+ rubyforge_project:
106
+ rubygems_version: 2.4.8
107
+ signing_key:
122
108
  specification_version: 4
123
109
  summary: Logstash input for Windows Performance Monitor
124
110
  test_files: