babysitter 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/babysitter/tracker.rb +2 -2
- data/lib/babysitter/version.rb +1 -1
- data/spec/lib/babysitter/tracker_spec.rb +8 -0
- metadata +2 -2
data/lib/babysitter/tracker.rb
CHANGED
@@ -6,12 +6,12 @@ module Babysitter
|
|
6
6
|
attr_accessor :log_every
|
7
7
|
|
8
8
|
def initialize(log_every, stat_name=nil)
|
9
|
-
@stat_name = stat_name
|
9
|
+
@stat_name = stat_name.is_a?(String) ? stat_name.split('.') : stat_name
|
10
10
|
@counting = default_counting
|
11
11
|
@log_every = log_every
|
12
12
|
@timer_start = Time.now
|
13
13
|
@counters = Hash.new do |h, k|
|
14
|
-
h[k] = Counter.new(log_every, stat_name: stat_name, counting: k, timer_start: timer_start)
|
14
|
+
h[k] = Counter.new(log_every, stat_name: @stat_name, counting: k, timer_start: timer_start)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
data/lib/babysitter/version.rb
CHANGED
@@ -11,6 +11,14 @@ module Babysitter
|
|
11
11
|
Babysitter.stub(:logger).and_return(logger)
|
12
12
|
end
|
13
13
|
|
14
|
+
describe '.new' do
|
15
|
+
let(:stat_bucket_prefix) { 'my.stat.bucket.prefix' }
|
16
|
+
|
17
|
+
it 'converts string stat_name to array' do
|
18
|
+
subject.stat_name.should == %w(my stat bucket prefix)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
14
22
|
describe '#logger_with_stats_for' do
|
15
23
|
|
16
24
|
it 'returns the same logger when passed the same symbol twice' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: babysitter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-03-
|
15
|
+
date: 2013-03-06 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: fozzie
|