author | wenzelm |
Thu, 18 May 2017 11:42:16 +0200 | |
changeset 65863 | 94fe5e82d101 |
parent 65861 | f35abc25d7b1 |
child 65865 | 177b90f33f40 |
permissions | -rw-r--r-- |
65743 | 1 |
/* Title: Pure/Admin/build_status.scala |
63686 | 2 |
Author: Makarius |
3 |
||
65743 | 4 |
Present recent build status information from database. |
63686 | 5 |
*/ |
6 |
||
7 |
package isabelle |
|
8 |
||
9 |
||
65743 | 10 |
object Build_Status |
63686 | 11 |
{ |
65799 | 12 |
/* defaults */ |
13 |
||
14 |
val default_target_dir = Path.explode("build_status") |
|
15 |
val default_image_size = (800, 600) |
|
16 |
val default_history = 30 |
|
17 |
||
18 |
def default_profiles: List[Profile] = |
|
19 |
Jenkins.build_status_profiles ::: Isabelle_Cronjob.build_status_profiles |
|
20 |
||
21 |
||
65791 | 22 |
/* data profiles */ |
23 |
||
65798 | 24 |
sealed case class Profile(description: String, history: Int, sql: String) |
65791 | 25 |
{ |
65799 | 26 |
def days(options: Options): Int = options.int("build_log_history") max history |
27 |
||
28 |
def stretch(options: Options): Double = |
|
29 |
(days(options) max default_history min (default_history * 5)).toDouble / default_history |
|
30 |
||
31 |
def select(options: Options, columns: List[SQL.Column], only_sessions: Set[String]): SQL.Source = |
|
65791 | 32 |
{ |
33 |
Build_Log.Data.universal_table.select(columns, distinct = true, |
|
34 |
sql = "WHERE " + |
|
65799 | 35 |
Build_Log.Data.pull_date + " > " + Build_Log.Data.recent_time(days(options)) + " AND " + |
65791 | 36 |
Build_Log.Data.status + " = " + SQL.string(Build_Log.Session_Status.finished.toString) + |
65804 | 37 |
(if (only_sessions.isEmpty) "" |
38 |
else " AND " + SQL.member(Build_Log.Data.session_name.ident, only_sessions)) + |
|
39 |
" AND " + SQL.enclose(sql) + |
|
65849 | 40 |
" ORDER BY " + Build_Log.Data.pull_date) |
65791 | 41 |
} |
42 |
} |
|
43 |
||
44 |
||
65785 | 45 |
/* build status */ |
46 |
||
47 |
def build_status(options: Options, |
|
48 |
progress: Progress = No_Progress, |
|
49 |
profiles: List[Profile] = default_profiles, |
|
50 |
only_sessions: Set[String] = Set.empty, |
|
51 |
verbose: Boolean = false, |
|
52 |
target_dir: Path = default_target_dir, |
|
65854 | 53 |
ml_statistics: Boolean = false, |
65785 | 54 |
image_size: (Int, Int) = default_image_size) |
55 |
{ |
|
56 |
val data = |
|
57 |
read_data(options, progress = progress, profiles = profiles, |
|
65854 | 58 |
only_sessions = only_sessions, ml_statistics = ml_statistics, verbose = verbose) |
65785 | 59 |
|
60 |
present_data(data, progress = progress, target_dir = target_dir, image_size = image_size) |
|
61 |
} |
|
65736 | 62 |
|
63 |
||
65791 | 64 |
/* read data */ |
65736 | 65 |
|
65792 | 66 |
sealed case class Data(date: Date, entries: List[Data_Entry]) |
65799 | 67 |
sealed case class Data_Entry( |
68 |
name: String, hosts: List[String], stretch: Double, sessions: List[Session]) |
|
65765 | 69 |
sealed case class Session(name: String, threads: Int, entries: List[Entry]) |
65754 | 70 |
{ |
65795 | 71 |
require(entries.nonEmpty) |
72 |
||
65863 | 73 |
def head: Entry = entries.head |
74 |
def order: Long = - head.timing.elapsed.ms |
|
65860 | 75 |
|
65769 | 76 |
def check_timing: Boolean = entries.length >= 3 |
65854 | 77 |
def check_heap: Boolean = |
78 |
entries.length >= 3 && |
|
65859 | 79 |
entries.forall(entry => |
80 |
entry.maximum_heap > 0 || |
|
81 |
entry.average_heap > 0 || |
|
82 |
entry.final_heap > 0) |
|
65754 | 83 |
} |
65854 | 84 |
sealed case class Entry( |
85 |
pull_date: Date, |
|
86 |
isabelle_version: String, |
|
87 |
afp_version: String, |
|
88 |
timing: Timing, |
|
89 |
ml_timing: Timing, |
|
65859 | 90 |
maximum_heap: Long, |
91 |
average_heap: Long, |
|
65861 | 92 |
final_heap: Long) |
65736 | 93 |
|
94 |
def read_data(options: Options, |
|
95 |
progress: Progress = No_Progress, |
|
65785 | 96 |
profiles: List[Profile] = default_profiles, |
65736 | 97 |
only_sessions: Set[String] = Set.empty, |
65854 | 98 |
ml_statistics: Boolean = false, |
65750 | 99 |
verbose: Boolean = false): Data = |
65736 | 100 |
{ |
65754 | 101 |
val date = Date.now() |
65792 | 102 |
var data_hosts = Map.empty[String, Set[String]] |
65799 | 103 |
var data_stretch = Map.empty[String, Double] |
65762 | 104 |
var data_entries = Map.empty[String, Map[String, Session]] |
63688
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
105 |
|
65792 | 106 |
def get_hosts(data_name: String): Set[String] = |
107 |
data_hosts.getOrElse(data_name, Set.empty) |
|
108 |
||
65736 | 109 |
val store = Build_Log.store(options) |
110 |
using(store.open_database())(db => |
|
64089 | 111 |
{ |
65764 | 112 |
for (profile <- profiles.sortBy(_.description)) { |
113 |
progress.echo("input " + quote(profile.description)) |
|
65854 | 114 |
|
65736 | 115 |
val columns = |
116 |
List( |
|
117 |
Build_Log.Data.pull_date, |
|
65792 | 118 |
Build_Log.Prop.build_host, |
65796 | 119 |
Build_Log.Prop.isabelle_version, |
120 |
Build_Log.Prop.afp_version, |
|
65752
ed7b5cd3a7f2
more uniform threads value, notably for Pure session;
wenzelm
parents:
65751
diff
changeset
|
121 |
Build_Log.Settings.ISABELLE_BUILD_OPTIONS, |
65736 | 122 |
Build_Log.Settings.ML_PLATFORM, |
123 |
Build_Log.Data.session_name, |
|
124 |
Build_Log.Data.threads, |
|
125 |
Build_Log.Data.timing_elapsed, |
|
126 |
Build_Log.Data.timing_cpu, |
|
127 |
Build_Log.Data.timing_gc, |
|
128 |
Build_Log.Data.ml_timing_elapsed, |
|
129 |
Build_Log.Data.ml_timing_cpu, |
|
65769 | 130 |
Build_Log.Data.ml_timing_gc, |
65854 | 131 |
Build_Log.Data.heap_size) ::: |
132 |
(if (ml_statistics) List(Build_Log.Data.ml_statistics) else Nil) |
|
63700 | 133 |
|
65752
ed7b5cd3a7f2
more uniform threads value, notably for Pure session;
wenzelm
parents:
65751
diff
changeset
|
134 |
val Threads_Option = """threads\s*=\s*(\d+)""".r |
ed7b5cd3a7f2
more uniform threads value, notably for Pure session;
wenzelm
parents:
65751
diff
changeset
|
135 |
|
65799 | 136 |
val sql = profile.select(options, columns, only_sessions) |
65750 | 137 |
if (verbose) progress.echo(sql) |
138 |
||
139 |
db.using_statement(sql)(stmt => |
|
65736 | 140 |
{ |
65740 | 141 |
val res = stmt.execute_query() |
142 |
while (res.next()) { |
|
65766
2edb89630a80
more specific workaround (see also ed7b5cd3a7f2);
wenzelm
parents:
65765
diff
changeset
|
143 |
val session_name = res.string(Build_Log.Data.session_name) |
65764 | 144 |
val threads = |
145 |
{ |
|
146 |
val threads1 = |
|
147 |
res.string(Build_Log.Settings.ISABELLE_BUILD_OPTIONS) match { |
|
65766
2edb89630a80
more specific workaround (see also ed7b5cd3a7f2);
wenzelm
parents:
65765
diff
changeset
|
148 |
case Threads_Option(Value.Int(i)) if session_name == "Pure" => i |
65764 | 149 |
case _ => 1 |
150 |
} |
|
151 |
val threads2 = res.get_int(Build_Log.Data.threads).getOrElse(1) |
|
152 |
threads1 max threads2 |
|
153 |
} |
|
65766
2edb89630a80
more specific workaround (see also ed7b5cd3a7f2);
wenzelm
parents:
65765
diff
changeset
|
154 |
val ml_platform = res.string(Build_Log.Settings.ML_PLATFORM) |
65762 | 155 |
val data_name = |
65764 | 156 |
profile.description + |
157 |
(if (ml_platform.startsWith("x86_64")) ", 64bit" else "") + |
|
158 |
(if (threads == 1) "" else ", " + threads + " threads") |
|
63703 | 159 |
|
65799 | 160 |
res.get_string(Build_Log.Prop.build_host).foreach(host => |
161 |
data_hosts += (data_name -> (get_hosts(data_name) + host))) |
|
162 |
||
163 |
data_stretch += (data_name -> profile.stretch(options)) |
|
164 |
||
65854 | 165 |
val isabelle_version = res.string(Build_Log.Prop.isabelle_version) |
166 |
||
167 |
val ml_stats = |
|
168 |
ML_Statistics( |
|
169 |
if (ml_statistics) |
|
65857 | 170 |
Properties.uncompress(res.bytes(Build_Log.Data.ml_statistics)) |
65854 | 171 |
else Nil, heading = session_name + " (Isabelle/ " + isabelle_version + ")") |
172 |
||
65736 | 173 |
val entry = |
65796 | 174 |
Entry( |
175 |
pull_date = res.date(Build_Log.Data.pull_date), |
|
65854 | 176 |
isabelle_version = isabelle_version, |
65796 | 177 |
afp_version = res.string(Build_Log.Prop.afp_version), |
178 |
timing = |
|
179 |
res.timing( |
|
180 |
Build_Log.Data.timing_elapsed, |
|
181 |
Build_Log.Data.timing_cpu, |
|
182 |
Build_Log.Data.timing_gc), |
|
183 |
ml_timing = |
|
184 |
res.timing( |
|
185 |
Build_Log.Data.ml_timing_elapsed, |
|
186 |
Build_Log.Data.ml_timing_cpu, |
|
187 |
Build_Log.Data.ml_timing_gc), |
|
65859 | 188 |
maximum_heap = ml_stats.maximum_heap_size, |
189 |
average_heap = ml_stats.average_heap_size, |
|
65861 | 190 |
final_heap = res.long(Build_Log.Data.heap_size)) |
65736 | 191 |
|
65762 | 192 |
val sessions = data_entries.getOrElse(data_name, Map.empty) |
65766
2edb89630a80
more specific workaround (see also ed7b5cd3a7f2);
wenzelm
parents:
65765
diff
changeset
|
193 |
val entries = sessions.get(session_name).map(_.entries) getOrElse Nil |
2edb89630a80
more specific workaround (see also ed7b5cd3a7f2);
wenzelm
parents:
65765
diff
changeset
|
194 |
val session = Session(session_name, threads, entry :: entries) |
2edb89630a80
more specific workaround (see also ed7b5cd3a7f2);
wenzelm
parents:
65765
diff
changeset
|
195 |
data_entries += (data_name -> (sessions + (session_name -> session))) |
65736 | 196 |
} |
197 |
}) |
|
198 |
} |
|
199 |
}) |
|
200 |
||
65792 | 201 |
val sorted_entries = |
65762 | 202 |
(for { |
65792 | 203 |
(name, sessions) <- data_entries.toList |
65847
ad35427dbe88
less restrictive filter: omit empty charts, but show latest timing;
wenzelm
parents:
65838
diff
changeset
|
204 |
sorted_sessions <- proper_list(sessions.toList.map(_._2).sortBy(_.order)) |
65799 | 205 |
} |
206 |
yield { |
|
207 |
val hosts = get_hosts(name).toList.sorted |
|
208 |
val stretch = data_stretch(name) |
|
209 |
Data_Entry(name, hosts, stretch, sorted_sessions) |
|
210 |
}).sortBy(_.name) |
|
65792 | 211 |
|
212 |
Data(date, sorted_entries) |
|
65736 | 213 |
} |
214 |
||
215 |
||
216 |
/* present data */ |
|
217 |
||
218 |
def present_data(data: Data, |
|
219 |
progress: Progress = No_Progress, |
|
220 |
target_dir: Path = default_target_dir, |
|
65759 | 221 |
image_size: (Int, Int) = default_image_size) |
65736 | 222 |
{ |
65791 | 223 |
def clean_name(name: String): String = |
224 |
name.flatMap(c => if (c == ' ' || c == '/') "_" else if (c == ',') "" else c.toString) |
|
225 |
||
65860 | 226 |
def heap_scale(x: Long): Long = x / 1024 / 1024 |
227 |
||
228 |
def print_heap(x: Long): Option[String] = |
|
229 |
{ |
|
230 |
val y = heap_scale(x) |
|
231 |
if (y == 0L) None else Some(y.toString + " M") |
|
232 |
} |
|
65854 | 233 |
|
65838 | 234 |
HTML.write_document(target_dir, "index.html", |
235 |
List(HTML.title("Isabelle build status")), |
|
236 |
List(HTML.chapter("Isabelle build status"), |
|
237 |
HTML.par( |
|
238 |
List(HTML.description( |
|
239 |
List(HTML.text("status date:") -> HTML.text(data.date.toString))))), |
|
240 |
HTML.par( |
|
241 |
List(HTML.itemize(data.entries.map({ case data_entry => |
|
242 |
List(HTML.link(clean_name(data_entry.name) + "/index.html", |
|
243 |
HTML.text(data_entry.name))) })))))) |
|
65786 | 244 |
|
65792 | 245 |
for (data_entry <- data.entries) { |
246 |
val data_name = data_entry.name |
|
247 |
||
65799 | 248 |
val image_width = (image_size._1 * data_entry.stretch).toInt |
249 |
val image_height = image_size._2 |
|
250 |
||
65786 | 251 |
progress.echo("output " + quote(data_name)) |
252 |
||
65764 | 253 |
val dir = target_dir + Path.basic(clean_name(data_name)) |
65736 | 254 |
Isabelle_System.mkdirs(dir) |
255 |
||
65764 | 256 |
val session_plots = |
257 |
Par_List.map((session: Session) => |
|
258 |
Isabelle_System.with_tmp_file(session.name, "data") { data_file => |
|
259 |
Isabelle_System.with_tmp_file(session.name, "gnuplot") { gnuplot_file => |
|
63706 | 260 |
|
65764 | 261 |
File.write(data_file, |
262 |
cat_lines( |
|
263 |
session.entries.map(entry => |
|
65854 | 264 |
List(entry.pull_date.unix_epoch, |
65764 | 265 |
entry.timing.elapsed.minutes, |
266 |
entry.timing.resources.minutes, |
|
267 |
entry.ml_timing.elapsed.minutes, |
|
65769 | 268 |
entry.ml_timing.resources.minutes, |
65859 | 269 |
heap_scale(entry.maximum_heap), |
270 |
heap_scale(entry.average_heap), |
|
271 |
heap_scale(entry.final_heap)).mkString(" ")))) |
|
65736 | 272 |
|
65764 | 273 |
val max_time = |
274 |
((0.0 /: session.entries){ case (m, entry) => |
|
275 |
m.max(entry.timing.elapsed.minutes). |
|
276 |
max(entry.timing.resources.minutes). |
|
277 |
max(entry.ml_timing.elapsed.minutes). |
|
278 |
max(entry.ml_timing.resources.minutes) } max 0.1) * 1.1 |
|
65769 | 279 |
val timing_range = "[0:" + max_time + "]" |
65763 | 280 |
|
65769 | 281 |
def gnuplot(plots: List[String], kind: String, range: String): String = |
65764 | 282 |
{ |
283 |
val plot_name = session.name + "_" + kind + ".png" |
|
284 |
||
285 |
File.write(gnuplot_file, """ |
|
65799 | 286 |
set terminal png size """ + image_width + "," + image_height + """ |
65764 | 287 |
set output """ + quote(File.standard_path(dir + Path.basic(plot_name))) + """ |
65759 | 288 |
set xdata time |
289 |
set timefmt "%s" |
|
290 |
set format x "%d-%b" |
|
65762 | 291 |
set xlabel """ + quote(session.name) + """ noenhanced |
65763 | 292 |
set key left bottom |
65769 | 293 |
plot [] """ + range + " " + |
294 |
plots.map(s => quote(data_file.implode) + " " + s).mkString(", ") + "\n") |
|
65759 | 295 |
|
65764 | 296 |
val result = |
297 |
Isabelle_System.bash("\"$ISABELLE_GNUPLOT\" " + File.bash_path(gnuplot_file)) |
|
298 |
if (!result.ok) |
|
299 |
result.error("Gnuplot failed for " + data_name + "/" + plot_name).check |
|
300 |
||
301 |
plot_name |
|
302 |
} |
|
65759 | 303 |
|
65765 | 304 |
val timing_plots = |
65769 | 305 |
{ |
306 |
val plots1 = |
|
307 |
List( |
|
308 |
""" using 1:2 smooth sbezier title "elapsed time (smooth)" """, |
|
309 |
""" using 1:2 smooth csplines title "elapsed time" """) |
|
310 |
val plots2 = |
|
311 |
List( |
|
312 |
""" using 1:3 smooth sbezier title "cpu time (smooth)" """, |
|
313 |
""" using 1:3 smooth csplines title "cpu time" """) |
|
314 |
if (session.threads == 1) plots1 else plots1 ::: plots2 |
|
315 |
} |
|
65765 | 316 |
|
65764 | 317 |
val ml_timing_plots = |
318 |
List( |
|
65765 | 319 |
""" using 1:4 smooth sbezier title "ML elapsed time (smooth)" """, |
320 |
""" using 1:4 smooth csplines title "ML elapsed time" """, |
|
65764 | 321 |
""" using 1:5 smooth sbezier title "ML cpu time (smooth)" """, |
65765 | 322 |
""" using 1:5 smooth csplines title "ML cpu time" """) |
65736 | 323 |
|
65769 | 324 |
val heap_plots = |
325 |
List( |
|
65859 | 326 |
""" using 1:6 smooth sbezier title "maximum heap (smooth)" """, |
327 |
""" using 1:6 smooth csplines title "maximum heap" """, |
|
328 |
""" using 1:7 smooth sbezier title "average heap (smooth)" """, |
|
329 |
""" using 1:7 smooth csplines title "average heap" """, |
|
330 |
""" using 1:8 smooth sbezier title "final heap (smooth)" """, |
|
331 |
""" using 1:8 smooth csplines title "final heap" """) |
|
65769 | 332 |
|
333 |
val plot_names = |
|
65847
ad35427dbe88
less restrictive filter: omit empty charts, but show latest timing;
wenzelm
parents:
65838
diff
changeset
|
334 |
(if (session.check_timing) |
ad35427dbe88
less restrictive filter: omit empty charts, but show latest timing;
wenzelm
parents:
65838
diff
changeset
|
335 |
List( |
ad35427dbe88
less restrictive filter: omit empty charts, but show latest timing;
wenzelm
parents:
65838
diff
changeset
|
336 |
gnuplot(timing_plots, "timing", timing_range), |
ad35427dbe88
less restrictive filter: omit empty charts, but show latest timing;
wenzelm
parents:
65838
diff
changeset
|
337 |
gnuplot(ml_timing_plots, "ml_timing", timing_range)) |
ad35427dbe88
less restrictive filter: omit empty charts, but show latest timing;
wenzelm
parents:
65838
diff
changeset
|
338 |
else Nil) ::: |
65769 | 339 |
(if (session.check_heap) List(gnuplot(heap_plots, "heap", "[0:]")) else Nil) |
340 |
||
341 |
session.name -> plot_names |
|
65764 | 342 |
} |
65792 | 343 |
}, data_entry.sessions).toMap |
65754 | 344 |
|
65838 | 345 |
HTML.write_document(dir, "index.html", |
346 |
List(HTML.title("Isabelle build status for " + data_name)), |
|
347 |
HTML.chapter("Isabelle build status for " + data_name) :: |
|
348 |
HTML.par( |
|
349 |
List(HTML.description( |
|
65754 | 350 |
List( |
65838 | 351 |
HTML.text("status date:") -> HTML.text(data.date.toString), |
352 |
HTML.text("build host:") -> HTML.text(commas(data_entry.hosts)))))) :: |
|
353 |
HTML.par( |
|
354 |
List(HTML.itemize( |
|
355 |
data_entry.sessions.map(session => |
|
356 |
HTML.link("#session_" + session.name, HTML.text(session.name)) :: |
|
65863 | 357 |
HTML.text(" (" + session.head.timing.message_resources + ")"))))) :: |
65838 | 358 |
data_entry.sessions.flatMap(session => |
359 |
List( |
|
360 |
HTML.section(session.name) + HTML.id("session_" + session.name), |
|
361 |
HTML.par( |
|
362 |
HTML.description( |
|
363 |
List( |
|
65863 | 364 |
HTML.text("timing:") -> HTML.text(session.head.timing.message_resources), |
365 |
HTML.text("ML timing:") -> HTML.text(session.head.ml_timing.message_resources)) ::: |
|
366 |
print_heap(session.head.maximum_heap).map(s => |
|
65860 | 367 |
HTML.text("maximum heap:") -> HTML.text(s)).toList ::: |
65863 | 368 |
print_heap(session.head.average_heap).map(s => |
65860 | 369 |
HTML.text("average heap:") -> HTML.text(s)).toList ::: |
65863 | 370 |
print_heap(session.head.final_heap).map(s => |
65860 | 371 |
HTML.text("final heap:") -> HTML.text(s)).toList ::: |
65863 | 372 |
proper_string(session.head.isabelle_version).map(s => |
65838 | 373 |
HTML.text("Isabelle version:") -> HTML.text(s)).toList ::: |
65863 | 374 |
proper_string(session.head.afp_version).map(s => |
65838 | 375 |
HTML.text("AFP version:") -> HTML.text(s)).toList) :: |
376 |
session_plots.getOrElse(session.name, Nil).map(plot_name => |
|
377 |
HTML.image(plot_name) + |
|
378 |
HTML.width(image_width / 2) + |
|
379 |
HTML.height(image_height / 2)))))) |
|
63688
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
380 |
} |
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
381 |
} |
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
382 |
|
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
383 |
|
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
384 |
/* Isabelle tool wrapper */ |
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
385 |
|
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
386 |
val isabelle_tool = |
65743 | 387 |
Isabelle_Tool("build_status", "present recent build status information from database", args => |
63688
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
388 |
{ |
65736 | 389 |
var target_dir = default_target_dir |
65854 | 390 |
var ml_statistics = false |
65736 | 391 |
var only_sessions = Set.empty[String] |
392 |
var options = Options.init() |
|
393 |
var image_size = default_image_size |
|
65750 | 394 |
var verbose = false |
63688
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
395 |
|
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
396 |
val getopts = Getopts(""" |
65743 | 397 |
Usage: isabelle build_status [OPTIONS] |
63688
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
398 |
|
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
399 |
Options are: |
65737 | 400 |
-D DIR target directory (default """ + default_target_dir + """) |
65854 | 401 |
-M include full ML statistics |
63700 | 402 |
-S SESSIONS only given SESSIONS (comma separated) |
65736 | 403 |
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) |
65737 | 404 |
-s WxH size of PNG image (default """ + image_size._1 + "x" + image_size._2 + """) |
65750 | 405 |
-v verbose |
63688
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
406 |
|
65736 | 407 |
Present performance statistics from build log database, which is specified |
65782 | 408 |
via system options build_log_database_host, build_log_database_user, |
409 |
build_log_history etc. |
|
63688
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
410 |
""", |
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
411 |
"D:" -> (arg => target_dir = Path.explode(arg)), |
65854 | 412 |
"M" -> (_ => ml_statistics = true), |
63700 | 413 |
"S:" -> (arg => only_sessions = space_explode(',', arg).toSet), |
65736 | 414 |
"o:" -> (arg => options = options + arg), |
63700 | 415 |
"s:" -> (arg => |
63805 | 416 |
space_explode('x', arg).map(Value.Int.parse(_)) match { |
65736 | 417 |
case List(w, h) if w > 0 && h > 0 => image_size = (w, h) |
63700 | 418 |
case _ => error("Error bad PNG image size: " + quote(arg)) |
65750 | 419 |
}), |
420 |
"v" -> (_ => verbose = true)) |
|
63688
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
421 |
|
65736 | 422 |
val more_args = getopts(args) |
423 |
if (more_args.nonEmpty) getopts.usage() |
|
63700 | 424 |
|
65736 | 425 |
val progress = new Console_Progress |
63688
cc57255bf6ae
gnuplot presentation similar to former isatest-statistics;
wenzelm
parents:
63686
diff
changeset
|
426 |
|
65785 | 427 |
build_status(options, progress = progress, only_sessions = only_sessions, verbose = verbose, |
65854 | 428 |
target_dir = target_dir, ml_statistics = ml_statistics, image_size = image_size) |
65736 | 429 |
|
64161 | 430 |
}, admin = true) |
63686 | 431 |
} |