corn 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/lib/corn/post.rb +14 -13
- metadata +51 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3ce59d3b72f284db34d07ce896040fa38633a346
|
4
|
+
data.tar.gz: 7c0f808633dc19752eea4fc865665c6cc67f0f2e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 42f77f91d007c9fce606299e14c0b991313ac4d92af218c95cbc1737848876b3d1845365ac1d87b59d0e67f12bc3440d5f85ed04d7439078d8d5503db6d2d9e6
|
7
|
+
data.tar.gz: 38d9d3f6b32cacf7973bf8c4186c7015ea01348df29d409b9d4a6676c06257981cf3e4cf2e10bdc3a7598151d12f98d0de249393a56d062eec2f01e23c404c00
|
data/lib/corn/post.rb
CHANGED
@@ -19,7 +19,7 @@ module Corn
|
|
19
19
|
sleep 1
|
20
20
|
end
|
21
21
|
rescue => e
|
22
|
-
|
22
|
+
Corn.logger.error("Corn post thread stopped by error #{e.message}\n#{e.backtrace.join("\n")}")
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -29,25 +29,26 @@ module Corn
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def http_post(data, name)
|
32
|
-
|
33
|
-
req = Net::HTTP::Post.new(
|
32
|
+
uri = URI.parse(submit_url)
|
33
|
+
req = Net::HTTP::Post.new(uri.path)
|
34
34
|
req.set_form_data("data" => data, 'client_id' => Corn.client_id, 'name' => name)
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
|
36
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
37
|
+
if uri.scheme == 'https'
|
38
|
+
http.use_ssl = true
|
39
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if ENV['CORN_SKIP_SSL_VERIFY']
|
40
|
+
end
|
41
|
+
res = http.request(req)
|
42
|
+
Corn.logger.info("Corn report submitted to #{submit_url}")
|
43
|
+
unless res.is_a?(Net::HTTPSuccess)
|
44
|
+
Corn.logger.error("Post failed: #{res.message}(#{res.code}), response body: \n#{res.body}")
|
38
45
|
end
|
39
|
-
log("Corn report submitted to #{submit_url}")
|
40
46
|
rescue Exception => e
|
41
|
-
|
42
|
-
log(e.backtrace.join("\n"))
|
47
|
+
Corn.logger.error("post to #{submit_url} failed: #{e.message}\n#{e.backtrace.join("\n")}")
|
43
48
|
end
|
44
49
|
|
45
50
|
def submit_url
|
46
51
|
Corn.submit_url
|
47
52
|
end
|
48
|
-
|
49
|
-
def log(msg)
|
50
|
-
Corn.logger.info msg
|
51
|
-
end
|
52
53
|
end
|
53
54
|
end
|
metadata
CHANGED
@@ -1,64 +1,68 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: corn
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.2
|
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
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
version: '0.4'
|
25
|
-
prerelease: false
|
26
|
-
type: :runtime
|
11
|
+
|
12
|
+
date: 2014-06-15 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"
|
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 server, so that you can merge multiple server's profiling data and do analysis together.
|
29
|
-
|
30
|
-
|
26
|
+
|
27
|
+
email:
|
28
|
+
- swing1979@gmail.com
|
31
29
|
executables: []
|
30
|
+
|
32
31
|
extensions: []
|
32
|
+
|
33
33
|
extra_rdoc_files: []
|
34
|
-
|
35
|
-
|
36
|
-
-
|
37
|
-
- lib/corn
|
38
|
-
- lib/corn/
|
39
|
-
- lib/corn/rack
|
34
|
+
|
35
|
+
files:
|
36
|
+
- README.md
|
37
|
+
- lib/corn.rb
|
38
|
+
- lib/corn/post.rb
|
39
|
+
- lib/corn/rack.rb
|
40
|
+
- lib/corn/rack/slow_request_profiler.rb
|
40
41
|
homepage: https://github.com/xli/corn
|
41
|
-
licenses:
|
42
|
-
- MIT
|
42
|
+
licenses:
|
43
|
+
- MIT
|
43
44
|
metadata: {}
|
44
|
-
|
45
|
+
|
46
|
+
post_install_message:
|
45
47
|
rdoc_options: []
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
48
|
+
|
49
|
+
require_paths:
|
50
|
+
- lib
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- &id002
|
54
|
+
- ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: "0"
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- *id002
|
58
60
|
requirements: []
|
59
|
-
|
61
|
+
|
62
|
+
rubyforge_project:
|
60
63
|
rubygems_version: 2.1.9
|
61
|
-
signing_key:
|
64
|
+
signing_key:
|
62
65
|
specification_version: 4
|
63
66
|
summary: Corn submits profiling data to Corn server.
|
64
67
|
test_files: []
|
68
|
+
|