Class: Atatus::Metadata::SystemInfo Private
- Inherits:
-
Object
- Object
- Atatus::Metadata::SystemInfo
- Defined in:
- lib/atatus/metadata/system_info.rb,
lib/atatus/metadata/system_info/hw_info.rb,
lib/atatus/metadata/system_info/os_info.rb,
lib/atatus/metadata/system_info/container_info.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Classes: ContainerInfo, HWInfo, OSInfo
Instance Attribute Summary collapse
- #architecture ⇒ Object readonly private
- #container ⇒ Object readonly private
- #hostname ⇒ Object readonly private
- #hwinfo ⇒ Object readonly private
- #kubernetes ⇒ Object readonly private
- #osinfo ⇒ Object readonly private
- #platform ⇒ Object readonly private
Class Method Summary collapse
- .system_hostname ⇒ Object private
Instance Method Summary collapse
- #gem_platform ⇒ Object private
-
#initialize(config) ⇒ SystemInfo
constructor
private
A new instance of SystemInfo.
Constructor Details
#initialize(config) ⇒ SystemInfo
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SystemInfo.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/atatus/metadata/system_info.rb', line 24 def initialize(config) @config = config @hostname = @config.hostname || self.class.system_hostname @architecture = gem_platform.cpu @platform = gem_platform.os container_info = ContainerInfo.read! @container = container_info.container @kubernetes = container_info.kubernetes @hwinfo = HWInfo.read! @osinfo = OSInfo.read! end |
Instance Attribute Details
#architecture ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 40 41 |
# File 'lib/atatus/metadata/system_info.rb', line 39 def architecture @architecture end |
#container ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 40 41 |
# File 'lib/atatus/metadata/system_info.rb', line 39 def container @container end |
#hostname ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 40 41 |
# File 'lib/atatus/metadata/system_info.rb', line 39 def hostname @hostname end |
#hwinfo ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 40 41 |
# File 'lib/atatus/metadata/system_info.rb', line 39 def hwinfo @hwinfo end |
#kubernetes ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 40 41 |
# File 'lib/atatus/metadata/system_info.rb', line 39 def kubernetes @kubernetes end |
#osinfo ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 40 41 |
# File 'lib/atatus/metadata/system_info.rb', line 39 def osinfo @osinfo end |
#platform ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 40 41 |
# File 'lib/atatus/metadata/system_info.rb', line 39 def platform @platform end |
Class Method Details
.system_hostname ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
45 46 47 |
# File 'lib/atatus/metadata/system_info.rb', line 45 def self.system_hostname @system_hostname ||= `hostname`.chomp end |
Instance Method Details
#gem_platform ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/atatus/metadata/system_info.rb', line 41 def gem_platform @gem_platform ||= Gem::Platform.local end |