instrumental 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +2 -2
- data/VERSION +1 -1
- data/instrumental.gemspec +7 -9
- data/lib/instrumental.rb +1 -2
- data/spec/instrumental/instrument_methods_spec.rb +5 -5
- metadata +8 -12
- data/TODO +0 -3
- data/lib/instrumental/instrument.rb +0 -19
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.gem
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
data/instrumental.gemspec
CHANGED
@@ -5,31 +5,29 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{instrumental}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Douglas F Shearer"]
|
12
|
-
s.date = %q{2011-06-
|
12
|
+
s.date = %q{2011-06-09}
|
13
13
|
s.description = %q{Rails instrumentation and client for imperialapp.com}
|
14
14
|
s.email = %q{support@imperialapp.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
|
-
"README"
|
17
|
-
"TODO"
|
16
|
+
"README"
|
18
17
|
]
|
19
18
|
s.files = [
|
19
|
+
".gitignore",
|
20
20
|
"Gemfile",
|
21
21
|
"Gemfile.lock",
|
22
22
|
"MIT-LICENCE",
|
23
23
|
"README",
|
24
24
|
"Rakefile",
|
25
|
-
"TODO",
|
26
25
|
"VERSION",
|
27
26
|
"init.rb",
|
28
27
|
"instrumental.gemspec",
|
29
28
|
"lib/instrumental.rb",
|
30
29
|
"lib/instrumental/agent.rb",
|
31
30
|
"lib/instrumental/configuration.rb",
|
32
|
-
"lib/instrumental/instrument.rb",
|
33
31
|
"lib/instrumental/intervalometer.rb",
|
34
32
|
"lib/tasks/install.rake",
|
35
33
|
"lib/tasks/templates/instrumental.rb.erb",
|
@@ -49,16 +47,16 @@ Gem::Specification.new do |s|
|
|
49
47
|
s.specification_version = 3
|
50
48
|
|
51
49
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
52
|
-
s.add_runtime_dependency(%q<rake>, ["
|
50
|
+
s.add_runtime_dependency(%q<rake>, [">= 0"])
|
53
51
|
s.add_runtime_dependency(%q<rspec>, [">= 0"])
|
54
52
|
s.add_runtime_dependency(%q<jeweler>, [">= 0"])
|
55
53
|
else
|
56
|
-
s.add_dependency(%q<rake>, ["
|
54
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
57
55
|
s.add_dependency(%q<rspec>, [">= 0"])
|
58
56
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
59
57
|
end
|
60
58
|
else
|
61
|
-
s.add_dependency(%q<rake>, ["
|
59
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
62
60
|
s.add_dependency(%q<rspec>, [">= 0"])
|
63
61
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
64
62
|
end
|
data/lib/instrumental.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'instrumental/agent'
|
2
2
|
require 'instrumental/configuration'
|
3
3
|
require 'instrumental/intervalometer'
|
4
|
-
require 'instrumental/instrument'
|
5
4
|
|
6
5
|
module Instrumental
|
7
6
|
|
@@ -47,7 +46,7 @@ module Instrumental
|
|
47
46
|
def self.timer(name)
|
48
47
|
start_time = Time.now
|
49
48
|
yield
|
50
|
-
self.measure(name, Time.now - start_time)
|
49
|
+
self.measure(name, (Time.now - start_time) * 1000) # milliseconds
|
51
50
|
end
|
52
51
|
|
53
52
|
end
|
@@ -14,7 +14,7 @@ describe 'public instrument methods' do
|
|
14
14
|
it "should send a value of 1" do
|
15
15
|
@mock_agent_instance.should_receive(:report).with(:count, 'my name', 1)
|
16
16
|
|
17
|
-
|
17
|
+
Instrumental.count('my name')
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -22,7 +22,7 @@ describe 'public instrument methods' do
|
|
22
22
|
it "should send the passed value" do
|
23
23
|
@mock_agent_instance.should_receive(:report).with(:count, 'my name', 23)
|
24
24
|
|
25
|
-
|
25
|
+
Instrumental.count('my name', 23)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -31,7 +31,7 @@ describe 'public instrument methods' do
|
|
31
31
|
it "should send the passed value" do
|
32
32
|
@mock_agent_instance.should_receive(:report).with(:measure, 'my name', 19.2)
|
33
33
|
|
34
|
-
|
34
|
+
Instrumental.measure('my name', 19.2)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -41,9 +41,9 @@ describe 'public instrument methods' do
|
|
41
41
|
Time.should_receive(:now).and_return(0)
|
42
42
|
Time.should_receive(:now).and_return(delta)
|
43
43
|
|
44
|
-
@mock_agent_instance.should_receive(:report).with(:measure, 'my name', delta)
|
44
|
+
@mock_agent_instance.should_receive(:report).with(:measure, 'my name', delta*1000)
|
45
45
|
|
46
|
-
|
46
|
+
Instrumental.timer('my name') { 'do stuff' }
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: instrumental
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 5
|
10
|
+
version: 0.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Douglas F Shearer
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-06-
|
18
|
+
date: 2011-06-09 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -24,14 +24,12 @@ dependencies:
|
|
24
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- - "
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 3
|
30
30
|
segments:
|
31
31
|
- 0
|
32
|
-
|
33
|
-
- 7
|
34
|
-
version: 0.8.7
|
32
|
+
version: "0"
|
35
33
|
type: :runtime
|
36
34
|
version_requirements: *id001
|
37
35
|
- !ruby/object:Gem::Dependency
|
@@ -70,21 +68,19 @@ extensions: []
|
|
70
68
|
|
71
69
|
extra_rdoc_files:
|
72
70
|
- README
|
73
|
-
- TODO
|
74
71
|
files:
|
72
|
+
- .gitignore
|
75
73
|
- Gemfile
|
76
74
|
- Gemfile.lock
|
77
75
|
- MIT-LICENCE
|
78
76
|
- README
|
79
77
|
- Rakefile
|
80
|
-
- TODO
|
81
78
|
- VERSION
|
82
79
|
- init.rb
|
83
80
|
- instrumental.gemspec
|
84
81
|
- lib/instrumental.rb
|
85
82
|
- lib/instrumental/agent.rb
|
86
83
|
- lib/instrumental/configuration.rb
|
87
|
-
- lib/instrumental/instrument.rb
|
88
84
|
- lib/instrumental/intervalometer.rb
|
89
85
|
- lib/tasks/install.rake
|
90
86
|
- lib/tasks/templates/instrumental.rb.erb
|
data/TODO
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
module Instrumental
|
2
|
-
module Instrument
|
3
|
-
|
4
|
-
def self.count(name, value=1)
|
5
|
-
Agent.instance.report(:count, name, value)
|
6
|
-
end
|
7
|
-
|
8
|
-
def self.measure(name, value)
|
9
|
-
Agent.instance.report(:measure, name, value)
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.timer(name)
|
13
|
-
start_time = Time.now
|
14
|
-
yield
|
15
|
-
self.measure(name, Time.now - start_time)
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
19
|
-
end
|