nosey 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/nosey-test-client +12 -0
- data/bin/nosey-test-server +23 -0
- data/lib/nosey/munin.rb +9 -2
- data/lib/nosey/version.rb +1 -1
- data/spec/lib/nosey/munin_spec.rb +1 -1
- metadata +106 -121
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'nosey'
|
6
|
+
require 'eventmachine'
|
7
|
+
|
8
|
+
trap('QUIT') { EM.stop }
|
9
|
+
|
10
|
+
EM.run {
|
11
|
+
probes = Nosey::Probe::Set.new('my_probe_set')
|
12
|
+
|
13
|
+
puts "Starting nosey test server"
|
14
|
+
EventMachine::Nosey::SocketServer.start(probes.report, '/tmp/nosey_test.socket')
|
15
|
+
|
16
|
+
EM::add_periodic_timer(1) do
|
17
|
+
probes.increment 'ticks'
|
18
|
+
probes.avg 'avg', rand
|
19
|
+
probes.min 'min', rand
|
20
|
+
probes.max 'max', rand
|
21
|
+
puts %w[tick tock][probes.probe('ticks').value % 2]
|
22
|
+
end
|
23
|
+
}
|
data/lib/nosey/munin.rb
CHANGED
@@ -1,14 +1,21 @@
|
|
1
1
|
require 'socket'
|
2
|
+
require 'yaml'
|
3
|
+
require 'stringio'
|
2
4
|
|
3
5
|
module Nosey
|
4
6
|
module Munin
|
7
|
+
# Various commands available to munin
|
8
|
+
module Argument
|
9
|
+
Configuration = 'config'
|
10
|
+
end
|
11
|
+
|
5
12
|
# Print the output of the munin graph to $stdout
|
6
|
-
def self.graph(args=ARGV,out=$
|
13
|
+
def self.graph(args=ARGV,out=$stdout,&block)
|
7
14
|
graph = Graph::DSL.new(&block).graph
|
8
15
|
|
9
16
|
# Munin passes configure into this to figure out the graph.
|
10
17
|
out.puts case args.first
|
11
|
-
when
|
18
|
+
when Argument::Configuration
|
12
19
|
graph.configure
|
13
20
|
else
|
14
21
|
graph.sample
|
data/lib/nosey/version.rb
CHANGED
metadata
CHANGED
@@ -1,133 +1,124 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: nosey
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 5
|
9
|
-
version: 0.0.5
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.6
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Brad Gessler
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-09-16 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: eventmachine
|
22
|
-
|
23
|
-
|
24
|
-
requirements:
|
25
|
-
- -
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
|
28
|
-
- 0
|
29
|
-
version: "0"
|
16
|
+
requirement: &70339837952660 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
30
22
|
type: :runtime
|
31
|
-
version_requirements: *id001
|
32
|
-
- !ruby/object:Gem::Dependency
|
33
|
-
name: rspec
|
34
23
|
prerelease: false
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
24
|
+
version_requirements: *70339837952660
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rspec
|
27
|
+
requirement: &70339837952240 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
42
33
|
type: :development
|
43
|
-
version_requirements: *id002
|
44
|
-
- !ruby/object:Gem::Dependency
|
45
|
-
name: guard-rspec
|
46
34
|
prerelease: false
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
35
|
+
version_requirements: *70339837952240
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: guard-rspec
|
38
|
+
requirement: &70339837951820 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
54
44
|
type: :development
|
55
|
-
version_requirements: *id003
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: guard-bundler
|
58
45
|
prerelease: false
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
46
|
+
version_requirements: *70339837951820
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: guard-bundler
|
49
|
+
requirement: &70339837951340 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
66
55
|
type: :development
|
67
|
-
version_requirements: *id004
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
name: growl
|
70
56
|
prerelease: false
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
57
|
+
version_requirements: *70339837951340
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: growl
|
60
|
+
requirement: &70339837950920 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
78
66
|
type: :development
|
79
|
-
version_requirements: *id005
|
80
|
-
- !ruby/object:Gem::Dependency
|
81
|
-
name: rb-fsevent
|
82
67
|
prerelease: false
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
68
|
+
version_requirements: *70339837950920
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rb-fsevent
|
71
|
+
requirement: &70339837950360 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
90
77
|
type: :development
|
91
|
-
version_requirements: *id006
|
92
|
-
- !ruby/object:Gem::Dependency
|
93
|
-
name: em-ventually
|
94
78
|
prerelease: false
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
79
|
+
version_requirements: *70339837950360
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: em-ventually
|
82
|
+
requirement: &70339837949880 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
102
88
|
type: :development
|
103
|
-
version_requirements: *id007
|
104
|
-
- !ruby/object:Gem::Dependency
|
105
|
-
name: ruby-debug19
|
106
89
|
prerelease: false
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
90
|
+
version_requirements: *70339837949880
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: ruby-debug19
|
93
|
+
requirement: &70339837949240 !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
114
99
|
type: :development
|
115
|
-
|
116
|
-
|
117
|
-
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: *70339837949240
|
102
|
+
description: Nosey is a way to instrument your Evented Ruby applications to track
|
103
|
+
counts, aggregates, etc. It was built a Poll Everywhere because we need a way to
|
104
|
+
peer into our Evented apps and grab some basic statistics so that we could graph
|
105
|
+
on Munin. Since we needed this instrumentation available in several EM projects,
|
106
|
+
we gathered the basics up into this gem.
|
107
|
+
email:
|
118
108
|
- brad@bradgessler.com
|
119
|
-
executables:
|
120
|
-
|
109
|
+
executables:
|
110
|
+
- nosey-test-client
|
111
|
+
- nosey-test-server
|
121
112
|
extensions: []
|
122
|
-
|
123
113
|
extra_rdoc_files: []
|
124
|
-
|
125
|
-
files:
|
114
|
+
files:
|
126
115
|
- .gitignore
|
127
116
|
- Gemfile
|
128
117
|
- Guardfile
|
129
118
|
- README.md
|
130
119
|
- Rakefile
|
120
|
+
- bin/nosey-test-client
|
121
|
+
- bin/nosey-test-server
|
131
122
|
- lib/nosey.rb
|
132
123
|
- lib/nosey/eventmachine.rb
|
133
124
|
- lib/nosey/instrumentation.rb
|
@@ -142,37 +133,31 @@ files:
|
|
142
133
|
- spec/lib/nosey/report_spec.rb
|
143
134
|
- spec/lib/nosey_spec.rb
|
144
135
|
- spec/spec_helper.rb
|
145
|
-
has_rdoc: true
|
146
136
|
homepage: https://github.com/polleverywhere/nosey
|
147
137
|
licenses: []
|
148
|
-
|
149
138
|
post_install_message:
|
150
139
|
rdoc_options: []
|
151
|
-
|
152
|
-
require_paths:
|
140
|
+
require_paths:
|
153
141
|
- lib
|
154
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
requirements:
|
163
|
-
- -
|
164
|
-
- !ruby/object:Gem::Version
|
165
|
-
|
166
|
-
- 0
|
167
|
-
version: "0"
|
142
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
143
|
+
none: false
|
144
|
+
requirements:
|
145
|
+
- - ! '>='
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
148
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
|
+
none: false
|
150
|
+
requirements:
|
151
|
+
- - ! '>='
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
168
154
|
requirements: []
|
169
|
-
|
170
155
|
rubyforge_project: nosey
|
171
|
-
rubygems_version: 1.
|
156
|
+
rubygems_version: 1.8.10
|
172
157
|
signing_key:
|
173
158
|
specification_version: 3
|
174
159
|
summary: Instrument Ruby EventMachine applications
|
175
|
-
test_files:
|
160
|
+
test_files:
|
176
161
|
- spec/lib/nosey/instrumentation_spec.rb
|
177
162
|
- spec/lib/nosey/munin_spec.rb
|
178
163
|
- spec/lib/nosey/probe_spec.rb
|