remnant 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/remnant/filters.rb +10 -5
- data/lib/remnant/version.rb +1 -1
- metadata +3 -3
data/lib/remnant/filters.rb
CHANGED
@@ -2,12 +2,17 @@ class Remnant
|
|
2
2
|
class Filters
|
3
3
|
module ClassMethods
|
4
4
|
def record(filter_type, filter_name, &block)
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
# ignore AroundFilters
|
6
|
+
if filter_type.to_s == 'ActionController::Filters::AroundFilter'
|
7
|
+
return block.call
|
8
|
+
else
|
9
|
+
start_time = Time.now
|
10
|
+
result = block.call
|
11
|
+
time = Time.now - start_time
|
12
|
+
filters << {:type => filter_type, :name => filter_name, :time => time, :ms => time * 1000}
|
9
13
|
|
10
|
-
|
14
|
+
return result
|
15
|
+
end
|
11
16
|
end
|
12
17
|
|
13
18
|
def reset
|
data/lib/remnant/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remnant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 6
|
10
|
+
version: 0.4.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- John 'asceth' Long
|