#!/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) unless ARGV.empty? puts "Extraneous or unrecognised arguments:" puts " " + ARGV.join(" ") puts "Try --help, or refer to raider documentation." exit 1 end 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