Sha256: 992b542fd991a67fb4cd36358ad8ec41d2d205c12311b632bcbf32caa9568069

Contents?: true

Size: 575 Bytes

Versions: 22

Compression:

Stored size: 575 Bytes

Contents

# frozen_string_literal: true

module ElasticAPM
  # @api private
  module Util
    def self.nearest_minute(target = Time.now.utc)
      target - target.to_i % 60
    end

    def self.micros(target = Time.now.utc)
      target.to_i * 1_000_000 + target.usec
    end

    def self.inspect_transaction(transaction)
      Inspector.new.transaction transaction
    end

    def self.git_sha
      sha = `git rev-parse --verify HEAD 2>&1`.chomp
      $? && $?.success? ? sha : nil # rubocop:disable Style/SpecialGlobalVars
    end
  end
end

require 'elastic_apm/util/inspector'

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
elastic-apm-1.1.0 lib/elastic_apm/util.rb
elastic-apm-1.0.2 lib/elastic_apm/util.rb
elastic-apm-1.0.1 lib/elastic_apm/util.rb
elastic-apm-1.0.0 lib/elastic_apm/util.rb
elastic-apm-1.0.0.beta2 lib/elastic_apm/util.rb
elastic-apm-1.0.0.beta1 lib/elastic_apm/util.rb
elastic-apm-0.8.0 lib/elastic_apm/util.rb
elastic-apm-0.7.4 lib/elastic_apm/util.rb
elastic-apm-0.7.3 lib/elastic_apm/util.rb
elastic-apm-0.7.2 lib/elastic_apm/util.rb
elastic-apm-0.7.1 lib/elastic_apm/util.rb
elastic-apm-0.7.0 lib/elastic_apm/util.rb
elastic-apm-0.6.2 lib/elastic_apm/util.rb
elastic-apm-0.6.1 lib/elastic_apm/util.rb
elastic-apm-0.5.1 lib/elastic_apm/util.rb
elastic-apm-0.5.0 lib/elastic_apm/util.rb
elastic-apm-0.4.5 lib/elastic_apm/util.rb
elastic-apm-0.4.4 lib/elastic_apm/util.rb
elastic-apm-0.4.3 lib/elastic_apm/util.rb
elastic-apm-0.4.2 lib/elastic_apm/util.rb