Module: Appsignal::CheckIn
- Defined in:
- lib/appsignal/check_in.rb,
lib/appsignal/check_in/cron.rb,
lib/appsignal/check_in/scheduler.rb
Defined Under Namespace
Class Method Summary collapse
-
.cron(identifier) { ... } ⇒ void
Track cron check-ins.
- .scheduler ⇒ Object private
- .stop ⇒ Object private
- .transmitter ⇒ Object private
Class Method Details
.cron(identifier) { ... } ⇒ void
This method returns an undefined value.
Track cron check-ins.
Track the execution of certain processes by sending a cron check-in.
To track the duration of a piece of code, pass a block to cron to report both when the process starts, and when it finishes.
If an exception is raised within the block, the finish event will not be reported, triggering a notification about the missing cron check-in. The exception will bubble outside of the cron check-in block.
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/appsignal/check_in.rb', line 30 def cron(identifier) cron = Appsignal::CheckIn::Cron.new(:identifier => identifier) output = nil if block_given? cron.start output = yield end cron.finish output end |
.scheduler ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
51 52 53 |
# File 'lib/appsignal/check_in.rb', line 51 def scheduler @scheduler ||= Scheduler.new end |
.stop ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
56 57 58 |
# File 'lib/appsignal/check_in.rb', line 56 def stop scheduler&.stop end |
.transmitter ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
44 45 46 47 48 |
# File 'lib/appsignal/check_in.rb', line 44 def transmitter @transmitter ||= Transmitter.new( "#{Appsignal.config[:logging_endpoint]}/check_ins/json" ) end |