mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
hand-code. This method is as fast as the hand-coded method and with less writing. - Make message registration easier with a simple 'register' function: class Foo < Message register end We dynamically generate the message 'type' by the class name.
26 lines
534 B
Ruby
26 lines
534 B
Ruby
#!/usr/bin/env ruby
|
|
|
|
require 'rubygems'
|
|
require 'lib/net/servers/indexer'
|
|
|
|
if ENV.has_key?("PROFILE")
|
|
require 'ruby-prof'
|
|
RubyProf.start
|
|
|
|
#class String
|
|
#alias_method :orig_scan, :scan
|
|
#def scan(*args)
|
|
##raise
|
|
#return orig_scan(*args)
|
|
#end
|
|
#end
|
|
end
|
|
Thread::abort_on_exception = true
|
|
s = LogStash::Net::Servers::Indexer.new(username='', password='', host="localhost")
|
|
s.run
|
|
|
|
if ENV.has_key?("PROFILE")
|
|
result = RubyProf.stop
|
|
printer = RubyProf::FlatPrinter.new(result)
|
|
printer.print(STDOUT, 0)
|
|
end
|