wolverine 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8952bd045b5d2197a89aeae601e815c49ec756e7
4
+ data.tar.gz: 6a78997394c175e29d05d6e857e09d29f2357af9
5
+ SHA512:
6
+ metadata.gz: ebafad7f4823374174641a00343317e5c74ef5767b8875355aa2741578a963c797574f3c1b09caf4103fa6bf9340fb6d5e938d9cddc807fce00dbd2b001d1fc3
7
+ data.tar.gz: 61bd8592eb88dce35a97edd3e7300f8d34fcab300298692d5b2b41269eff18a9f2b946f29a220aad88bf80e07e4cc517d7508ff37404b14e58db93337fa31877
data/lib/wolverine.rb CHANGED
@@ -23,6 +23,14 @@ class Wolverine
23
23
  config.redis
24
24
  end
25
25
 
26
+ def self.statsd_enabled?
27
+ @statsd_enabled
28
+ end
29
+
30
+ def self.enable_statsd!
31
+ @statsd_enabled = true
32
+ end
33
+
26
34
  # Resets all the scripts cached by Wolverine. Scripts are lazy-loaded and
27
35
  # cached in-memory, so if a file changes on disk, it will be necessary to
28
36
  # manually reset the cache using +reset!+.
@@ -30,6 +30,7 @@ class Wolverine
30
30
  # @raise [LuaError] if the script failed to compile of encountered a
31
31
  # runtime error
32
32
  def call redis, *args
33
+ t = Time.now
33
34
  begin
34
35
  run_evalsha redis, *args
35
36
  rescue => e
@@ -41,10 +42,17 @@ class Wolverine
41
42
  else
42
43
  raise
43
44
  end
45
+ ensure
46
+ StatsD.measure(statsd_key, (Time.now - t) * 1000, 0.001) if Wolverine.statsd_enabled?
44
47
  end
45
48
 
46
49
  private
47
50
 
51
+ def statsd_key
52
+ k = @file.relative_path_from(Wolverine.config.script_path).to_s.sub!(/\.lua$/,'').gsub!(/\//,'.')
53
+ "Wolverine.#{k}"
54
+ end
55
+
48
56
  def run_evalsha redis, *args
49
57
  instrument :evalsha do
50
58
  redis.evalsha @digest, *args
@@ -1,3 +1,3 @@
1
1
  class Wolverine
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,96 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wolverine
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.2.6
4
+ version: 0.2.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Burke Libbey
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-01 00:00:00.000000000 Z
11
+ date: 2014-02-21 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- version_requirements: !ruby/object:Gem::Requirement
14
+ name: redis
15
+ requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.0.0
20
- none: false
21
- name: redis
22
20
  type: :runtime
23
21
  prerelease: false
24
- requirement: !ruby/object:Gem::Requirement
22
+ version_requirements: !ruby/object:Gem::Requirement
25
23
  requirements:
26
- - - ! '>='
24
+ - - ">="
27
25
  - !ruby/object:Gem::Version
28
26
  version: 3.0.0
29
- none: false
30
27
  - !ruby/object:Gem::Dependency
31
- version_requirements: !ruby/object:Gem::Requirement
28
+ name: mocha
29
+ requirement: !ruby/object:Gem::Requirement
32
30
  requirements:
33
- - - ~>
31
+ - - "~>"
34
32
  - !ruby/object:Gem::Version
35
33
  version: 0.10.5
36
- none: false
37
- name: mocha
38
34
  type: :development
39
35
  prerelease: false
40
- requirement: !ruby/object:Gem::Requirement
36
+ version_requirements: !ruby/object:Gem::Requirement
41
37
  requirements:
42
- - - ~>
38
+ - - "~>"
43
39
  - !ruby/object:Gem::Version
44
40
  version: 0.10.5
45
- none: false
46
41
  - !ruby/object:Gem::Dependency
47
- version_requirements: !ruby/object:Gem::Requirement
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
48
44
  requirements:
49
- - - ~>
45
+ - - "~>"
50
46
  - !ruby/object:Gem::Version
51
47
  version: 2.11.3
52
- none: false
53
- name: minitest
54
48
  type: :development
55
49
  prerelease: false
56
- requirement: !ruby/object:Gem::Requirement
50
+ version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
- - - ~>
52
+ - - "~>"
59
53
  - !ruby/object:Gem::Version
60
54
  version: 2.11.3
61
- none: false
62
55
  - !ruby/object:Gem::Dependency
63
- version_requirements: !ruby/object:Gem::Requirement
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
64
58
  requirements:
65
- - - ! '>='
59
+ - - ">="
66
60
  - !ruby/object:Gem::Version
67
61
  version: '0'
68
- none: false
69
- name: rake
70
62
  type: :development
71
63
  prerelease: false
72
- requirement: !ruby/object:Gem::Requirement
64
+ version_requirements: !ruby/object:Gem::Requirement
73
65
  requirements:
74
- - - ! '>='
66
+ - - ">="
75
67
  - !ruby/object:Gem::Version
76
68
  version: '0'
77
- none: false
78
69
  - !ruby/object:Gem::Dependency
79
- version_requirements: !ruby/object:Gem::Requirement
70
+ name: yard
71
+ requirement: !ruby/object:Gem::Requirement
80
72
  requirements:
81
- - - ! '>='
73
+ - - ">="
82
74
  - !ruby/object:Gem::Version
83
75
  version: '0'
84
- none: false
85
- name: yard
86
76
  type: :development
87
77
  prerelease: false
88
- requirement: !ruby/object:Gem::Requirement
78
+ version_requirements: !ruby/object:Gem::Requirement
89
79
  requirements:
90
- - - ! '>='
80
+ - - ">="
91
81
  - !ruby/object:Gem::Version
92
82
  version: '0'
93
- none: false
94
83
  description: Wolverine provides a simple way to run server-side redis scripts from
95
84
  a rails app
96
85
  email:
@@ -99,8 +88,8 @@ executables: []
99
88
  extensions: []
100
89
  extra_rdoc_files: []
101
90
  files:
102
- - .gitignore
103
- - .travis.yml
91
+ - ".gitignore"
92
+ - ".travis.yml"
104
93
  - Gemfile
105
94
  - LICENSE
106
95
  - README.md
@@ -126,27 +115,26 @@ files:
126
115
  - wolverine.gemspec
127
116
  homepage: https://github.com/Shopify/wolverine
128
117
  licenses: []
118
+ metadata: {}
129
119
  post_install_message:
130
120
  rdoc_options: []
131
121
  require_paths:
132
122
  - lib
133
123
  required_ruby_version: !ruby/object:Gem::Requirement
134
124
  requirements:
135
- - - ! '>='
125
+ - - ">="
136
126
  - !ruby/object:Gem::Version
137
127
  version: '0'
138
- none: false
139
128
  required_rubygems_version: !ruby/object:Gem::Requirement
140
129
  requirements:
141
- - - ! '>='
130
+ - - ">="
142
131
  - !ruby/object:Gem::Version
143
132
  version: '0'
144
- none: false
145
133
  requirements: []
146
134
  rubyforge_project: wolverine
147
- rubygems_version: 1.8.23
135
+ rubygems_version: 2.2.0
148
136
  signing_key:
149
- specification_version: 3
137
+ specification_version: 4
150
138
  summary: Wolverine provides a simple way to run server-side redis scripts from a rails
151
139
  app
152
140
  test_files: