Sha256: 13023d6b47fd4d0ac3a714c307dcd62cad1386c7cb819e0b0198913eb131e277

Contents?: true

Size: 807 Bytes

Versions: 18

Compression:

Stored size: 807 Bytes

Contents

module Gris
  class Identity
    def self.health
      {
        name: name,
        base_url: base_url,
        hostname: hostname,
        revision: revision,
        pid: pid,
        parent_pid: parent_pid,
        platform: platform
      }
    end

    def self.name
      Gris.secrets.service_name
    end

    def self.base_url
      Gris.secrets.base_url
    end

    def self.hostname
      @hostname ||= `hostname`.strip
    end

    def self.revision
      @revision ||= `git rev-parse HEAD`.strip
    end

    def self.pid
      @pid ||= Process.pid
    end

    def self.parent_pid
      @ppid ||= Process.ppid
    end

    def self.platform
      {
        version: platform_revision,
        name: 'Gris'
      }
    end

    def self.platform_revision
      Gris::VERSION
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
gris-0.4.9 lib/gris/identity.rb
gris-0.4.8 lib/gris/identity.rb
gris-0.4.7 lib/gris/identity.rb
gris-0.4.6 lib/gris/identity.rb
gris-0.4.5 lib/gris/identity.rb
gris-0.4.4 lib/gris/identity.rb
gris-0.4.3 lib/gris/identity.rb
gris-0.4.2 lib/gris/identity.rb
gris-0.4.0 lib/gris/identity.rb
gris-0.3.9 lib/gris/identity.rb
gris-0.3.8 lib/gris/identity.rb
gris-0.3.7 lib/gris/identity.rb
gris-0.3.6 lib/gris/identity.rb
gris-0.3.4 lib/gris/identity.rb
gris-0.3.3 lib/gris/identity.rb
gris-0.3.2 lib/gris/identity.rb
gris-0.3.1 lib/gris/identity.rb
gris-0.3.0 lib/gris/identity.rb