obsolete;
authorwenzelm
Tue May 09 19:57:04 2017 +0200 (2017-05-09)
changeset 6579091940684a267
parent 65789 fccd7be5fa55
child 65791 cf48ef4f4e63
obsolete;
Admin/jenkins/build/ci_build_stats.scala
src/Pure/Admin/build_stats_legacy.scala
src/Pure/build-jars
     1.1 --- a/Admin/jenkins/build/ci_build_stats.scala	Tue May 09 19:52:39 2017 +0200
     1.2 +++ b/Admin/jenkins/build/ci_build_stats.scala	Tue May 09 19:57:04 2017 +0200
     1.3 @@ -1,3 +1,5 @@
     1.4 +// FIXME obsolete
     1.5 +
     1.6  object stats extends isabelle.Isabelle_Tool.Body {
     1.7  
     1.8    import isabelle._
     1.9 @@ -26,7 +28,7 @@
    1.10      println(s"=== $job ===")
    1.11  
    1.12      val dir = target_dir + Path.basic(job)
    1.13 -    val sessions = Build_Stats_Legacy.present_job(job, dir)
    1.14 +    val sessions: List[String] = Nil
    1.15  
    1.16      val sections =
    1.17        cat_lines(
     2.1 --- a/src/Pure/Admin/build_stats_legacy.scala	Tue May 09 19:52:39 2017 +0200
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,111 +0,0 @@
     2.4 -/*  Title:      Pure/Admin/build_stats_legacy.scala
     2.5 -    Author:     Makarius
     2.6 -
     2.7 -Statistics from session build output.
     2.8 -*/
     2.9 -
    2.10 -package isabelle
    2.11 -
    2.12 -
    2.13 -object Build_Stats_Legacy
    2.14 -{
    2.15 -  /* presentation */
    2.16 -
    2.17 -  private val default_history_length = 100
    2.18 -  private val default_size = (800, 600)
    2.19 -  private val default_only_sessions = Set.empty[String]
    2.20 -  private val default_elapsed_threshold = Time.zero
    2.21 -  private val default_ml_timing: Option[Boolean] = None
    2.22 -
    2.23 -  def present_job(job: String, dir: Path,
    2.24 -    history_length: Int = default_history_length,
    2.25 -    size: (Int, Int) = default_size,
    2.26 -    only_sessions: Set[String] = default_only_sessions,
    2.27 -    elapsed_threshold: Time = default_elapsed_threshold,
    2.28 -    ml_timing: Option[Boolean] = default_ml_timing): List[String] =
    2.29 -  {
    2.30 -    val job_infos = Jenkins.build_job_infos(job).take(history_length)
    2.31 -    if (job_infos.isEmpty) error("No build infos for job " + quote(job))
    2.32 -
    2.33 -    val all_infos =
    2.34 -      Par_List.map((info: Jenkins.Job_Info) =>
    2.35 -        {
    2.36 -          val log_file = Build_Log.Log_File(info.log_filename.implode, Url.read(info.main_log))
    2.37 -          (info.date, log_file.parse_build_info())
    2.38 -        }, job_infos)
    2.39 -    val all_sessions =
    2.40 -      (Set.empty[String] /: all_infos)(
    2.41 -        { case (s, (_, info)) => s ++ info.sessions.keySet })
    2.42 -
    2.43 -    def check_threshold(info: Build_Log.Build_Info, session: String): Boolean =
    2.44 -    {
    2.45 -      val t = info.timing(session)
    2.46 -      !t.is_zero && t.elapsed >= elapsed_threshold
    2.47 -    }
    2.48 -
    2.49 -    val sessions =
    2.50 -      for {
    2.51 -        session <- (if (only_sessions.isEmpty) all_sessions else all_sessions & only_sessions)
    2.52 -        if all_infos.filter({ case (_, info) => check_threshold(info, session) }).length >= 3
    2.53 -      } yield session
    2.54 -
    2.55 -    Isabelle_System.mkdirs(dir)
    2.56 -    for (session <- sessions) {
    2.57 -      Isabelle_System.with_tmp_file(session, "png") { data_file =>
    2.58 -        Isabelle_System.with_tmp_file(session, "gnuplot") { plot_file =>
    2.59 -          val data =
    2.60 -            for { (date, info) <- all_infos if info.finished(session) }
    2.61 -            yield {
    2.62 -              val timing1 = info.timing(session)
    2.63 -              val timing2 = info.ml_timing(session)
    2.64 -              List(date.unix_epoch.toString,
    2.65 -                timing1.elapsed.minutes,
    2.66 -                timing1.cpu.minutes,
    2.67 -                timing2.elapsed.minutes,
    2.68 -                timing2.cpu.minutes,
    2.69 -                timing2.gc.minutes).mkString(" ")
    2.70 -            }
    2.71 -          File.write(data_file, cat_lines(data))
    2.72 -
    2.73 -          val plots1 =
    2.74 -            List(
    2.75 -              """ using 1:3 smooth sbezier title "cpu time (smooth)" """,
    2.76 -              """ using 1:3 smooth csplines title "cpu time" """,
    2.77 -              """ using 1:2 smooth sbezier title "elapsed time (smooth)" """,
    2.78 -              """ using 1:2 smooth csplines title "elapsed time" """)
    2.79 -          val plots2 =
    2.80 -            List(
    2.81 -              """ using 1:5 smooth sbezier title "ML cpu time (smooth)" """,
    2.82 -              """ using 1:5 smooth csplines title "ML cpu time" """,
    2.83 -              """ using 1:4 smooth sbezier title "ML elapsed time (smooth)" """,
    2.84 -              """ using 1:4 smooth csplines title "ML elapsed time" """,
    2.85 -              """ using 1:6 smooth sbezier title "ML gc time (smooth)" """,
    2.86 -              """ using 1:6 smooth csplines title "ML gc time" """)
    2.87 -          val plots =
    2.88 -            ml_timing match {
    2.89 -              case None => plots1
    2.90 -              case Some(false) => plots1 ::: plots2
    2.91 -              case Some(true) => plots2
    2.92 -            }
    2.93 -
    2.94 -          File.write(plot_file, """
    2.95 -set terminal png size """ + size._1 + "," + size._2 + """
    2.96 -set output """ + quote(File.standard_path(dir + Path.basic(session + ".png"))) + """
    2.97 -set xdata time
    2.98 -set timefmt "%s"
    2.99 -set format x "%d-%b"
   2.100 -set xlabel """ + quote(session) + """ noenhanced
   2.101 -set key left top
   2.102 -plot [] [0:] """ + plots.map(s => quote(data_file.implode) + " " + s).mkString(", ") + "\n")
   2.103 -          val result = Isabelle_System.bash("\"$ISABELLE_GNUPLOT\" " + File.bash_path(plot_file))
   2.104 -          if (result.rc != 0) {
   2.105 -            Output.error_message("Session " + session + ": gnuplot error")
   2.106 -            result.print
   2.107 -          }
   2.108 -        }
   2.109 -      }
   2.110 -    }
   2.111 -
   2.112 -    sessions.toList.sorted
   2.113 -  }
   2.114 -}
     3.1 --- a/src/Pure/build-jars	Tue May 09 19:52:39 2017 +0200
     3.2 +++ b/src/Pure/build-jars	Tue May 09 19:57:04 2017 +0200
     3.3 @@ -17,7 +17,6 @@
     3.4    Admin/build_log.scala
     3.5    Admin/build_polyml.scala
     3.6    Admin/build_release.scala
     3.7 -  Admin/build_stats_legacy.scala
     3.8    Admin/build_status.scala
     3.9    Admin/check_sources.scala
    3.10    Admin/ci_profile.scala