nightfury 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/nightfury/identity.rb +2 -1
- data/lib/nightfury/version.rb +1 -1
- data/spec/nightfury/identity_spec.rb +2 -1
- metadata +2 -2
data/lib/nightfury/identity.rb
CHANGED
@@ -22,9 +22,10 @@ module Nightfury
|
|
22
22
|
@metrics ||= {}
|
23
23
|
@metrics[name] = {type: type}
|
24
24
|
store_as = options[:store_as] ? ":#{options[:store_as]}" : 'nil'
|
25
|
+
step = options[:step] ? ":#{options[:step]}" : ":minute"
|
25
26
|
class_eval <<-ENDOFMETHOD
|
26
27
|
def #{name}
|
27
|
-
@_#{name} ||= METRIC_MAPPINGS[:#{type}].new(:#{name}, redis_key_prefix: key_prefix, store_as: #{store_as})
|
28
|
+
@_#{name} ||= METRIC_MAPPINGS[:#{type}].new(:#{name}, redis_key_prefix: key_prefix, store_as: #{store_as}, step: #{step})
|
28
29
|
end
|
29
30
|
ENDOFMETHOD
|
30
31
|
end
|
data/lib/nightfury/version.rb
CHANGED
@@ -78,13 +78,14 @@ describe Nightfury::Identity::Base do
|
|
78
78
|
|
79
79
|
describe "Dynamically generated metric" do
|
80
80
|
it "should instantiate the right metric class" do
|
81
|
-
Dummy.metric(:third_count, :value, store_as: :t)
|
81
|
+
Dummy.metric(:third_count, :value, store_as: :t, step: :day)
|
82
82
|
d = Dummy.new(1)
|
83
83
|
metric_object = d.third_count
|
84
84
|
metric_object.should be_kind_of(Nightfury::Metric::Value)
|
85
85
|
metric_object.name.should == :third_count
|
86
86
|
metric_object.redis_key_prefix.should == 'dummy.1'
|
87
87
|
metric_object.store_as.should == :t
|
88
|
+
metric_object.step.should == :day
|
88
89
|
end
|
89
90
|
end
|
90
91
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nightfury
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-03-08 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: Nightfury is a reporting/analytics backend written on Redis
|
16
16
|
email:
|