Class: GroongaQueryLog::Command::ShowRunningQueries

Inherits:
Object
  • Object
show all
Defined in:
lib/groonga-query-log/command/show-running-queries.rb

Instance Method Summary collapse

Constructor Details

#initializeShowRunningQueries

Returns a new instance of ShowRunningQueries.



26
27
28
# File 'lib/groonga-query-log/command/show-running-queries.rb', line 26

def initialize
  @base_time = nil
end

Instance Method Details

#run(command_line) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/groonga-query-log/command/show-running-queries.rb', line 30

def run(command_line)
  input_paths = create_parser.parse(command_line)
  each_parsing_statistic(input_paths) do |statistic|
    timestamp = statistic.start_time.strftime("%Y-%m-%d %H:%M:%S.%6N")
    puts("#{timestamp}:#{statistic.raw_command}")
  end
  true
end