lib/hornetq/client/message_handler.rb in jruby-hornetq-0.2.5.alpha vs lib/hornetq/client/message_handler.rb in jruby-hornetq-0.3.0.alpha

- old
+ new

@@ -10,14 +10,14 @@ # and the time it took to process them. # The timer starts when the listener instance is created and finishes when either the last message was received, # or when Consumer::on_message_statistics is called. In this case on_message_statistics::statistics # can be called several times during processing without affecting the end time. # The start time and message count is never reset for this instance - def initialize(parms={}, &proc) + def initialize(params={}, &proc) @proc = proc - if parms[:statistics] + if params[:statistics] @message_count = 0 @start_time = Time.now end end @@ -52,10 +52,10 @@ # since the timer start immediately and stops on the last message received def statistics raise "First call Consumer::on_message with :statistics=>true before calling MessageConsumer::statistics()" unless @message_count duration =(@last_time || Time.now) - @start_time { - :messages => @message_count, + :count => @message_count, :duration => duration, :messages_per_second => (@message_count/duration).to_i } end end \ No newline at end of file