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`.
15 16 17 |
# File 'lib/datadog/core/environment/platform.rb', line 15 def architecture Identity.lang_version >= '2.2' ? Etc.uname[:machine] : Gem::Platform.local.cpu end |
.hostname ⇒ String
Returns name of host; ‘uname -n`.
20 21 22 |
# File 'lib/datadog/core/environment/platform.rb', line 20 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);
26 27 28 |
# File 'lib/datadog/core/environment/platform.rb', line 26 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`.
31 32 33 34 35 36 37 |
# File 'lib/datadog/core/environment/platform.rb', line 31 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`.
40 41 42 |
# File 'lib/datadog/core/environment/platform.rb', line 40 def kernel_version Etc.uname[:version] if Identity.lang_engine != 'jruby' && Identity.lang_version >= '2.2' end |