logtail-rack 0.1.5 → 0.1.6

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
  SHA256:
3
- metadata.gz: 16509c0d376658470e6f30a21f35dc6bba83213dbf000d38557280f3535c2d62
4
- data.tar.gz: a666f568f5d25ae865ccfffb411813723eb7f0097393dc71abec06822b6e8e8a
3
+ metadata.gz: 76c8e9ab5c1364f1a345a7a20e6c24ef277ff8be9b8f3c9a173bbc9263f6d695
4
+ data.tar.gz: ad6237cc17307742c7263ec59afe93e77476d7410b8e94fe4a0f32129f22565b
5
5
  SHA512:
6
- metadata.gz: 200ed7c0ebac2fb76803ac8811c0d4f72dbd9c1ff02e59706d52955018b3509829fee9168da4667b244baa7f3f1aad8bf2168f4c5ce8f8c2cc94120826b7d982
7
- data.tar.gz: 952d5d52989861145c2b0f621f7046d7936c265c74872094d202dc28b4d2b542f090e7e7c29c4bf6ad70d212fea11d00fa2636bf22b392a3769faaeab29ef4ba
6
+ metadata.gz: 2d520a022a670a9a8116a0b460aa3a765d3ddcdce4598c30ace1bea5d7cc4e8494ebea7fcdaa01210eac676d7220eba6010d9cabf3f182e4edf36db0a224f00f
7
+ data.tar.gz: 6fdb85a21302164570c07359a948c8a2a036ef582f0fa7a0a4078c0d7ad86d3d19d30a455709253e88c600a45e09c722e77bfdb89775247bb7308f6218bfbf50
@@ -136,14 +136,14 @@ module Logtail
136
136
  end
137
137
 
138
138
  elsif collapse_into_single_event?
139
- start = Time.now
140
-
139
+ request_start = Time.now
141
140
  status, headers, body = @app.call(env)
141
+ request_end = Time.now
142
142
 
143
143
  Config.instance.logger.info do
144
144
  http_context = CurrentContext.fetch(:http)
145
145
  content_length = safe_to_i(headers[CONTENT_LENGTH_KEY])
146
- duration_ms = (Time.now - start) * 1000.0
146
+ duration_ms = (request_end - request_start) * 1000.0
147
147
 
148
148
  http_response = HTTPResponse.new(
149
149
  content_length: content_length,
@@ -174,8 +174,6 @@ module Logtail
174
174
 
175
175
  [status, headers, body]
176
176
  else
177
- start = Time.now
178
-
179
177
  Config.instance.logger.info do
180
178
  event_body = capture_request_body? ? request.body_content : nil
181
179
  http_request = HTTPRequest.new(
@@ -213,12 +211,14 @@ module Logtail
213
211
  }
214
212
  end
215
213
 
214
+ request_start = Time.now
216
215
  status, headers, body = @app.call(env)
216
+ request_end = Time.now
217
217
 
218
218
  Config.instance.logger.info do
219
219
  event_body = capture_response_body? ? body : nil
220
220
  content_length = safe_to_i(headers[CONTENT_LENGTH_KEY])
221
- duration_ms = (Time.now - start) * 1000.0
221
+ duration_ms = (request_end - request_start) * 1000.0
222
222
 
223
223
  http_response = HTTPResponse.new(
224
224
  body: event_body,
@@ -1,7 +1,7 @@
1
1
  module Logtail
2
2
  module Integrations
3
3
  module Rack
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logtail-rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Logtail
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-30 00:00:00.000000000 Z
11
+ date: 2021-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logtail