15 import org.jfree.chart.renderer.xy.{XYBarRenderer, StandardXYBarPainter} |
15 import org.jfree.chart.renderer.xy.{XYBarRenderer, StandardXYBarPainter} |
16 |
16 |
17 |
17 |
18 object Task_Statistics |
18 object Task_Statistics |
19 { |
19 { |
20 def apply(name: String, tasks: List[Properties.T]): Task_Statistics = |
20 def apply(session_name: String, task_statistics: List[Properties.T]): Task_Statistics = |
21 new Task_Statistics(name, tasks) |
21 new Task_Statistics(session_name, task_statistics) |
22 |
22 |
23 def apply(info: Build.Log_Info): Task_Statistics = |
23 def apply(info: Build.Session_Log_Info): Task_Statistics = |
24 apply(info.name, info.tasks) |
24 apply(info.session_name, info.task_statistics) |
25 } |
25 } |
26 |
26 |
27 final class Task_Statistics private(val name: String, val tasks: List[Properties.T]) |
27 final class Task_Statistics private( |
|
28 val session_name: String, val task_statistics: List[Properties.T]) |
28 { |
29 { |
29 private val Task_Name = new Properties.String("task_name") |
30 private val Task_Name = new Properties.String("task_name") |
30 private val Run = new Properties.Int("run") |
31 private val Run = new Properties.Int("run") |
31 |
32 |
32 def chart(bins: Int = 100): JFreeChart = |
33 def chart(bins: Int = 100): JFreeChart = |
33 { |
34 { |
34 val values = new Array[Double](tasks.length) |
35 val values = new Array[Double](task_statistics.length) |
35 for ((Run(x), i) <- tasks.iterator.zipWithIndex) |
36 for ((Run(x), i) <- task_statistics.iterator.zipWithIndex) |
36 values(i) = java.lang.Math.log10((x max 1).toDouble / 1000000) |
37 values(i) = java.lang.Math.log10((x max 1).toDouble / 1000000) |
37 |
38 |
38 val data = new HistogramDataset |
39 val data = new HistogramDataset |
39 data.addSeries("tasks", values, bins) |
40 data.addSeries("tasks", values, bins) |
40 |
41 |