lib/upperkut/strategy.rb in upperkut-0.1.3 vs lib/upperkut/strategy.rb in upperkut-0.1.4
- old
+ new
@@ -32,15 +32,14 @@
def size
redis.llen(key)
end
def latency
- item = redis.lrange(key, -1, -1)
+ item = redis.lrange(key, 0, 0)
item = decode_json_items(item).first
return 0 unless item
now = Time.now.to_f
- lat = now - item.fetch('enqueued_at', Time.now).to_f
- lat
+ now - item.fetch('enqueued_at', Time.now).to_f
end
def clear
redis.del(key)
end