Skip to content
Snippets Groups Projects
Commit fd49cdb7 authored by John Harris's avatar John Harris
Browse files

fix: add metrics delegate for timing

parent ff1c8cb8
No related branches found
Tags 1.7.3
No related merge requests found
Pipeline #34562 passed
......@@ -13,8 +13,18 @@ module NexusSemanticLogger
statsd&.flush(sync: Rails.env.development?) # Force flush sync in development, speed up checks.
end
def increment(metric_name)
statsd&.increment(metric_name, tags: tags)
# Delegate to statsd (if available).
# @param [String] metric Metric name.
def increment(metric)
statsd&.increment(metric, tags: tags)
flush
end
# Delegate to statsd (if available).
# @param [String] metric Metric name.
# @param [Integer] ms Timing in milliseconds.
def timing(metric, ms)
statsd&.timing(metric, ms, tags: tags)
flush
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment