Class: NatsWork::Middleware::Timer
- Inherits:
-
Object
- Object
- NatsWork::Middleware::Timer
- Defined in:
- lib/natswork/middleware.rb
Instance Method Summary collapse
Instance Method Details
#call(_job, message) ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/natswork/middleware.rb', line 85 def call(_job, ) started_at = Time.now result = yield completed_at = Time.now ['started_at'] = started_at.iso8601 ['completed_at'] = completed_at.iso8601 ['execution_time'] = completed_at - started_at result end |