Path: blob/master/test/jdk/java/rmi/reliability/benchmark/bench/BenchInfo.java
41161 views
/*1* Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/*24*25*/2627package bench;2829/**30* Information about a benchmark: its name, how long it took to run, and the31* weight associated with it (for calculating the overall score).32*/33public class BenchInfo {3435Benchmark benchmark;36String name;37long time;38float weight;39String[] args;4041/**42* Construct benchmark info.43*/44BenchInfo(Benchmark benchmark, String name, float weight, String[] args) {45this.benchmark = benchmark;46this.name = name;47this.weight = weight;48this.args = args;49this.time = -1;50}5152/**53* Run benchmark with specified args. Called only by the harness.54*/55void runBenchmark() throws Exception {56time = benchmark.run(args);57}5859/**60* Return the benchmark for this benchmark info.61*/62public Benchmark getBenchmark() {63return benchmark;64}6566/**67* Return the name of this benchmark.68*/69public String getName() {70return name;71}7273/**74* Return the execution time for benchmark, or -1 if benchmark hasn't been75* run to completion.76*/77public long getTime() {78return time;79}8081/**82* Return weight associated with benchmark.83*/84public float getWeight() {85return weight;86}87}888990