Yoji Shidara
null+****@clear*****
Thu Dec 19 14:57:52 JST 2013
Yoji Shidara 2013-12-19 14:57:52 +0900 (Thu, 19 Dec 2013) New Revision: 8a486d957b4f9a708aa8bb7d20e30ff8fb56265c https://github.com/droonga/fluent-plugin-droonga/commit/8a486d957b4f9a708aa8bb7d20e30ff8fb56265c Merged ce62e72: Merge branch 'refactor-searcher' Message: Store end_time in QuerySearcher ResultFormatter should just format Modified files: lib/droonga/searcher.rb Modified: lib/droonga/searcher.rb (+5 -2) =================================================================== --- lib/droonga/searcher.rb 2013-12-19 14:52:37 +0900 (74626a7) +++ lib/droonga/searcher.rb 2013-12-19 14:57:52 +0900 (bb500e0) @@ -123,6 +123,7 @@ module Droonga @result = search_result @records =****@resul***** @start_time =****@resul*****_time + @end_time =****@resul*****_time @count =****@resul***** @condition =****@resul***** end @@ -136,7 +137,7 @@ module Droonga formatted_result["startTime"] = @start_time.iso8601 end if need_element_output?("elapsedTime") - formatted_result["elapsedTime"] = Time.now.to_f - @start_time.to_f + formatted_result["elapsedTime"] = @end_time.to_f - @start_time.to_f end formatted_result end @@ -293,10 +294,11 @@ module Droonga end class SearchResult - attr_accessor :start_time, :condition, :records, :count + attr_accessor :start_time, :end_time, :condition, :records, :count def initialize @start_time = nil + @end_time = nil @condition = nil @records = nil @count = nil @@ -422,6 +424,7 @@ module Droonga $log.trace("#{log_tag}: search_query: done") @result.records = @records + @result.end_time = Time.now end def apply_condition!(condition) -------------- next part -------------- HTML����������������������������...Download