chef-telemetry 1.0.2 → 1.0.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef/telemeter.rb +10 -10
- data/lib/chef/telemeter/sender.rb +2 -2
- data/lib/chef/telemetry.rb +5 -5
- data/lib/chef/telemetry/client.rb +12 -3
- data/lib/chef/telemetry/session.rb +1 -1
- data/lib/chef/telemetry/version.rb +1 -1
- metadata +3 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e15f8adf2fed70be55830513f6ca491689a1ce4bd6e62e2f8919507dd65f893b
|
4
|
+
data.tar.gz: b19d663f7def5c3962ed5106345214db2a34ef04b8e321da8a9207a84543f6e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3895198dedfea3d987bb3a11366a5eee533c06b39b382bd25a138f7f1d28cb7c2166299a94657c8878cf6cb6c0683564f4ba0eb70abda31e51c5ac35a1ca747
|
7
|
+
data.tar.gz: 99c141de6e91ab0f094e47b8d8e8c8dcf1cc5f2b432de6c6a1cf1fc99b1674ac6e609ac89e547e2544cec3868d5e123a00a08847f4e08db592756df11ab6c234
|
data/lib/chef/telemeter.rb
CHANGED
@@ -15,14 +15,14 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
|
19
|
-
require "benchmark"
|
20
|
-
require "forwardable"
|
21
|
-
require "singleton"
|
22
|
-
require "json"
|
23
|
-
require "digest/sha1"
|
24
|
-
require "securerandom"
|
25
|
-
require "yaml"
|
18
|
+
require_relative "telemetry/version"
|
19
|
+
require "benchmark" unless defined?(Benchmark)
|
20
|
+
require "forwardable" unless defined?(Forwardable)
|
21
|
+
require "singleton" unless defined?(Singleton)
|
22
|
+
require "json" unless defined?(JSON)
|
23
|
+
require "digest/sha1" unless defined?(Digest::SHA1)
|
24
|
+
require "securerandom" unless defined?(SecureRandom)
|
25
|
+
require "yaml" unless defined?(YAML)
|
26
26
|
|
27
27
|
class Chef
|
28
28
|
# This definites the Telemeter interface. Implementation thoughts for
|
@@ -51,13 +51,13 @@ class Chef
|
|
51
51
|
# :dev_mode # false, not required
|
52
52
|
config[:dev_mode] ||= false
|
53
53
|
config[:enabled] ||= false
|
54
|
-
|
54
|
+
require_relative "telemeter/sender"
|
55
55
|
@config = config
|
56
56
|
Sender.start_upload_thread(config)
|
57
57
|
end
|
58
58
|
|
59
59
|
def enabled?
|
60
|
-
|
60
|
+
require_relative "telemetry/decision"
|
61
61
|
config[:enabled] && !Telemetry::Decision.env_opt_out?
|
62
62
|
end
|
63
63
|
|
data/lib/chef/telemetry.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
require_relative "telemetry/client"
|
2
|
+
require_relative "telemetry/decision"
|
3
|
+
require_relative "telemetry/event"
|
4
|
+
require_relative "telemetry/session"
|
5
|
+
require_relative "telemetry/version"
|
6
6
|
|
7
7
|
class Chef
|
8
8
|
class Telemetry
|
@@ -1,4 +1,6 @@
|
|
1
|
-
require "http"
|
1
|
+
require "net/http" unless defined?(Net::HTTP)
|
2
|
+
require "uri" unless defined?(URI)
|
3
|
+
require "json" unless defined?(JSON)
|
2
4
|
require "concurrent"
|
3
5
|
|
4
6
|
class Chef
|
@@ -11,11 +13,18 @@ class Chef
|
|
11
13
|
attr_reader :http
|
12
14
|
def initialize(endpoint = TELEMETRY_ENDPOINT)
|
13
15
|
super()
|
14
|
-
|
16
|
+
uri = URI(endpoint)
|
17
|
+
@http = Net::HTTP.new(uri.host, uri.port)
|
18
|
+
@http.use_ssl = uri.scheme == "https"
|
19
|
+
@http.start
|
15
20
|
end
|
16
21
|
|
17
22
|
def fire(event)
|
18
|
-
|
23
|
+
req = Net::HTTP::Post.new("/events")
|
24
|
+
req["Content-Type"] = "application/json"
|
25
|
+
req.body = JSON.dump(event)
|
26
|
+
# TODO: @cwolfe use response and at least debug log status
|
27
|
+
http.request req
|
19
28
|
end
|
20
29
|
end
|
21
30
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-telemetry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,34 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: http
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '2.2'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '2.2'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: ffi-yajl
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '2.2'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '2.2'
|
55
27
|
- !ruby/object:Gem::Dependency
|
56
28
|
name: concurrent-ruby
|
57
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
86
|
- !ruby/object:Gem::Version
|
115
87
|
version: '0'
|
116
88
|
requirements: []
|
117
|
-
rubygems_version: 3.
|
89
|
+
rubygems_version: 3.1.4
|
118
90
|
signing_key:
|
119
91
|
specification_version: 4
|
120
92
|
summary: Send user actions to the Chef telemetry system. See Chef RFC-051 for further
|