1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 package org.apache.hc.core5.benchmark;
28
29 import org.apache.hc.core5.http.ProtocolVersion;
30
31
32
33
34
35
36 public final class Results {
37
38 private final String serverName;
39 private final ProtocolVersion protocolVersion;
40 private final String hostName;
41 private final int hostPort;
42 private final String documentPath;
43 private final long contentLength;
44 private final int concurrencyLevel;
45 private final long totalTimeMillis;
46 private final long successCount;
47 private final long failureCount;
48 private final long keepAliveCount;
49 private final long totalBytesRcvd;
50 private final long totalBytesSent;
51 private final long totalContentBytesRecvd;
52
53 public Results(
54 final String serverName,
55 final ProtocolVersion protocolVersion,
56 final String hostName,
57 final int hostPort,
58 final String documentPath,
59 final long contentLength,
60 final int concurrencyLevel,
61 final long totalTimeMillis,
62 final long successCount,
63 final long failureCount,
64 final long keepAliveCount,
65 final long totalBytesRcvd,
66 final long totalBytesSent,
67 final long totalContentBytesRecvd) {
68 this.serverName = serverName;
69 this.protocolVersion = protocolVersion;
70 this.hostName = hostName;
71 this.hostPort = hostPort;
72 this.documentPath = documentPath;
73 this.contentLength = contentLength;
74 this.concurrencyLevel = concurrencyLevel;
75 this.totalTimeMillis = totalTimeMillis;
76 this.successCount = successCount;
77 this.failureCount = failureCount;
78 this.keepAliveCount = keepAliveCount;
79 this.totalBytesRcvd = totalBytesRcvd;
80 this.totalBytesSent = totalBytesSent;
81 this.totalContentBytesRecvd = totalContentBytesRecvd;
82 }
83
84 public String getServerName() {
85 return serverName;
86 }
87
88 public ProtocolVersion getProtocolVersion() {
89 return protocolVersion;
90 }
91
92 public String getHostName() {
93 return hostName;
94 }
95
96 public int getHostPort() {
97 return hostPort;
98 }
99
100 public String getDocumentPath() {
101 return documentPath;
102 }
103
104 public long getContentLength() {
105 return contentLength;
106 }
107
108 public int getConcurrencyLevel() {
109 return concurrencyLevel;
110 }
111
112 public long getTotalTimeMillis() {
113 return totalTimeMillis;
114 }
115
116 public long getSuccessCount() {
117 return successCount;
118 }
119
120 public long getFailureCount() {
121 return failureCount;
122 }
123
124 public long getKeepAliveCount() {
125 return keepAliveCount;
126 }
127
128 public long getTotalBytesRcvd() {
129 return totalBytesRcvd;
130 }
131
132 public long getTotalBytesSent() {
133 return totalBytesSent;
134 }
135
136 public long getTotalContentBytesRecvd() {
137 return totalContentBytesRecvd;
138 }
139
140 @Override
141 public String toString() {
142 final StringBuilder builder = new StringBuilder();
143 builder.append("[serverName=").append(serverName)
144 .append(", hostName=").append(hostName)
145 .append(", hostPort=").append(hostPort)
146 .append(", documentPath=").append(documentPath)
147 .append(", contentLength=").append(contentLength)
148 .append(", concurrencyLevel=").append(concurrencyLevel)
149 .append(", totalTimeMillis=").append(totalTimeMillis)
150 .append(", successCount=").append(successCount)
151 .append(", failureCount=").append(failureCount)
152 .append(", keepAliveCount=").append(keepAliveCount)
153 .append(", totalBytesRcvd=").append(totalBytesRcvd)
154 .append(", totalBytesSent=").append(totalBytesSent)
155 .append(", totalContentBytesRecvd=").append(totalContentBytesRecvd)
156 .append("]");
157 return builder.toString();
158 }
159
160 }