Module: Datadog::Core::Environment::Platform
- Defined in:
- lib/datadog/core/environment/platform.rb
Overview
For gathering information about the platform
Class Method Summary collapse
-
.architecture ⇒ String
ISA of host; ‘uname -m`.
-
.hostname ⇒ String
Name of host; ‘uname -n`.
-
.kernel_name ⇒ String
System name, normally ‘Linux` or `Darwin` (but ’Mac OS X’ on JRuby);.
-
.kernel_release ⇒ String
Kernel release; ‘uname -r`.
-
.kernel_version ⇒ String
Kernel version; ‘uname -v`.
Class Method Details
.architecture ⇒ String
Returns ISA of host; ‘uname -m`.
13 14 15 |
# File 'lib/datadog/core/environment/platform.rb', line 13 def architecture Identity.lang_version >= '2.2' ? Etc.uname[:machine] : Gem::Platform.local.cpu end |
.hostname ⇒ String
Returns name of host; ‘uname -n`.
18 19 20 |
# File 'lib/datadog/core/environment/platform.rb', line 18 def hostname Identity.lang_version >= '2.2' ? Etc.uname[:nodename] : nil end |
.kernel_name ⇒ String
System name, normally ‘Linux` or `Darwin` (but ’Mac OS X’ on JRuby);
24 25 26 |
# File 'lib/datadog/core/environment/platform.rb', line 24 def kernel_name Identity.lang_version >= '2.2' ? Etc.uname[:sysname] : Gem::Platform.local.os.capitalize end |
.kernel_release ⇒ String
Returns kernel release; ‘uname -r`.
29 30 31 32 33 34 35 |
# File 'lib/datadog/core/environment/platform.rb', line 29 def kernel_release if Identity.lang_engine == 'jruby' Etc.uname[:version] # Java's `os.version` maps to `uname -r` elsif Identity.lang_version >= '2.2' Etc.uname[:release] end end |
.kernel_version ⇒ String
Returns kernel version; ‘uname -v`.
38 39 40 |
# File 'lib/datadog/core/environment/platform.rb', line 38 def kernel_version Etc.uname[:version] if Identity.lang_engine != 'jruby' && Identity.lang_version >= '2.2' end |