ganymed 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ganymed/collectors/cpu.rb +1 -1
- data/lib/ganymed/collectors/iostat.rb +1 -1
- data/lib/ganymed/collectors/load.rb +1 -1
- data/lib/ganymed/collectors/memory.rb +1 -1
- data/lib/ganymed/collectors/network.rb +1 -1
- data/lib/ganymed/collectors/process.rb +1 -1
- data/lib/ganymed/collectors/uptime.rb +1 -1
- data/lib/ganymed/event.rb +1 -0
- data/lib/ganymed/processor.rb +5 -1
- data/lib/ganymed/version.rb +1 -1
- data/lib/ganymed/websocket/filter.rb +2 -2
- data/lib/ganymed/websocket/subscribe.rb +8 -8
- metadata +32 -33
- data/lib/ganymed/collectors/metadata.rb +0 -22
@@ -5,7 +5,7 @@ Struct.new("IOStat",
|
|
5
5
|
:running, :use, :aveq)
|
6
6
|
|
7
7
|
collect(0.3) do
|
8
|
-
|
8
|
+
next if not File.readable?('/proc/diskstats')
|
9
9
|
File.open('/proc/diskstats').each do |line|
|
10
10
|
ios = Struct::IOStat.new(*line.strip.split(/\s+/))
|
11
11
|
next if config.skip_numbered.tap{} and ios.dev =~ /\d+$/
|
@@ -4,7 +4,7 @@ Struct.new("NetworkStat", :dev,
|
|
4
4
|
:wbytes, :wpackets, :werrs, :wdrop, :wfifo, :wcolls, :wcarrier, :wcompressed)
|
5
5
|
|
6
6
|
collect(0.3) do
|
7
|
-
|
7
|
+
break if not File.readable?('/proc/net/dev')
|
8
8
|
|
9
9
|
File.open('/proc/net/dev') do |f|
|
10
10
|
f.each do |line|
|
data/lib/ganymed/event.rb
CHANGED
data/lib/ganymed/processor.rb
CHANGED
@@ -75,7 +75,11 @@ module Ganymed
|
|
75
75
|
connection.publish(event)
|
76
76
|
end
|
77
77
|
|
78
|
-
#
|
78
|
+
# normalize timestamp for events with a resolution
|
79
|
+
if event.resolution > 1
|
80
|
+
event.timestamp -= event.timestamp % event.resolution
|
81
|
+
|
82
|
+
# skip events that are produced below the resolution threshold
|
79
83
|
return if (1...@config.resolution).include?(event.resolution)
|
80
84
|
|
81
85
|
# insert event into ns collection
|
data/lib/ganymed/version.rb
CHANGED
@@ -15,23 +15,23 @@ module Ganymed
|
|
15
15
|
|
16
16
|
def subscribe(data)
|
17
17
|
return if not authenticated?
|
18
|
-
data.each do |
|
19
|
-
log.debug("client #{peer} subscribed to #{
|
20
|
-
filters[
|
18
|
+
data.each do |ns, filter|
|
19
|
+
log.debug("client #{peer} subscribed to #{ns} with filter=#{filter.inspect}")
|
20
|
+
filters[ns] = Filter.new(filter)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
24
|
def unsubscribe(data)
|
25
25
|
return if not authenticated?
|
26
|
-
data.each do |
|
27
|
-
log.debug("client #{peer} unsubscribed
|
28
|
-
filters.delete(
|
26
|
+
data.each do |ns, filter|
|
27
|
+
log.debug("client #{peer} unsubscribed namespace #{ns}")
|
28
|
+
filters.delete(ns)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
32
|
def subscribed?(event)
|
33
|
-
filters.map do |
|
34
|
-
filter if
|
33
|
+
filters.map do |ns, filter|
|
34
|
+
filter if ns == "all" or event.ns == ns
|
35
35
|
end.compact.map do |filter|
|
36
36
|
filter.match?(event)
|
37
37
|
end.any?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ganymed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
|
-
requirement: &
|
16
|
+
requirement: &11336480 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.2'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *11336480
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: eventmachine
|
27
|
-
requirement: &
|
27
|
+
requirement: &11333940 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.12.10
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *11333940
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: ganymed-client
|
38
|
-
requirement: &
|
38
|
+
requirement: &11331240 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *11331240
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: madvertise-ext
|
49
|
-
requirement: &
|
49
|
+
requirement: &11329740 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 0.1.2
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *11329740
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: madvertise-logging
|
60
|
-
requirement: &
|
60
|
+
requirement: &11357980 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 0.3.2
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *11357980
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: mixlib-cli
|
71
|
-
requirement: &
|
71
|
+
requirement: &11356980 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *11356980
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: RubyInline
|
82
|
-
requirement: &
|
82
|
+
requirement: &11354780 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *11354780
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: servolux
|
93
|
-
requirement: &
|
93
|
+
requirement: &11352760 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :runtime
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *11352760
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: msgpack
|
104
|
-
requirement: &
|
104
|
+
requirement: &11351720 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: '0'
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *11351720
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: mongo
|
115
|
-
requirement: &
|
115
|
+
requirement: &11372540 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: '1.6'
|
121
121
|
type: :runtime
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *11372540
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: em-websocket
|
126
|
-
requirement: &
|
126
|
+
requirement: &11368680 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ! '>='
|
@@ -131,10 +131,10 @@ dependencies:
|
|
131
131
|
version: '0'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *11368680
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
136
|
name: yajl-ruby
|
137
|
-
requirement: &
|
137
|
+
requirement: &11367160 !ruby/object:Gem::Requirement
|
138
138
|
none: false
|
139
139
|
requirements:
|
140
140
|
- - ! '>='
|
@@ -142,10 +142,10 @@ dependencies:
|
|
142
142
|
version: '0'
|
143
143
|
type: :runtime
|
144
144
|
prerelease: false
|
145
|
-
version_requirements: *
|
145
|
+
version_requirements: *11367160
|
146
146
|
- !ruby/object:Gem::Dependency
|
147
147
|
name: sys-filesystem
|
148
|
-
requirement: &
|
148
|
+
requirement: &11365860 !ruby/object:Gem::Requirement
|
149
149
|
none: false
|
150
150
|
requirements:
|
151
151
|
- - ! '>='
|
@@ -153,10 +153,10 @@ dependencies:
|
|
153
153
|
version: '0'
|
154
154
|
type: :runtime
|
155
155
|
prerelease: false
|
156
|
-
version_requirements: *
|
156
|
+
version_requirements: *11365860
|
157
157
|
- !ruby/object:Gem::Dependency
|
158
158
|
name: ohai
|
159
|
-
requirement: &
|
159
|
+
requirement: &11387480 !ruby/object:Gem::Requirement
|
160
160
|
none: false
|
161
161
|
requirements:
|
162
162
|
- - ! '>='
|
@@ -164,7 +164,7 @@ dependencies:
|
|
164
164
|
version: 0.6.12
|
165
165
|
type: :runtime
|
166
166
|
prerelease: false
|
167
|
-
version_requirements: *
|
167
|
+
version_requirements: *11387480
|
168
168
|
description: Ganymed is an event collection daemon
|
169
169
|
email:
|
170
170
|
- bb@xnull.de
|
@@ -192,7 +192,6 @@ files:
|
|
192
192
|
- lib/ganymed/collectors/iostat.rb
|
193
193
|
- lib/ganymed/collectors/load.rb
|
194
194
|
- lib/ganymed/collectors/memory.rb
|
195
|
-
- lib/ganymed/collectors/metadata.rb
|
196
195
|
- lib/ganymed/collectors/network.rb
|
197
196
|
- lib/ganymed/collectors/process.rb
|
198
197
|
- lib/ganymed/collectors/uptime.rb
|
@@ -239,7 +238,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
239
238
|
version: '0'
|
240
239
|
segments:
|
241
240
|
- 0
|
242
|
-
hash:
|
241
|
+
hash: 2492483449465881370
|
243
242
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
244
243
|
none: false
|
245
244
|
requirements:
|
@@ -248,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
248
247
|
version: '0'
|
249
248
|
segments:
|
250
249
|
- 0
|
251
|
-
hash:
|
250
|
+
hash: 2492483449465881370
|
252
251
|
requirements: []
|
253
252
|
rubyforge_project:
|
254
253
|
rubygems_version: 1.8.17
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'ohai'
|
2
|
-
|
3
|
-
collect do
|
4
|
-
Ohai::System.new.tap do |ohai|
|
5
|
-
%w(
|
6
|
-
os
|
7
|
-
kernel
|
8
|
-
hostname
|
9
|
-
keys
|
10
|
-
network
|
11
|
-
platform
|
12
|
-
uptime
|
13
|
-
virtualization
|
14
|
-
).each do |plugin|
|
15
|
-
ohai.require_plugin(plugin)
|
16
|
-
end
|
17
|
-
processor.metadata(ohai.data)
|
18
|
-
|
19
|
-
# ohai doesn't cleanup after itself
|
20
|
-
true while Process.wait(-1, Process::WNOHANG) rescue nil
|
21
|
-
end
|
22
|
-
end
|