src/Pure/Tools/build_stats.scala
author wenzelm
Sat, 13 Aug 2016 23:45:29 +0200
changeset 63688 cc57255bf6ae
parent 63686 66f217416da7
child 63700 2a95d904672e
permissions -rw-r--r--
gnuplot presentation similar to former isatest-statistics;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
63686
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
     1
/*  Title:      Pure/Tools/build_stats.scala
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
     3
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
     4
Statistics from session build output.
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
     5
*/
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
     6
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
     7
package isabelle
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
     8
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
     9
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    10
import scala.collection.mutable
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    11
import scala.util.matching.Regex
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    12
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    13
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    14
object Build_Stats
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    15
{
63688
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    16
  /* parse build output */
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    17
63686
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    18
  private val Session_Finished =
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    19
    new Regex("""^Finished (\S+) \((\d+):(\d+):(\d+) elapsed time, (\d+):(\d+):(\d+) cpu time.*$""")
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    20
  private val Session_Timing =
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    21
    new Regex("""^Timing (\S+) \((\d) threads, (\d+\.\d+)s elapsed time, (\d+\.\d+)s cpu time, (\d+\.\d+)s GC time.*$""")
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    22
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    23
  private object ML_Option
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    24
  {
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    25
    def unapply(s: String): Option[(String, String)] =
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    26
      s.indexOf('=') match {
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    27
        case -1 => None
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    28
        case i =>
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    29
          val a = s.substring(0, i)
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    30
          Library.try_unquote(s.substring(i + 1)) match {
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    31
            case Some(b) if Build.ml_options.contains(a) => Some((a, b))
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    32
            case _ => None
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    33
          }
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    34
      }
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    35
  }
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    36
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    37
  def parse(text: String): Build_Stats =
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    38
  {
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    39
    import Properties.Value
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    40
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    41
    val ml_options = new mutable.ListBuffer[(String, String)]
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    42
    var finished = Map.empty[String, Timing]
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    43
    var timing = Map.empty[String, Timing]
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    44
    var threads = Map.empty[String, Int]
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    45
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    46
    for (line <- split_lines(text)) {
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    47
      line match {
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    48
        case Session_Finished(name,
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    49
            Value.Int(e1), Value.Int(e2), Value.Int(e3),
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    50
            Value.Int(c1), Value.Int(c2), Value.Int(c3)) =>
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    51
          val elapsed = Time.hours_minutes_seconds(e1, e2, e3)
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    52
          val cpu = Time.hours_minutes_seconds(c1, c2, c3)
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    53
          finished += (name -> Timing(elapsed, cpu, Time.zero))
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    54
        case Session_Timing(name,
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    55
            Value.Int(t), Value.Double(e), Value.Double(c), Value.Double(g)) =>
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    56
          val elapsed = Time.seconds(e)
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    57
          val cpu = Time.seconds(c)
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    58
          val gc = Time.seconds(g)
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    59
          timing += (name -> Timing(elapsed, cpu, gc))
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    60
          threads += (name -> t)
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    61
        case ML_Option(option) => ml_options += option
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    62
        case _ =>
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    63
      }
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    64
    }
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    65
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    66
    Build_Stats(ml_options.toList, finished, timing, threads)
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
    67
  }
63688
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    68
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    69
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    70
  /* presentation */
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    71
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    72
  def present(job: String, history_length: Int, target_dir: Path)
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    73
  {
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    74
    val build_infos = CI_API.build_job_builds(job).sortBy(_.timestamp).reverse.take(history_length)
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    75
    if (build_infos.isEmpty) error("No build infos for job " + quote(job))
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    76
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    77
    val dir = target_dir + Path.basic(job)
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    78
    Isabelle_System.mkdirs(dir)
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    79
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    80
    val all_build_stats =
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    81
      Par_List.map((info: CI_API.Build_Info) =>
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    82
        (info.timestamp / 1000, parse(Url.read(info.output))), build_infos)
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    83
    val all_sessions =
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    84
      (Set.empty[String] /: all_build_stats)(
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    85
        { case (s, (_, stats)) => s ++ stats.sessions })
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    86
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    87
    for {
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    88
      session <- all_sessions
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    89
      if all_build_stats.filter({ case (_, stats) => stats.finished.isDefinedAt(session) }).length > 3
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    90
    } {
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    91
      Isabelle_System.with_tmp_file(session, "png") { data_file =>
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    92
        Isabelle_System.with_tmp_file(session, "gnuplot") { plot_file =>
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    93
          val data_file_name = File.standard_path(data_file.getAbsolutePath)
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    94
          val data =
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    95
            for { (t, stats) <- all_build_stats if stats.finished.isDefinedAt(session) }
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    96
            yield {
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    97
              val finished = stats.finished(session)
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    98
              t.toString + " " + finished.cpu.minutes + " " + finished.elapsed.minutes
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
    99
            }
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   100
          File.write(data_file, cat_lines(data))
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   101
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   102
          File.write(plot_file, """
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   103
set terminal png size 1024,768
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   104
set output """ + quote(File.standard_path(dir + Path.basic(session + ".png"))) + """
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   105
set xdata time
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   106
set timefmt "%s"
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   107
set format x "%d-%b"
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   108
set xlabel """ + quote(session) + """
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   109
set key left top
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   110
plot [] [0:] """ +
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   111
  quote(data_file_name) + """ using 1:2 smooth sbezier title "interpolated cpu time",""" +
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   112
  quote(data_file_name) + """ using 1:2 smooth csplines title "cpu time", """ +
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   113
  quote(data_file_name) + """ using 1:3 smooth sbezier title "interpolated elapsed time",""" +
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   114
  quote(data_file_name) + """ using 1:3 smooth csplines title "elapsed time"
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   115
""")
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   116
          val result = Isabelle_System.bash("\"$ISABELLE_GNUPLOT\" " + File.bash_path(plot_file))
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   117
          if (result.rc != 0) {
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   118
            Output.error_message("Session " + session + ": gnuplot error")
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   119
            result.print
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   120
          }
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   121
        }
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   122
      }
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   123
    }
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   124
  }
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   125
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   126
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   127
  /* Isabelle tool wrapper */
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   128
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   129
  val isabelle_tool =
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   130
    Isabelle_Tool("build_stats", "present statistics from session build output", args =>
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   131
    {
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   132
      var target_dir = Path.explode("stats")
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   133
      var only_jobs = Set.empty[String]
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   134
      var history_length = 100
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   135
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   136
      val getopts = Getopts("""
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   137
Usage: isabelle build_stats [OPTIONS]
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   138
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   139
  Options are:
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   140
    -D DIR       target directory (default "stats")
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   141
    -J JOB       select named JOB (default: all jobs, multiple -J options possible)
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   142
    -l LENGTH    length of history (default 100)
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   143
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   144
  Present statistics from session build output, from Jenkins continuous build
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   145
  service specified as URL via ISABELLE_JENKINS_ROOT.
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   146
""",
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   147
        "D:" -> (arg => target_dir = Path.explode(arg)),
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   148
        "J:" -> (arg => only_jobs += arg),
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   149
        "l:" -> (arg => history_length = Properties.Value.Int.parse(arg)))
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   150
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   151
      val more_args = getopts(args)
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   152
      if (!more_args.isEmpty) getopts.usage()
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   153
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   154
      val all_jobs = CI_API.build_jobs()
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   155
      val jobs =
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   156
        if (only_jobs.isEmpty) all_jobs
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   157
        else {
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   158
          val bad = (only_jobs -- all_jobs).toList.sorted
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   159
          if (bad.isEmpty) only_jobs.toList
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   160
          else
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   161
            error("Unknown build jobs: " + commas_quote(bad) +
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   162
              "\nPossible jobs: " + commas_quote(all_jobs.sorted))
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   163
        }
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   164
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   165
      for (job <- jobs) {
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   166
        Output.writeln((target_dir + Path.basic(job)).implode)
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   167
        present(job, history_length, target_dir)
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   168
      }
cc57255bf6ae gnuplot presentation similar to former isatest-statistics;
wenzelm
parents: 63686
diff changeset
   169
    })
63686
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
   170
}
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
   171
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
   172
sealed case class Build_Stats(
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
   173
  ml_options: List[(String, String)],
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
   174
  finished: Map[String, Timing],
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
   175
  timing: Map[String, Timing],
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
   176
  threads: Map[String, Int])
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
   177
{
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
   178
  val sessions: Set[String] = finished.keySet ++ timing.keySet
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
   179
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
   180
  override def toString: String =
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
   181
    sessions.toList.sorted.mkString("Build_Stats(", ", ", ")")
66f217416da7 statistics from session build output;
wenzelm
parents:
diff changeset
   182
}