Class: Napa::Identity
- Inherits:
-
Object
- Object
- Napa::Identity
- Defined in:
- lib/napa/identity.rb
Class Method Summary collapse
- .health ⇒ Object
- .hostname ⇒ Object
- .name ⇒ Object
- .parent_pid ⇒ Object
- .pid ⇒ Object
- .platform ⇒ Object
- .platform_revision ⇒ Object
- .revision ⇒ Object
Class Method Details
.health ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/napa/identity.rb', line 3 def self.health { name: name, hostname: hostname, revision: revision, pid: pid, parent_pid: parent_pid, platform: platform } end |
.hostname ⇒ Object
18 19 20 |
# File 'lib/napa/identity.rb', line 18 def self.hostname @hostname ||= `hostname`.strip end |
.name ⇒ Object
14 15 16 |
# File 'lib/napa/identity.rb', line 14 def self.name ENV['SERVICE_NAME'] || 'api-service' end |
.parent_pid ⇒ Object
30 31 32 |
# File 'lib/napa/identity.rb', line 30 def self.parent_pid @ppid ||= Process.ppid end |
.pid ⇒ Object
26 27 28 |
# File 'lib/napa/identity.rb', line 26 def self.pid @pid ||= Process.pid end |
.platform ⇒ Object
34 35 36 37 38 39 |
# File 'lib/napa/identity.rb', line 34 def self.platform { version: platform_revision, name: "Napa" } end |
.platform_revision ⇒ Object
41 42 43 |
# File 'lib/napa/identity.rb', line 41 def self.platform_revision Napa::VERSION end |
.revision ⇒ Object
22 23 24 |
# File 'lib/napa/identity.rb', line 22 def self.revision @revision ||= `git rev-parse HEAD`.strip end |