Class: Chef::Telemetry::Client
- Inherits:
-
Object
- Object
- Chef::Telemetry::Client
- Includes:
- Concurrent::Async
- Defined in:
- lib/chef/telemetry/client.rb
Constant Summary collapse
- TELEMETRY_ENDPOINT =
"https://telemetry.chef.io".freeze
Instance Attribute Summary collapse
-
#http ⇒ Object
readonly
Returns the value of attribute http.
Instance Method Summary collapse
- #fire(event) ⇒ Object
-
#initialize(endpoint = TELEMETRY_ENDPOINT) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(endpoint = TELEMETRY_ENDPOINT) ⇒ Client
Returns a new instance of Client.
12 13 14 15 |
# File 'lib/chef/telemetry/client.rb', line 12 def initialize(endpoint = TELEMETRY_ENDPOINT) super() @http = HTTP.persistent(endpoint) end |
Instance Attribute Details
#http ⇒ Object (readonly)
Returns the value of attribute http.
11 12 13 |
# File 'lib/chef/telemetry/client.rb', line 11 def http @http end |
Instance Method Details
#fire(event) ⇒ Object
17 18 19 |
# File 'lib/chef/telemetry/client.rb', line 17 def fire(event) http.post("/events", json: event).flush end |