lockistics 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -119,7 +119,12 @@ module Lockistics
119
119
  def before_perform
120
120
  Lockistics.known_keys(key) unless options[:no_metrics]
121
121
  @start_time = Time.now.to_f
122
- @start_rss = OS.rss_bytes
122
+ # Sometimes you get 'Cannot allocate memory - ps -o rss= -p 15964'
123
+ begin
124
+ @start_rss = OS.rss_bytes
125
+ rescue
126
+ @start_rss = nil
127
+ end
123
128
  redis.pipelined do
124
129
  redis.sadd "#{Lockistics.configuration.namespace}.#{key}.hourlies", hourly_timestamp
125
130
  redis.sadd "#{Lockistics.configuration.namespace}.#{key}.dailies", daily_timestamp
@@ -130,7 +135,7 @@ module Lockistics
130
135
  def after_perform
131
136
  unless @lock_timeouts > 0
132
137
  @duration = ((Time.now.to_f - @start_time) * 1000).round
133
- @rss_increase = ((OS.rss_bytes - @start_rss) / 1024).round
138
+ @rss_increase = ((OS.rss_bytes - @start_rss) / 1024).round unless @start_rss.nil?
134
139
  end
135
140
  add_meter_statistics unless options[:no_metrics]
136
141
  add_lock_statistics unless lock.nil?
@@ -1,3 +1,3 @@
1
1
  module Lockistics
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lockistics
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kimmo Lehto
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2014-06-03 00:00:00 Z
18
+ date: 2014-06-05 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  version_requirements: &id001 !ruby/object:Gem::Requirement