logstash-input-perfmon 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +9 -0
- data/NOTICE.TXT +5 -0
- data/README.md +2 -2
- data/Rakefile +8 -1
- data/lib/logstash/inputs/perfmon.rb +9 -1
- data/lib/logstash/inputs/perfmon_proc_getter.rb +14 -10
- data/lib/logstash/inputs/typeperf_wrapper.rb +0 -1
- data/logstash-input-perfmon.gemspec +1 -2
- data/spec/inputs/perfmon_spec.rb +1 -1
- metadata +15 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da5408d570f346b92be0025f5dd90e4b3f8c507f
|
4
|
+
data.tar.gz: b1fbda74d2668639848521a8d566e4167d64c6d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10590030edf6d9c413b32735bd792109fdb6d4cc4bf7787d0001d33e9714aa76fab9f1aef237fa3af2b351a1f96fe3c4b664568b76b658f22bf9ce8584e2adb4
|
7
|
+
data.tar.gz: 871bea6e2696241047add7160998cf8cc47dbf52a20cc909adc3ba50e6bdd21d6fe847e3f11031c32b7a1db9483a0441be6a5a867d363ec1e7c440c87df05982
|
data/.travis.yml
ADDED
data/NOTICE.TXT
ADDED
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/
|
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
|
18
|
+
jruby -S bundle exec rake
|
19
19
|
```
|
20
20
|
|
21
21
|
To build the gem:
|
data/Rakefile
CHANGED
@@ -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
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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
|
-
|
29
|
+
end
|
26
30
|
end
|
27
31
|
|
28
32
|
# Kills the typeperf process
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-input-perfmon'
|
3
|
-
s.version = '0.1.
|
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
|
data/spec/inputs/perfmon_spec.rb
CHANGED
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.
|
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-
|
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
|
-
|
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
|
-
|
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
|
-
|
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.
|
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:
|