tally_counter 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -56,6 +56,21 @@ headers['X-Tally-Counter-Skip'] = 'true'
56
56
  Note the mere presence of the header and not its value is enough
57
57
  to cause a count skip.
58
58
 
59
+ ## Redis connections
60
+
61
+ Its advisable to inject your own Redis connection as well as use
62
+ [hiredis-rb](https://github.com/pietern/hiredis-rb) for making connections
63
+ to Redis. hiredis is faster than the redis-rb driver as it wraps the
64
+ C client. Quickstart to get redis to connect with hiredis:
65
+
66
+ ```ruby
67
+ require "redis"
68
+ require "redis/connection/hiredis"
69
+ require "tally_counter"
70
+ ```
71
+
72
+ Redis connections you (or TallyCounter) create will now use the faster client.
73
+
59
74
  ## Keys and Scoring
60
75
 
61
76
  The system uses Redis sorted sets for tracking application hits.
@@ -81,7 +81,7 @@ module TallyCounter
81
81
  @redis.zincrby current_key, 1, ip.to_s
82
82
  end
83
83
  rescue Timeout::Error, Redis::BaseError => e
84
- @logger.error e.message
84
+ @logger.error "#{self.class.name} - #{e.message}"
85
85
  end
86
86
  end
87
87
 
@@ -1,3 +1,3 @@
1
1
  module TallyCounter
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tally_counter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2013-06-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redis
16
- requirement: &2168806000 !ruby/object:Gem::Requirement
16
+ requirement: &2152443500 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2168806000
24
+ version_requirements: *2152443500
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rack-test
27
- requirement: &2168805560 !ruby/object:Gem::Requirement
27
+ requirement: &2152443060 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2168805560
35
+ version_requirements: *2152443060
36
36
  description: Tally web application hits with Rack & Redis sorted sets
37
37
  email:
38
38
  - xternal1+github@gmail.com