Module: Sentry::Metrics::Timing
- Defined in:
- lib/sentry/metrics/timing.rb
Class Method Summary collapse
- .day ⇒ Object
- .hour ⇒ Object
- .microsecond ⇒ Object
- .millisecond ⇒ Object
- .minute ⇒ Object
- .nanosecond ⇒ Object
- .second ⇒ Object
- .week ⇒ Object
Class Method Details
.day ⇒ Object
33 34 35 |
# File 'lib/sentry/metrics/timing.rb', line 33 def day Sentry.utc_now.to_i / (3600.0 * 24.0) end |
.hour ⇒ Object
29 30 31 |
# File 'lib/sentry/metrics/timing.rb', line 29 def hour Sentry.utc_now.to_i / 3600.0 end |
.microsecond ⇒ Object
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 |
.millisecond ⇒ Object
17 18 19 |
# File 'lib/sentry/metrics/timing.rb', line 17 def millisecond Sentry.utc_now.to_i * (10 ** 3) end |
.minute ⇒ Object
25 26 27 |
# File 'lib/sentry/metrics/timing.rb', line 25 def minute Sentry.utc_now.to_i / 60.0 end |
.nanosecond ⇒ Object
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 |
.second ⇒ Object
21 22 23 |
# File 'lib/sentry/metrics/timing.rb', line 21 def second Sentry.utc_now.to_i end |
.week ⇒ Object
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 |