1 | StatVisualizer() {↵ | | 1 | SummaryReport() {↵
|
2 | super();↵ | | 2 | super();↵
|
3 | model = new ObjectTableModel(COLUMNS, ↵ | | 3 | model = new ObjectTableModel(COLUMNS,↵
|
4 | SamplingStatCalculator.class,↵ | | 4 | Calculator.class,// All rows have this 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("getMedian"), //$NON-NLS-1$↵ | | 9 | new Functor("getMin"), ↵
|
10 | new Functor("getPercentPoint", //$NON-NLS-1$↵ | | 10 | //$NON-NLS-1$↵
|
11 | new Object[] { new Float(.900) }), ↵ | | 11 | new Functor("getMax"), ↵
|
12 | new Functor("getMin"), //$NON-NLS-1$↵ | | 12 | //$NON-NLS-1$↵
|
13 | new Functor("getMax"), //$NON-NLS-1$↵ | | 13 | new Functor("getStandardDeviation"), //$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")↵ | | 16 | new Functor("getKBPerSecond"), //$NON-NLS-1$↵
|
17 | //$NON-NLS-1$↵ | | 17 | new Functor("getAvgPageBytes"), //$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 | Long.class, Long.class, String.class, String.class, String.class });↵ | | 21 | String.class, String.class, String.class, String.class, String.class });↵
|
22 | clearData();↵ | | 22 | clearData();↵
|
23 | init();↵ | | 23 | init();↵
|
24 | }↵ | | 24 | }↵
|
|
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 | };↵ | | |
|
| | | 25 | ↵
|
39 | public static boolean testFunctors(){↵ | | 26 | public static boolean testFunctors(){↵
|
40 | StatVisualizer instance = new StatVisualizer();↵ | | 27 | SummaryReport instance = new SummaryReport();↵
|
41 | return instance.model.checkFunctors(null,instance.getClass());↵ | | 28 | return instance.model.checkFunctors(null,instance.getClass());↵
|
42 | }↵ | | 29 | }↵
|
43 | ↵ | | 30 | ↵
|
44 | public String getLabelResource() {↵ | | 31 | public String getLabelResource() {↵
|
45 | return "aggregate_report"; //$NON-NLS-1$↵ | | 32 | return "summary_report"; //$NON-NLS-1$↵
|
46 | }↵ | | 33 | }↵
|
|
47 | public void add(SampleResult res) {↵ | | 34 | public void add(SampleResult res) {↵
|
48 | SamplingStatCalculator row = null;↵ | | 35 | Calculator row = null;↵
|
49 | final String sampleLabel = res.getSampleLabel(useGroupName.isSelected());↵ | | 36 | final String sampleLabel = res.getSampleLabel(useGroupName.isSelected());↵
|
50 | synchronized (tableRows) {↵ | | 37 | synchronized (tableRows) {↵
|
51 | row = (SamplingStatCalculator) tableRows.get(sampleLabel);↵ | | 38 | row = (Calculator) tableRows.get(sampleLabel);↵
|
52 | if (row == null) {↵ | | 39 | if (row == null) {↵
|
53 | row = new SamplingStatCalculator(sampleLabel);↵ | | 40 | row = new Calculator(sampleLabel);↵
|
54 | tableRows.put(row.getLabel(), row);↵ | | 41 | tableRows.put(row.getLabel(), row);↵
|
55 | model.insertRow(row, model.getRowCount() - 1);↵ | | 42 | model.insertRow(row, model.getRowCount() - 1);↵
|
56 | }↵ | | 43 | }↵
|
57 | }↵ | | 44 | }↵
|
58 | /*↵ | | |
|
59 | ↵ | | 45 | /*↵
|
60 | * Synch is needed because multiple threads can update the counts.↵ | | 46 | * Synch is needed because multiple threads can update the counts.↵
|
61 | */↵ | | |
|
62 | ↵ | | 47 | */↵
|
63 | synchronized(row) { ↵ | | 48 | synchronized(row) {↵
|
64 | row.addSample(res);↵ | | 49 | row.addSample(res);↵
|
65 | }↵ | | |
|
66 | SamplingStat↵ | | 50 | }↵
|
67 | Calculator tot | | 51 | Calculator tot
|