Class: Flydata::Parser::Mysql::MysqlDumpParser::InsertParser
- Inherits:
-
Object
- Object
- Flydata::Parser::Mysql::MysqlDumpParser::InsertParser
- Defined in:
- lib/flydata/parser/mysql/dump_parser.rb
Overview
Parse the insert line containing multiple values. (max line size is 1kb)
ex) INSERT INTO `data_entries` VALUES (2,2,'access_log'), (2,3,'access_log2');
Instance Method Summary collapse
- #parse(line) ⇒ Object
-
#start_ruby_prof ⇒ Object
INSERT INTO ‘data_entries` VALUES (2,2,’access_log’), (2,3,‘access_log2’);.
- #stop_ruby_prof ⇒ Object
Instance Method Details
#parse(line) ⇒ Object
445 446 447 448 449 450 451 452 453 454 |
# File 'lib/flydata/parser/mysql/dump_parser.rb', line 445 def parse(line) start_ruby_prof bench_start_time = Time.now _parse(line) ensure stop_ruby_prof if ENV['FLYDATA_BENCHMARK'] puts " -> time:#{Time.now.to_f - bench_start_time.to_f} size:#{target_line.size}" end end |
#start_ruby_prof ⇒ Object
INSERT INTO ‘data_entries` VALUES (2,2,’access_log’), (2,3,‘access_log2’);
431 432 433 |
# File 'lib/flydata/parser/mysql/dump_parser.rb', line 431 def start_ruby_prof RubyProf.start if defined?(RubyProf) and not RubyProf.running? end |
#stop_ruby_prof ⇒ Object
435 436 437 438 439 440 441 442 443 |
# File 'lib/flydata/parser/mysql/dump_parser.rb', line 435 def stop_ruby_prof if defined?(RubyProf) and RubyProf.running? result = RubyProf.stop #printer = RubyProf::GraphPrinter.new(result) printer = RubyProf::GraphHtmlPrinter.new(result) #printer.print(STDOUT) printer.print(File.new("ruby-prof-out-#{Time.now.to_i}.html", "w"), :min_percent => 3) end end |