Sha256: f5c7a1ede2077dbf58a5209f60b6296635c8fd94712fb2de7a074d1264fe49d7

Contents?: true

Size: 792 Bytes

Versions: 26

Compression:

Stored size: 792 Bytes

Contents

# frozen_string_literal: true

module Sentry
  module Metrics
    module Timing
      class << self
        def nanosecond
          time = Sentry.utc_now
          time.to_i * (10 ** 9) + time.nsec
        end

        def microsecond
          time = Sentry.utc_now
          time.to_i * (10 ** 6) + time.usec
        end

        def millisecond
          Sentry.utc_now.to_i * (10 ** 3)
        end

        def second
          Sentry.utc_now.to_i
        end

        def minute
          Sentry.utc_now.to_i / 60.0
        end

        def hour
          Sentry.utc_now.to_i / 3600.0
        end

        def day
          Sentry.utc_now.to_i / (3600.0 * 24.0)
        end

        def week
          Sentry.utc_now.to_i / (3600.0 * 24.0 * 7.0)
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
sentry-ruby-core-5.22.1 lib/sentry/metrics/timing.rb
sentry-ruby-5.22.1 lib/sentry/metrics/timing.rb
sentry-ruby-5.22.0 lib/sentry/metrics/timing.rb
sentry-ruby-core-5.22.0 lib/sentry/metrics/timing.rb
sentry-ruby-5.21.0 lib/sentry/metrics/timing.rb
sentry-ruby-core-5.21.0 lib/sentry/metrics/timing.rb
sentry-ruby-5.20.1 lib/sentry/metrics/timing.rb
sentry-ruby-core-5.20.1 lib/sentry/metrics/timing.rb
sentry-ruby-5.20.0 lib/sentry/metrics/timing.rb
sentry-ruby-core-5.20.0 lib/sentry/metrics/timing.rb
sentry-ruby-core-5.19.0 lib/sentry/metrics/timing.rb
sentry-ruby-5.19.0 lib/sentry/metrics/timing.rb
sentry-ruby-core-5.18.2 lib/sentry/metrics/timing.rb
sentry-ruby-5.18.2 lib/sentry/metrics/timing.rb
sentry-ruby-core-5.18.1 lib/sentry/metrics/timing.rb
sentry-ruby-5.18.1 lib/sentry/metrics/timing.rb
sentry-ruby-5.18.0 lib/sentry/metrics/timing.rb
sentry-ruby-core-5.18.0 lib/sentry/metrics/timing.rb
sentry-ruby-core-5.17.3 lib/sentry/metrics/timing.rb
sentry-ruby-5.17.3 lib/sentry/metrics/timing.rb