leaks 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/leaks/ram_usage.rb +5 -5
- data/lib/leaks/version.rb +1 -1
- metadata +1 -1
data/lib/leaks/ram_usage.rb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
module Leaks
|
2
2
|
class RAMUsage
|
3
3
|
def initialize
|
4
|
-
@
|
5
|
-
@
|
4
|
+
@current = kilobytes_used
|
5
|
+
@highest = @current
|
6
6
|
@stable = Time.now
|
7
7
|
@increased = false
|
8
8
|
end
|
9
9
|
|
10
10
|
def update
|
11
11
|
@increased = false
|
12
|
-
@previous = @current
|
13
12
|
@current = kilobytes_used
|
14
13
|
|
15
|
-
if @current > @
|
14
|
+
if @current > @highest
|
15
|
+
@highest = @current
|
16
16
|
@increased = true
|
17
17
|
@stable = Time.now
|
18
18
|
end
|
@@ -27,7 +27,7 @@ module Leaks
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def to_s
|
30
|
-
"
|
30
|
+
"Current: #{current}KB Highest: #{@highest}KB"
|
31
31
|
end
|
32
32
|
|
33
33
|
def stable_for
|
data/lib/leaks/version.rb
CHANGED