0N/A/*
2362N/A * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A/*
0N/A *
0N/A */
0N/A
0N/Apackage bench;
0N/A
0N/A/**
0N/A * Information about a benchmark: its name, how long it took to run, and the
0N/A * weight associated with it (for calculating the overall score).
0N/A */
0N/Apublic class BenchInfo {
0N/A
0N/A Benchmark benchmark;
0N/A String name;
0N/A long time;
0N/A float weight;
0N/A String[] args;
0N/A
0N/A /**
0N/A * Construct benchmark info.
0N/A */
0N/A BenchInfo(Benchmark benchmark, String name, float weight, String[] args) {
0N/A this.benchmark = benchmark;
0N/A this.name = name;
0N/A this.weight = weight;
0N/A this.args = args;
0N/A this.time = -1;
0N/A }
0N/A
0N/A /**
0N/A * Run benchmark with specified args. Called only by the harness.
0N/A */
0N/A void runBenchmark() throws Exception {
0N/A time = benchmark.run(args);
0N/A }
0N/A
0N/A /**
0N/A * Return the benchmark for this benchmark info.
0N/A */
0N/A public Benchmark getBenchmark() {
0N/A return benchmark;
0N/A }
0N/A
0N/A /**
0N/A * Return the name of this benchmark.
0N/A */
0N/A public String getName() {
0N/A return name;
0N/A }
0N/A
0N/A /**
0N/A * Return the execution time for benchmark, or -1 if benchmark hasn't been
0N/A * run to completion.
0N/A */
0N/A public long getTime() {
0N/A return time;
0N/A }
0N/A
0N/A /**
0N/A * Return weight associated with benchmark.
0N/A */
0N/A public float getWeight() {
0N/A return weight;
0N/A }
0N/A}