KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > test > internal > performance > db > View


1 /*******************************************************************************
2  * Copyright (c) 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.test.internal.performance.db;
12
13 import java.io.BufferedOutputStream JavaDoc;
14 import java.io.FileNotFoundException JavaDoc;
15 import java.io.FileOutputStream JavaDoc;
16 import java.io.PrintStream JavaDoc;
17
18 import org.eclipse.test.internal.performance.PerformanceTestPlugin;
19
20 /**
21  * Dumps performance data to stdout.
22  */

23 public class View {
24
25     public static void main(String JavaDoc[] args) {
26         
27         Variations variations= PerformanceTestPlugin.getVariations();
28         variations.put("config", "relengbuildwin2"); //$NON-NLS-1$//$NON-NLS-2$
29
variations.put("build", "I%"); //$NON-NLS-1$//$NON-NLS-2$
30

31         String JavaDoc scenarioPattern= "%RevertJavaEditorTest%"; //$NON-NLS-1$
32

33         String JavaDoc seriesKey= "build"; //$NON-NLS-1$
34

35
36         String JavaDoc outFile= null;
37         // outfile= "/tmp/dbdump"; //$NON-NLS-1$
38
PrintStream JavaDoc ps= null;
39         if (outFile != null) {
40             try {
41                 ps= new PrintStream JavaDoc(new BufferedOutputStream JavaDoc(new FileOutputStream JavaDoc(outFile)));
42             } catch (FileNotFoundException JavaDoc e) {
43                 System.err.println("can't create output file"); //$NON-NLS-1$
44
}
45         }
46         if (ps == null)
47             ps= System.out;
48
49         Scenario[] scenarios= DB.queryScenarios(variations, scenarioPattern, seriesKey, null);
50         ps.println(scenarios.length + " Scenarios"); //$NON-NLS-1$
51
ps.println();
52
53         for (int s= 0; s < scenarios.length; s++)
54             scenarios[s].dump(ps, PerformanceTestPlugin.BUILD);
55
56         if (ps != System.out)
57             ps.close();
58     }
59 }
60
Popular Tags