nosey 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'bundler/setup'
5
+ require 'nosey'
6
+
7
+ Nosey::Munin.graph do
8
+ socket '/tmp/nosey_test.socket'
9
+ category 'App'
10
+ title 'My Cool Chart'
11
+ vertical_label 'Response Time (seconds)'
12
+ end
@@ -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=$stdio,&block)
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 'configure'
18
+ when Argument::Configuration
12
19
  graph.configure
13
20
  else
14
21
  graph.sample
data/lib/nosey/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nosey
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -69,7 +69,7 @@ describe Nosey::Munin::Graph do
69
69
  end
70
70
 
71
71
  it "should configure" do
72
- graph(@report, 'configure').should match(/graph_title Fruit Fly Charts/)
72
+ graph(@report, 'config').should match(/graph_title Fruit Fly Charts/)
73
73
  end
74
74
 
75
75
  it "should sample" do
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
- prerelease: false
5
- segments:
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
- date: 2011-09-15 00:00:00 -07:00
18
- default_executable:
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
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
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
- requirement: &id002 !ruby/object:Gem::Requirement
36
- requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- segments:
40
- - 0
41
- version: "0"
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
- requirement: &id003 !ruby/object:Gem::Requirement
48
- requirements:
49
- - - ">="
50
- - !ruby/object:Gem::Version
51
- segments:
52
- - 0
53
- version: "0"
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
- requirement: &id004 !ruby/object:Gem::Requirement
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- segments:
64
- - 0
65
- version: "0"
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
- requirement: &id005 !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- segments:
76
- - 0
77
- version: "0"
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
- requirement: &id006 !ruby/object:Gem::Requirement
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- segments:
88
- - 0
89
- version: "0"
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
- requirement: &id007 !ruby/object:Gem::Requirement
96
- requirements:
97
- - - ">="
98
- - !ruby/object:Gem::Version
99
- segments:
100
- - 0
101
- version: "0"
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
- requirement: &id008 !ruby/object:Gem::Requirement
108
- requirements:
109
- - - ">="
110
- - !ruby/object:Gem::Version
111
- segments:
112
- - 0
113
- version: "0"
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
- version_requirements: *id008
116
- description: Nosey is a way to instrument your Evented Ruby applications to track counts, aggregates, etc. It was built a Poll Everywhere because we need a way to peer into our Evented apps and grab some basic statistics so that we could graph on Munin. Since we needed this instrumentation available in several EM projects, we gathered the basics up into this gem.
117
- email:
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
- requirements:
156
- - - ">="
157
- - !ruby/object:Gem::Version
158
- segments:
159
- - 0
160
- version: "0"
161
- required_rubygems_version: !ruby/object:Gem::Requirement
162
- requirements:
163
- - - ">="
164
- - !ruby/object:Gem::Version
165
- segments:
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.3.6
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