alacrity-rails 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43abf54365fdbf4532f726fa977e2da4f822fd23
|
4
|
+
data.tar.gz: c0cacaa8b543d335e6d4c18d30c65223a106dfd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc6b890d8bb41b5aeb7f4aa86ea3eedd6f884826c41caf76829c9ff83cb688a53ea8b932cbfc5979a5d38bfbeda8db1748a3ba19254ee3a268472c6931dab6c7
|
7
|
+
data.tar.gz: 0ee1e55ef7fd76cc84eea0511acc91f3889d38cfe45c658ace48928bdc10040e22a78121b59ce46546f33e24dd4636556d988f474792f50fac8321771e4fb8d6
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module AlacrityRails::Transaction
|
2
2
|
class WebTransaction < Base
|
3
|
-
attr_accessor :url, :middleware_started_at, :
|
4
|
-
:method, :status
|
3
|
+
attr_accessor :url, :middleware_started_at, :middleware_finished_at,
|
4
|
+
:controller, :action, :format, :method, :status
|
5
5
|
|
6
6
|
def initialize(env={})
|
7
7
|
self.middleware_started_at = absolute_time(DateTime.now)
|
@@ -26,14 +26,17 @@ module AlacrityRails::Transaction
|
|
26
26
|
}
|
27
27
|
end
|
28
28
|
|
29
|
+
def finalize!
|
30
|
+
self.middleware_finished_at = absolute_time(DateTime.now)
|
31
|
+
end
|
32
|
+
|
29
33
|
def as_json(*args)
|
30
|
-
middleware_finished_at = absolute_time(DateTime.now)
|
31
34
|
{
|
32
35
|
environment: AlacrityRails::ServerConfig.environment,
|
33
36
|
url: url,
|
34
37
|
controller: controller,
|
35
38
|
action: action,
|
36
|
-
middleware_elapsed: middleware_finished_at - middleware_started_at,
|
39
|
+
middleware_elapsed: (middleware_finished_at || absolute_time(DateTime.now)) - middleware_started_at,
|
37
40
|
middleware_started_at: middleware_started_at,
|
38
41
|
middleware_finished_at: middleware_finished_at,
|
39
42
|
format: format,
|