Skip to content

Commit

Permalink
Use TimeTracker in LibratoMetrics reporter to avoid drift
Browse files Browse the repository at this point in the history
  • Loading branch information
brynary authored and lmarburger committed Jun 28, 2012
1 parent 8a145a5 commit 2935af9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/metriks/reporter/librato_metrics.rb
Expand Up @@ -12,14 +12,14 @@ def initialize(email, token, options = {})
@source = options[:source]

@registry = options[:registry] || Metriks::Registry.default
@interval = options[:interval] || 60
@time_tracker = Metriks::TimeTracker.new(options[:interval] || 60)
@on_error = options[:on_error] || proc { |ex| }
end

def start
@thread ||= Thread.new do
loop do
sleep @interval
@time_tracker.sleep

Thread.new do
begin
Expand Down

0 comments on commit 2935af9

Please sign in to comment.