Skip to content
This repository has been archived by the owner on Apr 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #23 from gabriel376/monotonic-clock
Browse files Browse the repository at this point in the history
Use monotonic clock
  • Loading branch information
ferreira-mev authored May 25, 2022
2 parents d5afa76 + 0365616 commit 2822b96
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/pipefy_message/consumer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def build_consumer_instance
# from which the call to process_message was made (see perform
# method in the parent module).
def process_message
start = Time.now
start = Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
obj = new

logger.info({ message_text: "Calling consumer poller" })
Expand All @@ -79,9 +79,9 @@ def process_message

obj.perform(payload["Message"])

elapsed_time = (Time.now - start) * 1000.0
elapsed_time_ms = Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond) - start
logger.info({
duration_ms: elapsed_time,
duration_ms: elapsed_time_ms,
message_text: "Message received by consumer poller, processed " \
"in #{elapsed_time} milliseconds"
})
Expand Down

0 comments on commit 2822b96

Please sign in to comment.