Class: Inspec::Telemetry
- Inherits:
-
Object
show all
- Defined in:
- lib/inspec/utils/telemetry.rb,
lib/inspec/utils/telemetry/base.rb,
lib/inspec/utils/telemetry/http.rb,
lib/inspec/utils/telemetry/null.rb,
lib/inspec/utils/telemetry/run_context_probe.rb
Defined Under Namespace
Classes: Base, HTTP, Null, RunContextProbe
Constant Summary
collapse
- @@instance =
nil
- @@config =
nil
Class Method Summary
collapse
Class Method Details
.config ⇒ Object
66
67
68
|
# File 'lib/inspec/utils/telemetry.rb', line 66
def self.config
@@config
end
|
.determine_backend_class ⇒ Object
.instance ⇒ Object
13
14
15
|
# File 'lib/inspec/utils/telemetry.rb', line 13
def self.instance
@@instance ||= determine_backend_class.new
end
|
.license ⇒ Object
40
41
42
43
|
# File 'lib/inspec/utils/telemetry.rb', line 40
def self.license
Inspec::Log.debug "Fetching license context for telemetry check"
@license = ChefLicensing.license_context
end
|
.note_feature_usage(feature_name) ⇒ Object
62
63
64
|
# File 'lib/inspec/utils/telemetry.rb', line 62
def self.note_feature_usage(feature_name)
instance.note_feature_usage(feature_name)
end
|
.run_ending(opts) ⇒ Object
55
56
57
58
59
60
|
# File 'lib/inspec/utils/telemetry.rb', line 55
def self.run_ending(opts)
@@config ||= opts[:conf]
instance.run_ending(opts)
rescue StandardError => e
Inspec::Log.debug "Encountered error in Telemetry end run call -> #{e.message}"
end
|
.run_starting(opts) ⇒ Object
These class methods make it convenient to call from anywhere within the InSpec codebase.
48
49
50
51
52
53
|
# File 'lib/inspec/utils/telemetry.rb', line 48
def self.run_starting(opts)
@@config ||= opts[:conf]
instance.run_starting(opts)
rescue StandardError => e
Inspec::Log.debug "Encountered error in Telemetry start run call -> #{e.message}"
end
|
.telemetry_disabled? ⇒ Boolean
70
71
72
|
# File 'lib/inspec/utils/telemetry.rb', line 70
def self.telemetry_disabled?
config.telemetry_options["enable_telemetry"].nil? ? false : !config.telemetry_options["enable_telemetry"]
end
|