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(stats: List[Properties.T]): Task_Statistics = new Task_Statistics(stats) |
20 def apply(name: String, tasks: List[Properties.T]): Task_Statistics = |
|
21 new Task_Statistics(name, tasks) |
|
22 |
|
23 def apply(info: Build.Log_Info): Task_Statistics = |
|
24 apply(info.name, info.tasks) |
21 } |
25 } |
22 |
26 |
23 final class Task_Statistics private(val stats: List[Properties.T]) |
27 final class Task_Statistics private(val name: String, val tasks: List[Properties.T]) |
24 { |
28 { |
25 val Task_Name = new Properties.String("task_name") |
29 private val Task_Name = new Properties.String("task_name") |
26 val Run = new Properties.Int("run") |
30 private val Run = new Properties.Int("run") |
27 |
31 |
28 def chart(bins: Int = 100): JFreeChart = |
32 def chart(bins: Int = 100): JFreeChart = |
29 { |
33 { |
30 val values = new Array[Double](stats.length) |
34 val values = new Array[Double](tasks.length) |
31 for ((Run(x), i) <- stats.iterator.zipWithIndex) values(i) = |
35 for ((Run(x), i) <- tasks.iterator.zipWithIndex) values(i) = |
32 Math.log10(x.toDouble / 1000000) |
36 Math.log10(x.toDouble / 1000000) |
33 |
37 |
34 val data = new HistogramDataset |
38 val data = new HistogramDataset |
35 data.addSeries("tasks", values, bins) |
39 data.addSeries("tasks", values, bins) |
36 |
40 |