leaks 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/leaks/printer.rb +5 -1
- data/lib/leaks/ram_usage.rb +17 -11
- data/lib/leaks/version.rb +1 -1
- metadata +1 -1
data/lib/leaks/printer.rb
CHANGED
data/lib/leaks/ram_usage.rb
CHANGED
@@ -1,23 +1,29 @@
|
|
1
1
|
module Leaks
|
2
2
|
class RAMUsage
|
3
3
|
def initialize
|
4
|
-
@previous
|
5
|
-
@current
|
6
|
-
@stable
|
4
|
+
@previous = kilobytes_used
|
5
|
+
@current = @previous
|
6
|
+
@stable = Time.now
|
7
|
+
@increased = false
|
7
8
|
end
|
8
9
|
|
9
|
-
def
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
def update
|
11
|
+
@increased = false
|
12
|
+
@previous = @current
|
13
|
+
@current = kilobytes_used
|
14
|
+
|
15
|
+
if @current > @previous
|
16
|
+
@increased = true
|
17
|
+
@stable = Time.now
|
15
18
|
end
|
16
19
|
end
|
17
20
|
|
21
|
+
def increased?
|
22
|
+
@increased
|
23
|
+
end
|
24
|
+
|
18
25
|
def current
|
19
|
-
@
|
20
|
-
@current = kilobytes_used
|
26
|
+
@current
|
21
27
|
end
|
22
28
|
|
23
29
|
def to_s
|
data/lib/leaks/version.rb
CHANGED