From 8d34ddd0a30acf59d423bac773ac2d63aafc7044 Mon Sep 17 00:00:00 2001 From: Nat Lasseter Date: Mon, 2 Mar 2020 14:58:28 +0000 Subject: Added readme, tidied some things --- lib/longboat/collector.rb | 2 +- lib/longboat/jobs.rb | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/longboat') diff --git a/lib/longboat/collector.rb b/lib/longboat/collector.rb index adb20c3..c812b05 100644 --- a/lib/longboat/collector.rb +++ b/lib/longboat/collector.rb @@ -9,7 +9,7 @@ module Longboat @metrics[name][labels] = {value: value, timestamp: timestamp} end - def metrics + def prometheus_metrics res = "" @metrics.each do |name, metric| res << "#HELP #{name} #{metric[:help]}\n" unless metric[:help].nil? diff --git a/lib/longboat/jobs.rb b/lib/longboat/jobs.rb index 155b305..c6bbb17 100644 --- a/lib/longboat/jobs.rb +++ b/lib/longboat/jobs.rb @@ -17,9 +17,7 @@ module Longboat end def collect! - @jobs.each do |job| - job.run - end + @jobs.each(&:run) end def collect_every(time = 60, async = true) -- cgit v1.2.1