logjam_agent 0.24.1 → 0.24.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/logjam_agent/rack/logger.rb +10 -4
- data/lib/logjam_agent/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b20bff9f96a0a2d579b508bc1f92117c760aeb31
|
4
|
+
data.tar.gz: e972f22874775d7184e409db4dbc01b63662f7ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eac6d9f8e05fa4cd9f62ff408bf3f304b1860346a976818733572c0e5129dd940dc74e0a3f327281c96993b7b2d425179502815f807d2969a6e13cff1b310e9f
|
7
|
+
data.tar.gz: ef41e1c35b80e4d04d3eff2bce3ccaf02c8c67e90b52435c1f2a9e3c1ed14ad489d90f4996ac5cbe0805932228e4013fffaf8acd37cf1ef3d5963370cab8830e
|
@@ -28,10 +28,16 @@ module LogjamAgent
|
|
28
28
|
def call_app(request, env)
|
29
29
|
start_time = Time.now
|
30
30
|
start_time_header = env['HTTP_X_STARTTIME']
|
31
|
-
if start_time_header
|
32
|
-
|
33
|
-
|
34
|
-
|
31
|
+
if start_time_header
|
32
|
+
if start_time_header =~ /\At=(\d+)\z/
|
33
|
+
# HTTP_X_STARTTIME is microseconds since the epoch (UTC)
|
34
|
+
http_start_time = Time.at($1.to_f / 1_000_000.0)
|
35
|
+
elsif start_time_header =~ /\Ats=(\d+)(?:\.(\d+))?\z/
|
36
|
+
# HTTP_X_STARTTIME is seconds since the epoch (UTC) with a milliseconds resolution
|
37
|
+
http_start_time = Time.at($1.to_f + $2.to_f / 1000)
|
38
|
+
end
|
39
|
+
|
40
|
+
if http_start_time && (wait_time_ms = (start_time - http_start_time) * 1000) > 0
|
35
41
|
start_time = http_start_time
|
36
42
|
end
|
37
43
|
else
|
data/lib/logjam_agent/version.rb
CHANGED