View Javadoc
1 /* Reattore HTTP Server 2 3 Copyright (C) 2002 Michael Hope <michaelh@juju.net.nz> 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 19 $Id: ABResults.java,v 1.2 2003/03/03 05:14:39 michaelh Exp $ 20 */ 21 22 package juju.reattore.perfcap.tester.impl; 23 24 import java.util.*; 25 26 import org.apache.commons.beanutils.BeanUtils; 27 28 import juju.reattore.perfcap.tester.Results; 29 30 /*** Results from running ApacheBench. 31 */ 32 public class ABResults 33 implements Results { 34 35 /* 36 This is ApacheBench, Version 2.0.40-dev <$Revision: 1.2 $> apache-2.0 37 Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 38 Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ 39 40 Benchmarking 127.0.0.1 (be patient) 41 Finished 678 requests 42 43 44 Server Software: Boa/0.94.13 45 Server Hostname: 127.0.0.1 46 Server Port: 8080 47 48 Document Path: /index.html 49 Document Length: 1712 bytes 50 51 Concurrency Level: 1 52 Time taken for tests: 1.2087 seconds 53 Complete requests: 678 54 Failed requests: 0 55 Write errors: 0 56 Total transferred: 1290779 bytes 57 HTML transferred: 1162448 bytes 58 Requests per second: 676.59 [#/sec] (mean) 59 Time per request: 1.478 [ms] (mean) 60 Time per request: 1.478 [ms] (mean, across all concurrent requests) 61 Transfer rate: 1257.38 [Kbytes/sec] received 62 63 Connection Times (ms) 64 min mean[+/-sd] median max 65 Connect: 0 0 0.1 0 2 66 Processing: 0 0 1.4 1 24 67 Waiting: 0 0 0.6 0 14 68 Total: 0 0 1.5 1 24 69 70 Percentage of the requests served within a certain time (ms) 71 50% 1 72 66% 1 73 75% 1 74 80% 1 75 90% 1 76 95% 1 77 98% 2 78 99% 2 79 100% 24 (longest request) 80 */ 81 82 private int completedRequests; 83 private int concurrencyLevel; 84 private int documentLength; 85 private String documentPath; 86 private int failedRequests; 87 private int totalHtml; 88 private double requestsPerSecond; 89 private String serverHostname; 90 private int serverPort; 91 private String serverSoftware; 92 private double timePerRequest; 93 private double runTime; 94 private int totalBytes; 95 private double transferRate; 96 private int writeErrors; 97 98 private static final String[][] MAP_SEED = { 99 { "Complete requests", "completedRequests" }, 100 { "Concurrency Level", "concurrencyLevel" }, 101 { "Document Length", "documentLength" }, 102 { "Document Path", "documentPath" }, 103 { "Failed requests", "failedRequests" }, 104 { "HTML transferred", "totalHtml" }, 105 { "Requests per second", "requestsPerSecond" }, 106 { "Server Hostname", "serverHostname" }, 107 { "Server Port", "serverPort" }, 108 { "Server Software", "serverSoftware" }, 109 { "Time per request", "timePerRequest" }, 110 { "Time taken for tests", "runTime" }, 111 { "Total transferred", "totalBytes" }, 112 { "Transfer rate", "transferRate" }, 113 { "Write errors", "writeErrors" } 114 }; 115 116 private static final Map TO_FIELD = new HashMap(); 117 118 static { 119 for (int i = 0; i < MAP_SEED.length; i++) { 120 TO_FIELD.put(MAP_SEED[i][0], MAP_SEED[i][1]); 121 } 122 } 123 124 /*** Set a value. The name is of the direct 'Foo bar' form, and 125 the value is automatically converted into the bean name and 126 appropriate value. 127 128 @param name The 'Failed requests' form of the name. 129 @param value The value as a string. 130 */ 131 public void add(String name, String value) { 132 String field = (String)TO_FIELD.get(name); 133 134 if (field != null) { 135 try { 136 BeanUtils.setProperty(this, field, value); 137 } 138 catch (Exception ex) { 139 /* Discard */ 140 ex.printStackTrace(); 141 } 142 } 143 else { 144 /* Drop */ 145 } 146 } 147 148 /*** Completed requests. 149 150 @return Completed requests. 151 */ 152 public int getCompletedRequests() { 153 return completedRequests; 154 } 155 156 /*** Concurrency Level. 157 158 @return Concurrency Level. 159 */ 160 public int getConcurrencyLevel() { 161 return concurrencyLevel; 162 } 163 164 /*** Document Length. 165 166 @return Document Length. 167 */ 168 public int getDocumentLength() { 169 return documentLength; 170 } 171 172 /*** Document Path. 173 174 @return Document Path. 175 */ 176 public String getDocumentPath() { 177 return documentPath; 178 } 179 180 /*** Failed requests. 181 182 @return Failed requests. 183 */ 184 public int getFailedRequests() { 185 return failedRequests; 186 } 187 188 /*** HTML transferred. 189 190 @return HTML transferred. 191 */ 192 public int getTotalHtml() { 193 return totalHtml; 194 } 195 196 /*** Requests per second. 197 198 @return Requests per second. 199 */ 200 public double getRequestsPerSecond() { 201 return requestsPerSecond; 202 } 203 204 /*** Server Hostname. 205 206 @return Server Hostname. 207 */ 208 public String getServerHostname() { 209 return serverHostname; 210 } 211 212 /*** Server Port. 213 214 @return Server Port. 215 */ 216 public int getServerPort() { 217 return serverPort; 218 } 219 220 /*** Server Software. 221 222 @return Server Software. 223 */ 224 public String getServerSoftware() { 225 return serverSoftware; 226 } 227 228 /*** Time per request. 229 230 @return Time per request. 231 */ 232 public double getTimePerRequest() { 233 return timePerRequest; 234 } 235 236 /*** Time taken for tests. 237 238 @return Time taken for tests. 239 */ 240 public double getRunTime() { 241 return runTime; 242 } 243 244 /*** Total transferred. 245 246 @return Total transferred. 247 */ 248 public int getTotalBytes() { 249 return totalBytes; 250 } 251 252 /*** Transfer rate. 253 254 @return Transfer rate. 255 */ 256 public double getTransferRate() { 257 return transferRate; 258 } 259 260 /*** Write errors. 261 262 @return Write errors. 263 */ 264 public int getWriteErrors() { 265 return writeErrors; 266 } 267 }

This page was automatically generated by Maven