61 sealed case class Data_Entry(name: String, hosts: List[String], sessions: List[Session]) |
61 sealed case class Data_Entry(name: String, hosts: List[String], sessions: List[Session]) |
62 sealed case class Session(name: String, threads: Int, entries: List[Entry]) |
62 sealed case class Session(name: String, threads: Int, entries: List[Entry]) |
63 { |
63 { |
64 require(entries.nonEmpty) |
64 require(entries.nonEmpty) |
65 |
65 |
|
66 def pull_date: Date = entries.head.pull_date |
|
67 def isabelle_version: String = entries.head.isabelle_version |
|
68 def afp_version: String = entries.head.afp_version |
|
69 |
66 def timing: Timing = entries.head.timing |
70 def timing: Timing = entries.head.timing |
67 def ml_timing: Timing = entries.head.ml_timing |
71 def ml_timing: Timing = entries.head.ml_timing |
68 def order: Long = - timing.elapsed.ms |
72 def order: Long = - timing.elapsed.ms |
69 |
73 |
70 def check_timing: Boolean = entries.length >= 3 |
74 def check_timing: Boolean = entries.length >= 3 |
71 def check_heap: Boolean = entries.forall(_.heap_size > 0) |
75 def check_heap: Boolean = entries.forall(_.heap_size > 0) |
72 } |
76 } |
73 sealed case class Entry(date: Date, timing: Timing, ml_timing: Timing, heap_size: Long) |
77 sealed case class Entry(pull_date: Date, isabelle_version: String, afp_version: String, |
|
78 timing: Timing, ml_timing: Timing, heap_size: Long) |
74 |
79 |
75 def read_data(options: Options, |
80 def read_data(options: Options, |
76 progress: Progress = No_Progress, |
81 progress: Progress = No_Progress, |
77 profiles: List[Profile] = default_profiles, |
82 profiles: List[Profile] = default_profiles, |
78 only_sessions: Set[String] = Set.empty, |
83 only_sessions: Set[String] = Set.empty, |
92 progress.echo("input " + quote(profile.description)) |
97 progress.echo("input " + quote(profile.description)) |
93 val columns = |
98 val columns = |
94 List( |
99 List( |
95 Build_Log.Data.pull_date, |
100 Build_Log.Data.pull_date, |
96 Build_Log.Prop.build_host, |
101 Build_Log.Prop.build_host, |
|
102 Build_Log.Prop.isabelle_version, |
|
103 Build_Log.Prop.afp_version, |
97 Build_Log.Settings.ISABELLE_BUILD_OPTIONS, |
104 Build_Log.Settings.ISABELLE_BUILD_OPTIONS, |
98 Build_Log.Settings.ML_PLATFORM, |
105 Build_Log.Settings.ML_PLATFORM, |
99 Build_Log.Data.session_name, |
106 Build_Log.Data.session_name, |
100 Build_Log.Data.threads, |
107 Build_Log.Data.threads, |
101 Build_Log.Data.timing_elapsed, |
108 Build_Log.Data.timing_elapsed, |
131 profile.description + |
138 profile.description + |
132 (if (ml_platform.startsWith("x86_64")) ", 64bit" else "") + |
139 (if (ml_platform.startsWith("x86_64")) ", 64bit" else "") + |
133 (if (threads == 1) "" else ", " + threads + " threads") |
140 (if (threads == 1) "" else ", " + threads + " threads") |
134 |
141 |
135 val entry = |
142 val entry = |
136 Entry(res.date(Build_Log.Data.pull_date), |
143 Entry( |
137 res.timing( |
144 pull_date = res.date(Build_Log.Data.pull_date), |
138 Build_Log.Data.timing_elapsed, |
145 isabelle_version = res.string(Build_Log.Prop.isabelle_version), |
139 Build_Log.Data.timing_cpu, |
146 afp_version = res.string(Build_Log.Prop.afp_version), |
140 Build_Log.Data.timing_gc), |
147 timing = |
141 res.timing( |
148 res.timing( |
142 Build_Log.Data.ml_timing_elapsed, |
149 Build_Log.Data.timing_elapsed, |
143 Build_Log.Data.ml_timing_cpu, |
150 Build_Log.Data.timing_cpu, |
144 Build_Log.Data.ml_timing_gc), |
151 Build_Log.Data.timing_gc), |
|
152 ml_timing = |
|
153 res.timing( |
|
154 Build_Log.Data.ml_timing_elapsed, |
|
155 Build_Log.Data.ml_timing_cpu, |
|
156 Build_Log.Data.ml_timing_gc), |
145 heap_size = res.long(Build_Log.Data.heap_size)) |
157 heap_size = res.long(Build_Log.Data.heap_size)) |
146 |
158 |
147 res.get_string(Build_Log.Prop.build_host).foreach(host => |
159 res.get_string(Build_Log.Prop.build_host).foreach(host => |
148 data_hosts += (data_name -> (get_hosts(data_name) + host))) |
160 data_hosts += (data_name -> (get_hosts(data_name) + host))) |
149 |
161 |
204 Isabelle_System.with_tmp_file(session.name, "gnuplot") { gnuplot_file => |
216 Isabelle_System.with_tmp_file(session.name, "gnuplot") { gnuplot_file => |
205 |
217 |
206 File.write(data_file, |
218 File.write(data_file, |
207 cat_lines( |
219 cat_lines( |
208 session.entries.map(entry => |
220 session.entries.map(entry => |
209 List(entry.date.unix_epoch.toString, |
221 List(entry.pull_date.unix_epoch.toString, |
210 entry.timing.elapsed.minutes, |
222 entry.timing.elapsed.minutes, |
211 entry.timing.resources.minutes, |
223 entry.timing.resources.minutes, |
212 entry.ml_timing.elapsed.minutes, |
224 entry.ml_timing.elapsed.minutes, |
213 entry.ml_timing.resources.minutes, |
225 entry.ml_timing.resources.minutes, |
214 (entry.heap_size.toDouble / (1024 * 1024)).toString).mkString(" ")))) |
226 (entry.heap_size.toDouble / (1024 * 1024)).toString).mkString(" ")))) |
296 data_entry.sessions.flatMap(session => |
308 data_entry.sessions.flatMap(session => |
297 List( |
309 List( |
298 HTML.section(session.name) + HTML.id("session_" + session.name), |
310 HTML.section(session.name) + HTML.id("session_" + session.name), |
299 HTML.par( |
311 HTML.par( |
300 HTML.itemize(List( |
312 HTML.itemize(List( |
301 HTML.bold(HTML.text("status date: ")) :: HTML.text(data.date.toString), |
|
302 HTML.bold(HTML.text("build host: ")) :: HTML.text(commas(data_entry.hosts)), |
|
303 HTML.bold(HTML.text("timing: ")) :: HTML.text(session.timing.message_resources), |
313 HTML.bold(HTML.text("timing: ")) :: HTML.text(session.timing.message_resources), |
304 HTML.bold(HTML.text("ML timing: ")) :: |
314 HTML.bold(HTML.text("ML timing: ")) :: |
305 HTML.text(session.ml_timing.message_resources))) :: |
315 HTML.text(session.ml_timing.message_resources)) ::: |
|
316 proper_string(session.isabelle_version).map(s => |
|
317 HTML.bold(HTML.text("Isabelle version: ")) :: HTML.text(s)).toList ::: |
|
318 proper_string(session.afp_version).map(s => |
|
319 HTML.bold(HTML.text("AFP version: ")) :: HTML.text(s)).toList) :: |
306 session_plots.getOrElse(session.name, Nil).map(plot_name => |
320 session_plots.getOrElse(session.name, Nil).map(plot_name => |
307 HTML.image(plot_name) + |
321 HTML.image(plot_name) + |
308 HTML.width(image_size._1 / 2) + |
322 HTML.width(image_size._1 / 2) + |
309 HTML.height(image_size._2 / 2))))))) |
323 HTML.height(image_size._2 / 2))))))) |
310 } |
324 } |