1 package org.apache.lucene.benchmark.byTask.tasks;
4 * Licensed to the Apache Software Foundation (ASF) under one or more
5 * contributor license agreements. See the NOTICE file distributed with
6 * this work for additional information regarding copyright ownership.
7 * The ASF licenses this file to You under the Apache License, Version 2.0
8 * (the "License"); you may not use this file except in compliance with
9 * the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 import java.util.List;
22 import org.apache.lucene.benchmark.byTask.PerfRunData;
23 import org.apache.lucene.benchmark.byTask.stats.Report;
24 import org.apache.lucene.benchmark.byTask.stats.TaskStats;
27 * Report all statistics with no aggregations.
28 * <br>Other side effects: None.
30 public class RepAllTask extends ReportTask {
32 public RepAllTask(PerfRunData runData) {
37 public int doLogic() throws Exception {
38 Report rp = reportAll(getRunData().getPoints().taskStats());
41 System.out.println("------------> Report All ("+rp.getSize()+" out of "+rp.getOutOf()+")");
42 System.out.println(rp.getText());
48 * Report detailed statistics as a string
51 protected Report reportAll(List<TaskStats> taskStats) {
52 String longestOp = longestOp(taskStats);
54 StringBuilder sb = new StringBuilder();
55 sb.append(tableTitle(longestOp));
58 for (final TaskStats stat : taskStats) {
59 if (stat.getElapsed()>=0) { // consider only tasks that ended
64 String line = taskReportLine(longestOp, stat);
66 if (taskStats.size()>2 && reported%2==0) {
67 line = line.replaceAll(" "," - ");
72 String reptxt = (reported==0 ? "No Matching Entries Were Found!" : sb.toString());
73 return new Report(reptxt,reported,reported,taskStats.size());