|
What this is
Other links
The source code/******************************************************************************* * Copyright (c) 2005, 2006 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.test.performance.ui; import java.io.PrintStream; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.eclipse.test.internal.performance.data.Dim; import org.eclipse.test.internal.performance.results.AbstractResults; import org.eclipse.test.internal.performance.results.BuildResults; import org.eclipse.test.internal.performance.results.ConfigResults; /** * Class used to fill details file of scenario builds data. * @see ScenarioData */ public class RawDataTable { private ConfigResults configResults; private List buildPrefixes; private PrintStream stream; private Dim[] dimensions = AbstractResults.SUPPORTED_DIMS; private boolean debug = false; private RawDataTable(ConfigResults results, PrintStream ps) { this.configResults = results; this.stream = ps; } public RawDataTable(ConfigResults results, List prefixes, PrintStream ps) { this(results, ps); this.buildPrefixes = prefixes; } public RawDataTable(ConfigResults results, String baselinePrefix, PrintStream ps) { this(results, ps); this.buildPrefixes = new ArrayList(); this.buildPrefixes.add(baselinePrefix); } /** * Print all build data to the current stream. */ public void print(){ stream.print("<table border=\"1\">"); printSummary(); printDetails(); stream.println("</table>"); } /* * Print table columns headers. */ private void printColumnHeaders() { StringBuffer buffer = new StringBuffer(); int length = this.dimensions.length; for (int i=0; i<length; i++) { buffer.append("<td>"); buffer.append(this.dimensions[i].getName()); buffer.append("</b> | Build ID | "); stream.print(buildResults.getName()); stream.print("</td>"); int dimLength = this.dimensions.length; for (int d=0; d<dimLength; d++) { int dim_id = this.dimensions[d].getId(); double value = buildResults.getValue(dim_id); printDimTitle(this.dimensions[d].getName()); String displayValue = this.dimensions[d].getDisplayValue(value); stream.print(displayValue); if (debug) System.out.print("\t"+displayValue); stream.print("</td>"); } if (debug) System.out.println(); stream.println("</tr>"); } if (debug) System.out.println("\n"); } /* * Print summary on top of the table. */ private void printSummary() { stream.print("<tr> | Stats | #BUILDS SAMPLED | MEAN | STD DEV | COEF. VAR |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.