From da5c0fd20160ab90219df4cd21f8f61fd79ebb7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Sat, 2 Dec 2023 17:15:13 -1000 Subject: [PATCH] Pet rubocop --- lib/riemann/tools.rb | 2 +- lib/riemann/tools/bench.rb | 2 +- lib/riemann/tools/net.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/riemann/tools.rb b/lib/riemann/tools.rb index 2cd138cf..c7574461 100644 --- a/lib/riemann/tools.rb +++ b/lib/riemann/tools.rb @@ -63,7 +63,7 @@ def report(event) event[:tags] = [*event.fetch(:tags, [])] + options[:tag].map(&:dup) end - event[:ttl] ||= (options[:ttl] || (options[:interval] * 2)) + event[:ttl] ||= options[:ttl] || (options[:interval] * 2) event[:host] = options[:event_host].dup if options[:event_host] diff --git a/lib/riemann/tools/bench.rb b/lib/riemann/tools/bench.rb index 4e371531..6e27d798 100644 --- a/lib/riemann/tools/bench.rb +++ b/lib/riemann/tools/bench.rb @@ -15,7 +15,7 @@ def initialize @hosts = %w[a b c d e f g h i j] @services = %w[test1 test2 test3 foo bar baz xyzzy attack cat treat] @states = {} - @client = Riemann::Client.new(host: (ARGV.first || 'localhost')) + @client = Riemann::Client.new(host: ARGV.first || 'localhost') end def evolve(state) diff --git a/lib/riemann/tools/net.rb b/lib/riemann/tools/net.rb index 38b406b3..3fd92120 100644 --- a/lib/riemann/tools/net.rb +++ b/lib/riemann/tools/net.rb @@ -108,7 +108,7 @@ def tick if @old_state # Report services from `@old_state` that don't exist in `state` as expired - @old_state.reject { |k| state.key?(k) }.each do |service, _metric| + @old_state.reject { |k| state.key?(k) }.each_key do |service| report(service: service.dup, state: 'expired') end