blob: 658ec27b13178d79daed81113ee6c916e7446e08 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#!/usr/bin/env ruby
$LOAD_PATH << './lib'
require 'longboat'
# Handle command line options
config = Longboat::Config.parse!
# Start collection
collector = Longboat::Collector.new(config)
raiders = Longboat::Raiders.new(collector, config)
if config.test
# We're in test mode, output metrics to stdout once and quit
raiders.raid!
puts collector.prometheus_metrics
else
# Serve metrics on HTTP forever
raiders.raid_every
Longboat::Server.serve!(collector, config)
end
|