diff options
author | Nat Lasseter <nat.lasseter@york.ac.uk> | 2020-03-02 14:58:28 +0000 |
---|---|---|
committer | Nat Lasseter <nat.lasseter@york.ac.uk> | 2020-03-02 14:58:28 +0000 |
commit | 8d34ddd0a30acf59d423bac773ac2d63aafc7044 (patch) | |
tree | b9e814523ff194d0b4304ad07eb461bb5548aa98 /lib/longboat | |
parent | 7b83ef5b7078bdb46f45074b5a2f96a1483e8202 (diff) |
Added readme, tidied some things
Diffstat (limited to 'lib/longboat')
-rw-r--r-- | lib/longboat/collector.rb | 2 | ||||
-rw-r--r-- | lib/longboat/jobs.rb | 4 |
2 files changed, 2 insertions, 4 deletions
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) |