tabs 0.7.0 → 0.7.1
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/README.md +26 -4
- data/lib/tabs/version.rb +1 -1
- data/tabs.gemspec +2 -2
- metadata +9 -8
data/README.md
CHANGED
@@ -9,7 +9,7 @@ averages, and min/max, and task based stats sliceable by the minute, hour, day,
|
|
9
9
|
|
10
10
|
Add this line to your application's Gemfile:
|
11
11
|
|
12
|
-
gem 'tabs', '~> 0.
|
12
|
+
gem 'tabs', '~> 0.7.0'
|
13
13
|
|
14
14
|
And then execute:
|
15
15
|
|
@@ -48,6 +48,13 @@ To increment a metric counter, simply call:
|
|
48
48
|
Tabs.increment_counter("website-visits")
|
49
49
|
```
|
50
50
|
|
51
|
+
If you need to retroactively increment the counter for a specific
|
52
|
+
timestamp, just pass it in.
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
Tabs.increment_counter("wibsite-visits", Time.now - 2.days)
|
56
|
+
```
|
57
|
+
|
51
58
|
To retrieve the counts for a given time period just call `Tabs#get_stats` with the name of the metric, a range of times defining the period for which you want stats, and the resolution at which the data should be aggregated.
|
52
59
|
|
53
60
|
```ruby
|
@@ -84,6 +91,13 @@ To record a value, simply call `Tabs#record_value`.
|
|
84
91
|
Tabs.record_value("new-user-age", 32)
|
85
92
|
```
|
86
93
|
|
94
|
+
If you need to retroactively record a value for a specific
|
95
|
+
timestamp, just pass it in.
|
96
|
+
|
97
|
+
```ruby
|
98
|
+
Tabs.increment_counter("new-user-age", 19, Time.now - 2.days)
|
99
|
+
```
|
100
|
+
|
87
101
|
This will also create a value metric the first time, you can manually create
|
88
102
|
a metric as well:
|
89
103
|
|
@@ -101,9 +115,9 @@ This will return a familiar value, but with an expanded set of values.
|
|
101
115
|
|
102
116
|
```ruby
|
103
117
|
[
|
104
|
-
{ 2000-01-01 00:00:00 UTC => { min: 19, max: 54, sum: 226, avg: 38 } },
|
105
|
-
{ 2000-02-01 01:00:00 UTC => { min: 0, max: 0, sum: 0, avg: 0 } },
|
106
|
-
{ 2000-03-01 02:00:00 UTC => { min: 22, max: 34, sum: 180, avg: 26 } },
|
118
|
+
{ 2000-01-01 00:00:00 UTC => { count: 9, min: 19, max: 54, sum: 226, avg: 38 } },
|
119
|
+
{ 2000-02-01 01:00:00 UTC => { count: 0, min: 0, max: 0, sum: 0, avg: 0 } },
|
120
|
+
{ 2000-03-01 02:00:00 UTC => { count: 2, min: 22, max: 34, sum: 180, avg: 26 } },
|
107
121
|
...
|
108
122
|
]
|
109
123
|
```
|
@@ -127,6 +141,14 @@ finish the task:
|
|
127
141
|
Tabs.complete_task("mobile-to-purchase", "2g4hj17787s")
|
128
142
|
```
|
129
143
|
|
144
|
+
If you need to retroactively start/complete a task at a specific
|
145
|
+
timestamp, just pass it in.
|
146
|
+
|
147
|
+
```ruby
|
148
|
+
Tabs.start_task("mobile-to-purchase", "2g4hj17787s", Time.now - 2.days)
|
149
|
+
Tabs.complete_task("mobile-to-purchase", "2g4hj17787s", Time.now - 1.days)
|
150
|
+
```
|
151
|
+
|
130
152
|
Retrieving stats for a task metric is just like the other types:
|
131
153
|
|
132
154
|
```ruby
|
data/lib/tabs/version.rb
CHANGED
data/tabs.gemspec
CHANGED
@@ -26,8 +26,8 @@ Please continue to use version 0.5.6 if you need to access existing metric data.
|
|
26
26
|
TXT
|
27
27
|
|
28
28
|
gem.add_dependency "activesupport", ">= 3.2"
|
29
|
-
gem.add_dependency "json", "
|
30
|
-
gem.add_dependency "redis", "~> 3.0.
|
29
|
+
gem.add_dependency "json", ">= 1.7"
|
30
|
+
gem.add_dependency "redis", "~> 3.0.0"
|
31
31
|
|
32
32
|
gem.add_development_dependency "fakeredis"
|
33
33
|
gem.add_development_dependency "pry"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tabs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-07-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -32,17 +32,17 @@ dependencies:
|
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
35
|
-
- -
|
35
|
+
- - ! '>='
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 1.7
|
37
|
+
version: '1.7'
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.7
|
45
|
+
version: '1.7'
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: redis
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 3.0.
|
53
|
+
version: 3.0.0
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 3.0.
|
61
|
+
version: 3.0.0
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: fakeredis
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -217,3 +217,4 @@ test_files:
|
|
217
217
|
- spec/lib/tabs/task_spec.rb
|
218
218
|
- spec/lib/tabs_spec.rb
|
219
219
|
- spec/spec_helper.rb
|
220
|
+
has_rdoc:
|