Sha256: 19207f4a044a413d0290839d61a07c7cd758e5ef050101739cb6aaacd852fd1d

Contents?: true

Size: 463 Bytes

Versions: 13

Compression:

Stored size: 463 Bytes

Contents

module Timber
  module Contexts
    # Tracks OS level process information, such as the process ID.
    class System < Context
      @keyspace = :system

      attr_reader :hostname, :pid

      def initialize(attributes)
        @hostname = attributes[:hostname]
        @pid = attributes[:pid]
        @pid = @pid.to_s
      end

      def as_json(_options = {})
        {hostname: hostname, pid: Timber::Util::Object.try(pid, :to_s)}
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
timber-2.0.24 lib/timber/contexts/system.rb
timber-2.0.23 lib/timber/contexts/system.rb
timber-2.0.22 lib/timber/contexts/system.rb
timber-2.0.21 lib/timber/contexts/system.rb
timber-2.0.20 lib/timber/contexts/system.rb
timber-2.0.19 lib/timber/contexts/system.rb
timber-2.0.17 lib/timber/contexts/system.rb
timber-2.0.16 lib/timber/contexts/system.rb
timber-2.0.15 lib/timber/contexts/system.rb
timber-2.0.14 lib/timber/contexts/system.rb
timber-2.0.12 lib/timber/contexts/system.rb
timber-2.0.11 lib/timber/contexts/system.rb
timber-2.0.10 lib/timber/contexts/system.rb