rack-timing 0.0.1 → 0.0.2

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: eefd2423a1ef51250859dd8fecbfb8b3fda71693
4
- data.tar.gz: 47cffe8d509017fba98cefd744b7add0c4b44b83
3
+ metadata.gz: 6af39d6c6ef63525e3a883e9df2da43a0b90bd7f
4
+ data.tar.gz: ad684a83dffaec1050b4dc08129ee5c4e9c21415
5
5
  SHA512:
6
- metadata.gz: 8b7ecb8a18aef1bcb1f384affac10bc775c9f2b4c738470927b50173730d0ae92d58a1029f0f401bb786c546f0ecffb306546bb74090b18b0f63e4c836ff03ed
7
- data.tar.gz: 1c589a55d0f29567a69ca44353b29d2e5ec20401a4d4f70f04ded76269680a5028ae1ab6b95870bbf0ac2df7dd41a09d969f1e910a623cf3b66e548bf60edb68
6
+ metadata.gz: 321d7619fd414d80f944d507ff1bc74baa0457dbe1cb91d57edf3b79b0d05b9bab43620f424168a981d7ee8ad591d9ac5b1a0750c3a59d9bfc079cd1ca664b70
7
+ data.tar.gz: ffdfe08dc767c15749ffedbf9f32fa2090bcc727991ef9d01c98a593cd80d6e797fef32f2147269c259525fd4ee99e15f62d6ec99ff40306d58f93b1641eef12
data/.gitignore CHANGED
@@ -26,4 +26,6 @@ Gemfile.lock
26
26
  .ruby-gemset
27
27
 
28
28
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
29
- .rvmrc
29
+ .rvmrc
30
+
31
+ .DS_Store
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # rack-timing
2
2
 
3
- Add this gem to a Rails app to get a log line like this for each request:
3
+ Ever wondered if some of your app's latency is coming from myserious middleware? Want to be able to tie requests to specific workers and threads while you're at it? Add this gem to a Rails app to get a log line like this for each request:
4
4
 
5
5
  at=info thread_id=70351652783840 process_id=55394 request_id=013f9cc29c1e4c483435dbc15ab260f4 pre_request=0ms rack_in=202ms app=505ms rack_out=301ms
6
6
 
@@ -8,7 +8,7 @@ That includes:
8
8
 
9
9
  * `thread_id`: For tracking requests across threads, (e.g. Puma)
10
10
  * `process_id`: For tracking requests across workers (e.g. Puma or Unicorn)
11
- * `request_id`: Correlate with you app (or Heroku router) logs
11
+ * `request_id`: Correlate with your app (or Heroku router) logs
12
12
  * `pre_request`: Measure the time between `HTTP_X_REQUEST_START` and the start of your rack stack (similar to New Relic's 'reuqest queueing' metric)
13
13
  * `rack_in`: The time in the rack stack before your app sees the request
14
14
  * `app`: The time spent processing the request in your app
@@ -7,9 +7,9 @@ module Rack
7
7
  status, headers, response = @app.call(env)
8
8
 
9
9
  measure_pre_request_time(env)
10
- measure(:rack_in, :rack_in_start, :rack_in_end, env)
11
- measure(:app, :rack_in_end, :rack_out_start, env)
12
- measure(:rack_out, :rack_out_start, :rack_out_end, env)
10
+ measure("measure#rack_in", :rack_in_start, :rack_in_end, env)
11
+ measure("measure#app", :rack_in_end, :rack_out_start, env)
12
+ measure("measure#rack_out", :rack_out_start, :rack_out_end, env)
13
13
 
14
14
  @metrics = {thread_id: Thread.current.object_id, process_id: Process.pid, request_id: (env["action_dispatch.request_id"] || "")}.merge(@metrics)
15
15
  notify(@metrics) if should_notify?
@@ -30,9 +30,9 @@ module Rack
30
30
 
31
31
  def measure_pre_request_time(env)
32
32
  if (request_start = (env["HTTP_X_REQUEST_START"] || 0).to_i) > 0
33
- @metrics[:pre_request] = (env["RACK_IN_START"] - request_start).to_s + "ms"
33
+ @metrics["measure#pre_request"] = (env["RACK_IN_START"] - request_start).to_s + "ms"
34
34
  else
35
- @metrics[:pre_request] = "0ms"
35
+ @metrics["measure#pre_request"] = "0ms"
36
36
  end
37
37
  end
38
38
 
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module Timing
3
- VERSION="0.0.1"
3
+ VERSION="0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-timing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chad Bailey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-01 00:00:00.000000000 Z
11
+ date: 2014-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -45,13 +45,11 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - .DS_Store
49
48
  - .gitignore
50
49
  - Gemfile
51
50
  - LICENSE.txt
52
51
  - README.md
53
52
  - Rakefile
54
- - lib/.DS_Store
55
53
  - lib/rack-timing.rb
56
54
  - lib/timing/base.rb
57
55
  - lib/timing/end.rb
@@ -61,8 +59,6 @@ files:
61
59
  - lib/timing/start.rb
62
60
  - lib/timing/version.rb
63
61
  - rack-timing.gemspec
64
- - timing.rb
65
- - timing/version.rb
66
62
  homepage: ''
67
63
  licenses:
68
64
  - MIT
data/.DS_Store DELETED
Binary file
Binary file
data/timing.rb DELETED
@@ -1,7 +0,0 @@
1
- require "rack/timing/version"
2
-
3
- module Rack
4
- module Timing
5
- # Your code goes here...
6
- end
7
- end
@@ -1,5 +0,0 @@
1
- module Rack
2
- module Timing
3
- VERSION = "0.0.1"
4
- end
5
- end