equal
deleted
inserted
replaced
270 |
270 |
271 /* parse various formats */ |
271 /* parse various formats */ |
272 |
272 |
273 def parse_meta_info(): Meta_Info = Build_Log.parse_meta_info(log_file) |
273 def parse_meta_info(): Meta_Info = Build_Log.parse_meta_info(log_file) |
274 |
274 |
275 def parse_build_info(): Build_Info = Build_Log.parse_build_info(log_file) |
275 def parse_build_info(ml_statistics: Boolean = false): Build_Info = |
|
276 Build_Log.parse_build_info(log_file, ml_statistics) |
276 |
277 |
277 def parse_session_info( |
278 def parse_session_info( |
278 command_timings: Boolean = false, |
279 command_timings: Boolean = false, |
279 ml_statistics: Boolean = false, |
280 ml_statistics: Boolean = false, |
280 task_statistics: Boolean = false): Session_Info = |
281 task_statistics: Boolean = false): Session_Info = |
496 def ml_timing(name: String): Timing = get_default(name, _.ml_timing, Timing.zero) |
497 def ml_timing(name: String): Timing = get_default(name, _.ml_timing, Timing.zero) |
497 def ml_statistics(name: String): ML_Statistics = |
498 def ml_statistics(name: String): ML_Statistics = |
498 get_default(name, entry => ML_Statistics(name, entry.ml_statistics), ML_Statistics.empty) |
499 get_default(name, entry => ML_Statistics(name, entry.ml_statistics), ML_Statistics.empty) |
499 } |
500 } |
500 |
501 |
501 private def parse_build_info(log_file: Log_File): Build_Info = |
502 private def parse_build_info(log_file: Log_File, parse_ml_statistics: Boolean): Build_Info = |
502 { |
503 { |
503 object Chapter_Name |
504 object Chapter_Name |
504 { |
505 { |
505 def unapply(s: String): Some[(String, String)] = |
506 def unapply(s: String): Some[(String, String)] = |
506 space_explode('/', s) match { |
507 space_explode('/', s) match { |
572 threads += (name -> t) |
573 threads += (name -> t) |
573 |
574 |
574 case Heap(name, Value.Long(size)) => |
575 case Heap(name, Value.Long(size)) => |
575 heap_sizes += (name -> size) |
576 heap_sizes += (name -> size) |
576 |
577 |
577 case _ if line.startsWith(ML_STATISTICS_MARKER) && YXML.detect(line) => |
578 case _ |
|
579 if parse_ml_statistics && line.startsWith(ML_STATISTICS_MARKER) && YXML.detect(line) => |
578 val (name, props) = |
580 val (name, props) = |
579 Library.try_unprefix(ML_STATISTICS_MARKER, line).map(log_file.parse_props(_)) match { |
581 Library.try_unprefix(ML_STATISTICS_MARKER, line).map(log_file.parse_props(_)) match { |
580 case Some((SESSION_NAME, session_name) :: props) => (session_name, props) |
582 case Some((SESSION_NAME, session_name) :: props) => (session_name, props) |
581 case _ => log_file.err("malformed ML_statistics " + quote(line)) |
583 case _ => log_file.err("malformed ML_statistics " + quote(line)) |
582 } |
584 } |
713 } |
715 } |
714 } |
716 } |
715 |
717 |
716 def update_ml_statistics(db: SQL.Database, log_file: Log_File) |
718 def update_ml_statistics(db: SQL.Database, log_file: Log_File) |
717 { |
719 { |
718 val build_info = log_file.parse_build_info() |
720 val build_info = log_file.parse_build_info(ml_statistics = true) |
719 val table = Build_Info.ml_statistics_table |
721 val table = Build_Info.ml_statistics_table |
720 |
722 |
721 db.transaction { |
723 db.transaction { |
722 using(db.delete(table, Meta_Info.log_name.sql_where_equal(log_file.name)))(_.execute) |
724 using(db.delete(table, Meta_Info.log_name.sql_where_equal(log_file.name)))(_.execute) |
723 using(db.insert(table))(stmt => |
725 using(db.insert(table))(stmt => |