logjam_agent 0.6.8 → 0.6.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/logjam_agent/rack/logger.rb +7 -0
- data/lib/logjam_agent/version.rb +1 -1
- metadata +4 -4
@@ -1,4 +1,7 @@
|
|
1
1
|
module LogjamAgent
|
2
|
+
|
3
|
+
class CallerTimeoutExceeded < StandardError; end
|
4
|
+
|
2
5
|
module Rack
|
3
6
|
class Logger < ActiveSupport::LogSubscriber
|
4
7
|
def initialize(app)
|
@@ -39,6 +42,10 @@ module LogjamAgent
|
|
39
42
|
|
40
43
|
request_info = {:total_time => run_time_ms, :code => status, :view_time => view_time || 0.0}
|
41
44
|
|
45
|
+
if (allowed_time_ms = env['HTTP_X_LOGJAM_CALLER_TIMEOUT'].to_i) > 0 && (run_time_ms > allowed_time_ms)
|
46
|
+
warn LogjamAgent::CallerTimeoutExceeded.new("exceeded allowed time by #{(run_time_ms.to_i - allowed_time_ms)} ms")
|
47
|
+
end
|
48
|
+
|
42
49
|
message = "Completed #{status} #{::Rack::Utils::HTTP_STATUS_CODES[status]} in %.1fms" % run_time_ms
|
43
50
|
message << " (#{additions.join(' | ')})" unless additions.blank?
|
44
51
|
info message
|
data/lib/logjam_agent/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logjam_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 9
|
10
|
+
version: 0.6.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Stefan Kaes
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-05-
|
18
|
+
date: 2013-05-29 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rake
|