aboutsummaryrefslogtreecommitdiff
path: root/lib/longboat/config.rb
diff options
context:
space:
mode:
authorNat Lasseter <nat.lasseter@york.ac.uk>2020-03-03 14:25:32 +0000
committerNat Lasseter <nat.lasseter@york.ac.uk>2020-03-03 14:25:32 +0000
commitab6e28417a9195fe03b8355a808a81276d0435ff (patch)
tree3bf903f2dea07ac27b7de2168e76182ce0974a0c /lib/longboat/config.rb
parent220ebc31c057bbf47eec1cccbbae8b3cf2190d24 (diff)
Added command line config
Diffstat (limited to 'lib/longboat/config.rb')
-rw-r--r--lib/longboat/config.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/longboat/config.rb b/lib/longboat/config.rb
new file mode 100644
index 0000000..874a5be
--- /dev/null
+++ b/lib/longboat/config.rb
@@ -0,0 +1,16 @@
+require 'optimist'
+
+module Longboat
+ module Config
+ def self.parse!
+ Optimist::options do
+ # Collection interval
+ opt :collect_every, "Collection interval", type: Integer, default: 60
+
+ # Sinatra server
+ opt :server_bind, "Server listening address", type: String, default: "127.0.0.1:8564"
+ opt :server_path, "Path to metrics", type: String, default: "/metrics"
+ end
+ end
+ end
+end