Skip to content
Browse files

Adds a 'search' option to the collector for debugging

  • Loading branch information...
1 parent e71c96d commit 2459ed453f6d582d59fe165a94c07ea683c690f0 @gtrogers gtrogers committed
Showing with 12 additions and 1 deletion.
  1. +12 −1 bin/collector
View
13 bin/collector
@@ -10,7 +10,7 @@
require 'bundler/setup'
Bundler.require
-Dir[File.expand_path(File.join(File.dirname(__FILE__), "../lib/**/*.rb"))].each {|f| require f}
+Dir[File.expand_path(File.join(File.dirname(__FILE__), "../lib/**/*.rb"))].each { |f| require f }
include GLI
@@ -71,6 +71,17 @@ command :print do |c|
end
end
+command :search do |c|
+ c.desc "Search the collected messages for a given string"
+ c.action do |global_options, options, args|
+ collector(global_options).collect_as_json.each { |m|
+ if args.any? { |arg| m.include?(arg) }
+ puts m
+ end
+ }
+ end
+end
+
command :broadcast do |c|
c.desc "Publish the collected statistics to the queue"

0 comments on commit 2459ed4

Please sign in to comment.
Something went wrong with that request. Please try again.