Module: Sentry::Metrics::Timing

Defined in:
lib/sentry/metrics/timing.rb

Class Method Summary collapse

Class Method Details

.dayObject



33
34
35
# File 'lib/sentry/metrics/timing.rb', line 33

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

.hourObject



29
30
31
# File 'lib/sentry/metrics/timing.rb', line 29

def hour
  Sentry.utc_now.to_i / 3600.0
end

.microsecondObject



12
13
14
15
# File 'lib/sentry/metrics/timing.rb', line 12

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

.millisecondObject



17
18
19
# File 'lib/sentry/metrics/timing.rb', line 17

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

.minuteObject



25
26
27
# File 'lib/sentry/metrics/timing.rb', line 25

def minute
  Sentry.utc_now.to_i / 60.0
end

.nanosecondObject



7
8
9
10
# File 'lib/sentry/metrics/timing.rb', line 7

def nanosecond
  time = Sentry.utc_now
  time.to_i * (10 ** 9) + time.nsec
end

.secondObject



21
22
23
# File 'lib/sentry/metrics/timing.rb', line 21

def second
  Sentry.utc_now.to_i
end

.weekObject



37
38
39
# File 'lib/sentry/metrics/timing.rb', line 37

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