corn 0.5.0 → 0.5.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
- ---
2
- SHA1:
3
- metadata.gz: e4be49268a392f4c4cbdaedf31da0808ac05329e
4
- data.tar.gz: 645775af9946dcefb266f85f3bcc3da4ea572735
5
- SHA512:
6
- metadata.gz: dc4055efcb92c7c0b14faefdced0800786bfd6804a3bca82466507e60578638fa95f03deb9dfe6bb480a8069b5fb022025dba771d8dce2791cc5cc1c4316e7b9
7
- data.tar.gz: 48b103523e4a1f684524ae625c9dab66600eae78927463411b7eb748a54ee76adb82f0459ab925d5b2ce7603c44b6547671994d488ebb272d77f20413138aa8a
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7329740d9a00529d51463831c8ee047ec35531c5
4
+ data.tar.gz: 13f56bce0d38a336482b41ae50f6c2ec6f498628
5
+ SHA512:
6
+ metadata.gz: 8a64caa0cfcdbeefac7fb4d9731fa3a507d8a54e23a7d99dcf7749078683b6863ac975df15079e7610ee752081b9742a3356e726a09e9d9d7cbdc13abbdd0065
7
+ data.tar.gz: e5c3b41d0a6534eed079c6af31bbee42f5db71f5bd5ba63f4c016672476b9e41dddd6e58331f13d17683f91e625c826291f5efc192ca45e86363cbc4acfc07a5
@@ -37,7 +37,7 @@ module Corn
37
37
  end
38
38
 
39
39
  def submit_url
40
- File.join(host, 'profile_data')
40
+ File.join(host, 'profiling_data')
41
41
  end
42
42
 
43
43
  def rack_slow_request_profiler
@@ -14,11 +14,23 @@ module Corn
14
14
  end
15
15
 
16
16
  def time
17
- Time.now - @env[:start_time]
17
+ end_at - @env[:start_time]
18
18
  end
19
19
 
20
- def to_h
21
- @env.dup
20
+ def end_at
21
+ Time.now
22
+ end
23
+
24
+ def to_report
25
+ name = File.join(@env[:http_host].to_s, @env[:path_info].to_s)
26
+ if @env[:query_string]
27
+ name = "#{name}?#{@env[:query_string]}"
28
+ end
29
+ {
30
+ 'report[name]' => name,
31
+ 'report[start_at]' => @env[:start_time].iso8601,
32
+ 'report[end_at]' => end_at.iso8601
33
+ }
22
34
  end
23
35
  end
24
36
  end
@@ -28,7 +28,7 @@ module Corn
28
28
  request_env = RequestEnv.new(env)
29
29
  lambda do |data|
30
30
  if request_env.time > @slow_request_threshold
31
- @post.enqueue(request_env.to_h.merge("data" => data))
31
+ @post.enqueue(request_env.to_report.merge("data" => data))
32
32
  end
33
33
  end
34
34
  end
metadata CHANGED
@@ -1,66 +1,70 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: corn
3
- version: !ruby/object:Gem::Version
4
- version: 0.5.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.1
5
5
  platform: ruby
6
- authors:
7
- - Xiao Li
8
- autorequire:
6
+ authors:
7
+ - Xiao Li
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-20 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: sampling_prof
15
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '>='
18
- - !ruby/object:Gem::Version
19
- version: 0.4.5
20
- requirement: !ruby/object:Gem::Requirement
21
- requirements:
22
- - - '>='
23
- - !ruby/object:Gem::Version
24
- version: 0.4.5
25
- prerelease: false
26
- type: :runtime
11
+
12
+ date: 2014-06-20 00:00:00 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: sampling_prof
16
+ prerelease: false
17
+ requirement: &id001 !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: 0.4.5
22
+ type: :runtime
23
+ version_requirements: *id001
27
24
  description: |
28
25
  Corn collects your application's profiling data by sampling_prof gem, and submits the result to Corn server for analysis.
29
- email:
30
- - swing1979@gmail.com
26
+
27
+ email:
28
+ - swing1979@gmail.com
31
29
  executables: []
30
+
32
31
  extensions: []
32
+
33
33
  extra_rdoc_files: []
34
- files:
35
- - README.md
36
- - lib/corn.rb
37
- - lib/corn/config.rb
38
- - lib/corn/post.rb
39
- - lib/corn/rack.rb
40
- - lib/corn/rack/request_env.rb
41
- - lib/corn/rack/slow_request_profiler.rb
34
+
35
+ files:
36
+ - README.md
37
+ - lib/corn.rb
38
+ - lib/corn/config.rb
39
+ - lib/corn/post.rb
40
+ - lib/corn/rack.rb
41
+ - lib/corn/rack/request_env.rb
42
+ - lib/corn/rack/slow_request_profiler.rb
42
43
  homepage: https://github.com/xli/corn
43
- licenses:
44
- - MIT
44
+ licenses:
45
+ - MIT
45
46
  metadata: {}
46
- post_install_message:
47
+
48
+ post_install_message:
47
49
  rdoc_options: []
48
- require_paths:
49
- - lib
50
- required_ruby_version: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- required_rubygems_version: !ruby/object:Gem::Requirement
56
- requirements:
57
- - - '>='
58
- - !ruby/object:Gem::Version
59
- version: '0'
50
+
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - &id002
56
+ - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: "0"
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - *id002
60
62
  requirements: []
61
- rubyforge_project:
63
+
64
+ rubyforge_project:
62
65
  rubygems_version: 2.1.9
63
- signing_key:
66
+ signing_key:
64
67
  specification_version: 4
65
68
  summary: Corn submits profiling data to Corn server.
66
69
  test_files: []
70
+