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
68
69
70
|
# File 'lib/inspec/utils/telemetry.rb', line 68
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
42
43
44
45
|
# File 'lib/inspec/utils/telemetry.rb', line 42
def self.license
Inspec::Log.debug "Fetching license context for telemetry check"
@license = ChefLicensing.license_context
end
|
.note_feature_usage(feature_name) ⇒ Object
64
65
66
|
# File 'lib/inspec/utils/telemetry.rb', line 64
def self.note_feature_usage(feature_name)
instance.note_feature_usage(feature_name)
end
|
.run_ending(opts) ⇒ Object
57
58
59
60
61
62
|
# File 'lib/inspec/utils/telemetry.rb', line 57
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.
50
51
52
53
54
55
|
# File 'lib/inspec/utils/telemetry.rb', line 50
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
72
73
74
|
# File 'lib/inspec/utils/telemetry.rb', line 72
def self.telemetry_disabled?
config.telemetry_options["enable_telemetry"].nil? ? false : !config.telemetry_options["enable_telemetry"]
end
|