nosey 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,4 +13,5 @@ Nosey::Munin.graph do
13
13
  # Only show these 3 dudes
14
14
  %w[min max avg].include? name
15
15
  end
16
+ labels ({"min" => "Minimum", "max" => "Maximus", "avg" => "Average Joe"})
16
17
  end
@@ -11,20 +11,20 @@ module Nosey
11
11
 
12
12
  # Print the output of the munin graph to $stdout
13
13
  def self.graph(args=ARGV,out=$stdout,&block)
14
- graph = Graph::DSL.new(&block).graph
14
+ dsl = Graph::DSL.new(&block)
15
15
 
16
- # Munin passes configure into this to figure out the graph.
16
+ # Munin passes configure into this to figure out the graph.
17
17
  out.puts case args.first
18
18
  when Argument::Configuration
19
- graph.configure
19
+ dsl.graph(true).configure
20
20
  else
21
- graph.sample
21
+ dsl.graph.sample
22
22
  end
23
23
  end
24
24
 
25
25
  # Parse a Nosey socket for Munin
26
26
  class Graph
27
- attr_accessor :data, :title, :vertical_label, :category, :filter
27
+ attr_accessor :data, :title, :vertical_label, :category, :filter, :labels
28
28
  attr_writer :probe_set
29
29
 
30
30
  def initialize(data=nil)
@@ -45,9 +45,11 @@ module Nosey
45
45
  body.puts "graph_title #{title}"
46
46
  body.puts "graph_category #{category}"
47
47
  body.puts "graph_vlabel #{vertical_label}"
48
- munin_hash.each do |field, (label, value)|
48
+
49
+ (@labels || {}).each do |field, label|
49
50
  body.puts "#{field}.label #{label}"
50
51
  end
52
+
51
53
  body.rewind
52
54
  body.read
53
55
  end
@@ -153,6 +155,11 @@ module Nosey
153
155
  self
154
156
  end
155
157
 
158
+ def labels(labels)
159
+ @labels = labels
160
+ self
161
+ end
162
+
156
163
  def data(data)
157
164
  @data = data
158
165
  self
@@ -170,13 +177,14 @@ module Nosey
170
177
  end
171
178
 
172
179
  # Configure an instance of a client.
173
- def graph
174
- Graph.new read_data do |c|
180
+ def graph(configure=false)
181
+ Graph.new (configure ? nil : read_data) do |c|
175
182
  c.probe_set = @probe_set
176
183
  c.category = @category
177
184
  c.title = @title
178
185
  c.vertical_label = @vertical_label
179
186
  c.filter = @filter
187
+ c.labels = @labels
180
188
  end
181
189
  end
182
190
 
@@ -1,3 +1,3 @@
1
1
  module Nosey
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
@@ -18,6 +18,7 @@ describe Nosey::Munin::Graph do
18
18
  @graph = Nosey::Munin::Graph.new(@report.to_s) do |g|
19
19
  g.title = "Test Graph"
20
20
  g.vertical_label = "Response times"
21
+ g.labels = {"min" => "Min", "max" => "Max", "avg" => "Avg"}
21
22
  end
22
23
  end
23
24
 
@@ -39,7 +40,7 @@ describe Nosey::Munin::Graph do
39
40
  end
40
41
 
41
42
  it "should have labels" do
42
- @text.scan(/[A-Za-z0-9_]+\.label .+\n/).should have(6).items
43
+ @text.scan(/[A-Za-z0-9_]+\.label .+\n/).should have(3).items
43
44
  end
44
45
  end
45
46
 
@@ -69,6 +70,7 @@ describe Nosey::Munin::Graph do
69
70
  g.category 'Bananas'
70
71
  g.title 'Fruit Fly Charts'
71
72
  g.vertical_label 'Wing speed (beats per second'
73
+ g.labels ({"min" => "min"})
72
74
  end
73
75
 
74
76
  out.rewind
metadata CHANGED
@@ -1,146 +1,117 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: nosey
3
- version: !ruby/object:Gem::Version
4
- hash: 3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.15
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 14
10
- version: 0.0.14
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Brad Gessler
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-10-31 00:00:00 -07:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2011-11-01 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: eventmachine
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70151060522320 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
33
22
  type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: rspec
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70151060522320
25
+ - !ruby/object:Gem::Dependency
26
+ name: rspec
27
+ requirement: &70151060521140 !ruby/object:Gem::Requirement
39
28
  none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 0
46
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
47
33
  type: :development
48
- version_requirements: *id002
49
- - !ruby/object:Gem::Dependency
50
- name: guard-rspec
51
34
  prerelease: false
52
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70151060521140
36
+ - !ruby/object:Gem::Dependency
37
+ name: guard-rspec
38
+ requirement: &70151060519800 !ruby/object:Gem::Requirement
53
39
  none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- hash: 3
58
- segments:
59
- - 0
60
- version: "0"
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
61
44
  type: :development
62
- version_requirements: *id003
63
- - !ruby/object:Gem::Dependency
64
- name: guard-bundler
65
45
  prerelease: false
66
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *70151060519800
47
+ - !ruby/object:Gem::Dependency
48
+ name: guard-bundler
49
+ requirement: &70151060519100 !ruby/object:Gem::Requirement
67
50
  none: false
68
- requirements:
69
- - - ">="
70
- - !ruby/object:Gem::Version
71
- hash: 3
72
- segments:
73
- - 0
74
- version: "0"
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
75
55
  type: :development
76
- version_requirements: *id004
77
- - !ruby/object:Gem::Dependency
78
- name: growl
79
56
  prerelease: false
80
- requirement: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *70151060519100
58
+ - !ruby/object:Gem::Dependency
59
+ name: growl
60
+ requirement: &70151060518180 !ruby/object:Gem::Requirement
81
61
  none: false
82
- requirements:
83
- - - ">="
84
- - !ruby/object:Gem::Version
85
- hash: 3
86
- segments:
87
- - 0
88
- version: "0"
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
89
66
  type: :development
90
- version_requirements: *id005
91
- - !ruby/object:Gem::Dependency
92
- name: rb-fsevent
93
67
  prerelease: false
94
- requirement: &id006 !ruby/object:Gem::Requirement
68
+ version_requirements: *70151060518180
69
+ - !ruby/object:Gem::Dependency
70
+ name: rb-fsevent
71
+ requirement: &70151060517260 !ruby/object:Gem::Requirement
95
72
  none: false
96
- requirements:
97
- - - ">="
98
- - !ruby/object:Gem::Version
99
- hash: 3
100
- segments:
101
- - 0
102
- version: "0"
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
103
77
  type: :development
104
- version_requirements: *id006
105
- - !ruby/object:Gem::Dependency
106
- name: em-ventually
107
78
  prerelease: false
108
- requirement: &id007 !ruby/object:Gem::Requirement
79
+ version_requirements: *70151060517260
80
+ - !ruby/object:Gem::Dependency
81
+ name: em-ventually
82
+ requirement: &70151060516140 !ruby/object:Gem::Requirement
109
83
  none: false
110
- requirements:
111
- - - ">="
112
- - !ruby/object:Gem::Version
113
- hash: 3
114
- segments:
115
- - 0
116
- version: "0"
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
117
88
  type: :development
118
- version_requirements: *id007
119
- - !ruby/object:Gem::Dependency
120
- name: ruby-debug19
121
89
  prerelease: false
122
- requirement: &id008 !ruby/object:Gem::Requirement
90
+ version_requirements: *70151060516140
91
+ - !ruby/object:Gem::Dependency
92
+ name: ruby-debug19
93
+ requirement: &70151060515020 !ruby/object:Gem::Requirement
123
94
  none: false
124
- requirements:
125
- - - ">="
126
- - !ruby/object:Gem::Version
127
- hash: 3
128
- segments:
129
- - 0
130
- version: "0"
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
131
99
  type: :development
132
- version_requirements: *id008
133
- 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.
134
- email:
100
+ prerelease: false
101
+ version_requirements: *70151060515020
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:
135
108
  - brad@bradgessler.com
136
- executables:
109
+ executables:
137
110
  - nosey-test-client
138
111
  - nosey-test-server
139
112
  extensions: []
140
-
141
113
  extra_rdoc_files: []
142
-
143
- files:
114
+ files:
144
115
  - .gitignore
145
116
  - Gemfile
146
117
  - Guardfile
@@ -163,41 +134,31 @@ files:
163
134
  - spec/lib/nosey/report_spec.rb
164
135
  - spec/lib/nosey_spec.rb
165
136
  - spec/spec_helper.rb
166
- has_rdoc: true
167
137
  homepage: https://github.com/polleverywhere/nosey
168
138
  licenses: []
169
-
170
139
  post_install_message:
171
140
  rdoc_options: []
172
-
173
- require_paths:
141
+ require_paths:
174
142
  - lib
175
- required_ruby_version: !ruby/object:Gem::Requirement
143
+ required_ruby_version: !ruby/object:Gem::Requirement
176
144
  none: false
177
- requirements:
178
- - - ">="
179
- - !ruby/object:Gem::Version
180
- hash: 3
181
- segments:
182
- - 0
183
- version: "0"
184
- required_rubygems_version: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - ! '>='
147
+ - !ruby/object:Gem::Version
148
+ version: '0'
149
+ required_rubygems_version: !ruby/object:Gem::Requirement
185
150
  none: false
186
- requirements:
187
- - - ">="
188
- - !ruby/object:Gem::Version
189
- hash: 3
190
- segments:
191
- - 0
192
- version: "0"
151
+ requirements:
152
+ - - ! '>='
153
+ - !ruby/object:Gem::Version
154
+ version: '0'
193
155
  requirements: []
194
-
195
156
  rubyforge_project: nosey
196
- rubygems_version: 1.6.2
157
+ rubygems_version: 1.8.10
197
158
  signing_key:
198
159
  specification_version: 3
199
160
  summary: Instrument Ruby EventMachine applications
200
- test_files:
161
+ test_files:
201
162
  - spec/lib/eventmachine_spec.rb
202
163
  - spec/lib/nosey/instrumentation_spec.rb
203
164
  - spec/lib/nosey/munin_spec.rb