Sha256: d14adbb78cae389c4f7b8a1e33c6c379a2a759ff26ad13dcd6b0f97cda8be7e7

Contents?: true

Size: 517 Bytes

Versions: 2

Compression:

Stored size: 517 Bytes

Contents

# frozen_string_literal: true

module ElasticAPM
  module Metadata
    # @api private
    class SystemInfo
      def initialize(config)
        @config = config
      end

      def build
        {
          hostname: @config.hostname || `hostname`.chomp,
          architecture: platform.cpu,
          platform: platform.os
        }
      end

      def self.build(config)
        new(config).build
      end

      private

      def platform
        @platform ||= Gem::Platform.local
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
elastic-apm-2.0.1 lib/elastic_apm/metadata/system_info.rb
elastic-apm-2.0.0 lib/elastic_apm/metadata/system_info.rb