Class: Atatus::Metadata::SystemInfo Private

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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
38
39
# File 'lib/atatus/metadata/system_info.rb', line 24

def initialize(config)
  @config = config

  @configured_hostname = @config.hostname
  @detected_hostname = detect_hostname
  @hostname = @configured_hostname || @detected_hostname
  @architecture = gem_platform.cpu
  @platform = gem_platform.os

  container_info = ContainerInfo.read!(@detected_hostname)
  @container = container_info.container
  @kubernetes = container_info.kubernetes

  @hwinfo = HWInfo.read!
  @osinfo = OSInfo.read!
end

Instance Attribute Details

#architectureObject (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.



41
42
43
# File 'lib/atatus/metadata/system_info.rb', line 41

def architecture
  @architecture
end

#configured_hostnameObject (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.



41
42
43
# File 'lib/atatus/metadata/system_info.rb', line 41

def configured_hostname
  @configured_hostname
end

#containerObject (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.



41
42
43
# File 'lib/atatus/metadata/system_info.rb', line 41

def container
  @container
end

#detected_hostnameObject (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.



41
42
43
# File 'lib/atatus/metadata/system_info.rb', line 41

def detected_hostname
  @detected_hostname
end

#hostnameObject (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.



41
42
43
# File 'lib/atatus/metadata/system_info.rb', line 41

def hostname
  @hostname
end

#hwinfoObject (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.



41
42
43
# File 'lib/atatus/metadata/system_info.rb', line 41

def hwinfo
  @hwinfo
end

#kubernetesObject (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.



41
42
43
# File 'lib/atatus/metadata/system_info.rb', line 41

def kubernetes
  @kubernetes
end

#osinfoObject (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.



41
42
43
# File 'lib/atatus/metadata/system_info.rb', line 41

def osinfo
  @osinfo
end

#platformObject (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.



41
42
43
# File 'lib/atatus/metadata/system_info.rb', line 41

def platform
  @platform
end

Instance Method Details

#gem_platformObject

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.



53
54
55
# File 'lib/atatus/metadata/system_info.rb', line 53

def gem_platform
  @gem_platform ||= Gem::Platform.local
end