1 | SummaryReport() {↵ | | 1 | StatVisualizer() {↵
|
2 | super();↵ | | 2 | super();↵
|
3 | model = new ObjectTableModel(COLUMNS,↵ | | 3 | model = new ObjectTableModel(COLUMNS, ↵
|
4 | Calculator.class,// All rows have this class↵ | | 4 | SamplingStatCalculator.class,↵
|
5 | new Functor[] { ↵ | | 5 | new Functor[] { ↵
|
6 | new Functor("getLabel"), //$NON-NLS-1$↵ | | 6 | new Functor("getLabel"), //$NON-NLS-1$↵
|
7 | new Functor("getCount"), //$NON-NLS-1$↵ | | 7 | new Functor("getCount"), //$NON-NLS-1$↵
|
8 | new Functor("getMeanAsNumber"), //$NON-NLS-1$↵ | | 8 | new Functor("getMeanAsNumber"), //$NON-NLS-1$↵
|
9 | new Functor("getMin"), ↵ | | 9 | new Functor("getMedian"), //$NON-NLS-1$↵
|
10 | //$NON-NLS-1$↵ | | 10 | new Functor("getPercentPoint", //$NON-NLS-1$↵
|
11 | new Functor("getMax"), ↵ | | 11 | new Object[] { new Float(.900) }), ↵
|
12 | //$NON-NLS-1$↵ | | 12 | new Functor("getMin"), //$NON-NLS-1$↵
|
13 | new Functor("getStandardDeviation"), //$NON-NLS-1$↵ | | 13 | new Functor("getMax"), //$NON-NLS-1$↵
|
14 | new Functor("getErrorPercentage"), //$NON-NLS-1$↵ | | 14 | new Functor("getErrorPercentage"), //$NON-NLS-1$↵
|
15 | new Functor("getRate"), //$NON-NLS-1$↵ | | 15 | new Functor("getRate"), //$NON-NLS-1$↵
|
16 | new Functor("getKBPerSecond"), //$NON-NLS-1$↵ | | 16 | new Functor("getKBPerSecond")↵
|
17 | new Functor("getAvgPageBytes"), //$NON-NLS-1$↵ | | 17 | //$NON-NLS-1$↵
|
18 | },↵ | | 18 | },↵
|
19 | new Functor[] { null, null, null, null, null, null, null, null , null, null }, ↵ | | 19 | new Functor[] { null, null, null, null, null, null, null, null, null, null }, ↵
|
20 | new Class[] { String.class, Long.class, Long.class, Long.class, Long.class, ↵ | | 20 | new Class[] { String.class, Long.class, Long.class, Long.class, Long.class, ↵
|
21 | String.class, String.class, String.class, String.class, String.class });↵ | | 21 | Long.class, Long.class, String.class, String.class, String.class });↵
|
22 | clearData();↵ | | 22 | clearData();↵
|
23 | init();↵ | | 23 | init();↵
|
24 | }↵ | | 24 | }↵
|
25 | ↵ | | |
|
| | | 25 | // Column renderers↵
|
| | | 26 | private static final TableCellRenderer[] RENDERERS = ↵
|
| | | 27 | new TableCellRenderer[]{↵
|
| | | 28 | null, // Label↵
|
| | | 29 | null, // count↵
|
| | | 30 | null, // Mean↵
|
| | | 31 | null, // median↵
|
| | | 32 | null, // 90%↵
|
| | | 33 | null, // Min↵
|
| | | 34 | null, // Max↵
|
| | | 35 | new NumberRenderer("#0.00%"), // Error %age //$NON-NLS-1$↵
|
| | | 36 | new RateRenderer("#.0"), // Throughput //$NON-NLS-1$↵
|
| | | 37 | new NumberRenderer("#.0"), // pageSize //$NON-NLS-1$↵
|
| | | 38 | };↵
|
|
26 | public static boolean testFunctors(){↵ | | 39 | public static boolean testFunctors(){↵
|
27 | SummaryReport instance = new SummaryReport();↵ | | 40 | StatVisualizer instance = new StatVisualizer();↵
|
28 | return instance.model.checkFunctors(null,instance.getClass());↵ | | 41 | return instance.model.checkFunctors(null,instance.getClass());↵
|
29 | }↵ | | 42 | }↵
|
30 | ↵ | | 43 | ↵
|
31 | public String getLabelResource() {↵ | | 44 | public String getLabelResource() {↵
|
32 | return "summary_report"; //$NON-NLS-1$↵ | | 45 | return "aggregate_report"; //$NON-NLS-1$↵
|
33 | }↵ | | 46 | }↵
|
|
34 | public void add(SampleResult res) {↵ | | 47 | public void add(SampleResult res) {↵
|
35 | Calculator row = null;↵ | | 48 | SamplingStatCalculator row = null;↵
|
36 | final String sampleLabel = res.getSampleLabel(useGroupName.isSelected());↵ | | 49 | final String sampleLabel = res.getSampleLabel(useGroupName.isSelected());↵
|
37 | synchronized (tableRows) {↵ | | 50 | synchronized (tableRows) {↵
|
38 | row = (Calculator) tableRows.get(sampleLabel);↵ | | 51 | row = (SamplingStatCalculator) tableRows.get(sampleLabel);↵
|
39 | if (row == null) {↵ | | 52 | if (row == null) {↵
|
40 | row = new Calculator(sampleLabel);↵ | | 53 | row = new SamplingStatCalculator(sampleLabel);↵
|
41 | tableRows.put(row.getLabel(), row);↵ | | 54 | tableRows.put(row.getLabel(), row);↵
|
42 | model.insertRow(row, model.getRowCount() - 1);↵ | | 55 | model.insertRow(row, model.getRowCount() - 1);↵
|
43 | }↵ | | 56 | }↵
|
44 | }↵ | | 57 | }↵
|
45 | /*↵ | | |
|
46 | ↵ | | 58 | /*↵
|
47 | * Synch is needed because multiple threads can update the counts.↵ | | 59 | * Synch is needed because multiple threads can update the counts.↵
|
48 | */↵ | | |
|
49 | ↵ | | 60 | */↵
|
50 | synchronized(row) {↵ | | 61 | synchronized(row) { ↵
|
51 | row.addSample(res);↵ | | 62 | row.addSample(res);↵
|
52 | }↵ | | |
|
53 | ↵ | | 63 | }↵
|
54 | Calculator tot = | | 64 | SamplingStatCalculator tot =
|