Lines 35-47
public class Sample {
Link Here
|
35 |
private static final String ERROR_ON_SAMPLE = "Error in sample at line:"; |
35 |
private static final String ERROR_ON_SAMPLE = "Error in sample at line:"; |
36 |
|
36 |
|
37 |
private static final String CONTROLLER_PATTERN = "Number of samples in transaction"; |
37 |
private static final String CONTROLLER_PATTERN = "Number of samples in transaction"; |
38 |
|
38 |
|
39 |
private static final String EMPTY_CONTROLLER_PATTERN = "Number of samples in transaction : 0"; |
39 |
private static final String EMPTY_CONTROLLER_PATTERN = "Number of samples in transaction : 0"; |
40 |
|
40 |
|
41 |
private final boolean storesStartTimeStamp; |
41 |
private final boolean storesStartTimeStamp; |
42 |
private final SampleMetadata metadata; |
42 |
private final SampleMetadata metadata; |
43 |
private final String[] data; |
43 |
private final String[] data; |
44 |
private final long row; |
44 |
private final long row; |
|
|
45 |
private final long elapsedTime; |
46 |
private final long timestamp; |
47 |
private final long latency; |
48 |
private final long connectTime; |
49 |
private final long receivedBytes; |
50 |
private final long sentBytes; |
51 |
private final int groupThreads; |
52 |
private final boolean success; |
45 |
|
53 |
|
46 |
/** |
54 |
/** |
47 |
* Build a sample from a string array |
55 |
* Build a sample from a string array |
Lines 59-64
public class Sample {
Link Here
|
59 |
this.metadata = metadata; |
67 |
this.metadata = metadata; |
60 |
this.data = data; |
68 |
this.data = data; |
61 |
this.storesStartTimeStamp = JMeterUtils.getPropDefault("sampleresult.timestamp.start", false); |
69 |
this.storesStartTimeStamp = JMeterUtils.getPropDefault("sampleresult.timestamp.start", false); |
|
|
70 |
this.elapsedTime = getData(long.class, CSVSaveService.CSV_ELAPSED).longValue(); |
71 |
this.timestamp = getData(long.class, CSVSaveService.TIME_STAMP).longValue(); |
72 |
this.latency = getData(long.class, CSVSaveService.CSV_LATENCY).longValue(); |
73 |
this.connectTime = metadata.indexOf(CSVSaveService.CSV_CONNECT_TIME) >= 0 ? getData(long.class, CSVSaveService.CSV_CONNECT_TIME).longValue() : 0L; |
74 |
this.success = getData(boolean.class, CSVSaveService.SUCCESSFUL).booleanValue(); |
75 |
this.receivedBytes = getData(long.class, CSVSaveService.CSV_BYTES).longValue(); |
76 |
this.sentBytes = metadata.indexOf(CSVSaveService.CSV_SENT_BYTES) >= 0 ? getData(long.class, CSVSaveService.CSV_SENT_BYTES).longValue() : 0L; |
77 |
this.groupThreads = getData(int.class, CSVSaveService.CSV_THREAD_COUNT1).intValue(); |
62 |
} |
78 |
} |
63 |
|
79 |
|
64 |
/** |
80 |
/** |
Lines 148-154
public class Sample {
Link Here
|
148 |
* @return the time stamp |
164 |
* @return the time stamp |
149 |
*/ |
165 |
*/ |
150 |
public long getTimestamp() { |
166 |
public long getTimestamp() { |
151 |
return getData(long.class, CSVSaveService.TIME_STAMP).longValue(); |
167 |
return this.timestamp; |
152 |
} |
168 |
} |
153 |
|
169 |
|
154 |
/** |
170 |
/** |
Lines 157-163
public class Sample {
Link Here
|
157 |
* @return the elapsed time stored in the sample |
173 |
* @return the elapsed time stored in the sample |
158 |
*/ |
174 |
*/ |
159 |
public long getElapsedTime() { |
175 |
public long getElapsedTime() { |
160 |
return getData(long.class, CSVSaveService.CSV_ELAPSED).longValue(); |
176 |
return this.elapsedTime; |
161 |
} |
177 |
} |
162 |
|
178 |
|
163 |
/** |
179 |
/** |
Lines 242-261
public class Sample {
Link Here
|
242 |
* @return the latency stored in the sample |
258 |
* @return the latency stored in the sample |
243 |
*/ |
259 |
*/ |
244 |
public long getLatency() { |
260 |
public long getLatency() { |
245 |
return getData(long.class, CSVSaveService.CSV_LATENCY).longValue(); |
261 |
return this.latency; |
246 |
} |
262 |
} |
247 |
|
263 |
|
248 |
/** |
264 |
/** |
249 |
* Gets the connect time stored in the sample. |
265 |
* Gets the connect time stored in the sample. |
250 |
* |
266 |
* |
251 |
* @return the connect time stored in the sample or 0 is column is not in results |
267 |
* @return the connect time stored in the sample or 0 is column is not in results |
252 |
*/ |
268 |
*/ |
253 |
public long getConnectTime() { |
269 |
public long getConnectTime() { |
254 |
if(metadata.indexOf(CSVSaveService.CSV_CONNECT_TIME) >= 0) { |
270 |
return this.connectTime; |
255 |
return getData(long.class, CSVSaveService.CSV_CONNECT_TIME).longValue(); |
|
|
256 |
} else { |
257 |
return 0L; |
258 |
} |
259 |
} |
271 |
} |
260 |
|
272 |
|
261 |
/** |
273 |
/** |
Lines 264-270
public class Sample {
Link Here
|
264 |
* @return the success status stored in the sample |
276 |
* @return the success status stored in the sample |
265 |
*/ |
277 |
*/ |
266 |
public boolean getSuccess() { |
278 |
public boolean getSuccess() { |
267 |
return getData(boolean.class, CSVSaveService.SUCCESSFUL).booleanValue(); |
279 |
return this.success; |
268 |
} |
280 |
} |
269 |
|
281 |
|
270 |
/** |
282 |
/** |
Lines 273-279
public class Sample {
Link Here
|
273 |
* @return the number of received bytes stored in the sample |
285 |
* @return the number of received bytes stored in the sample |
274 |
*/ |
286 |
*/ |
275 |
public long getReceivedBytes() { |
287 |
public long getReceivedBytes() { |
276 |
return getData(long.class, CSVSaveService.CSV_BYTES).longValue(); |
288 |
return this.receivedBytes; |
277 |
} |
289 |
} |
278 |
|
290 |
|
279 |
/** |
291 |
/** |
Lines 282-292
public class Sample {
Link Here
|
282 |
* @return the number of sent bytes stored in the sample |
294 |
* @return the number of sent bytes stored in the sample |
283 |
*/ |
295 |
*/ |
284 |
public long getSentBytes() { |
296 |
public long getSentBytes() { |
285 |
if(metadata.indexOf(CSVSaveService.CSV_SENT_BYTES) >= 0) { |
297 |
return this.sentBytes; |
286 |
return getData(long.class, CSVSaveService.CSV_SENT_BYTES).longValue(); |
|
|
287 |
} else { |
288 |
return 0L; |
289 |
} |
290 |
} |
298 |
} |
291 |
|
299 |
|
292 |
/** |
300 |
/** |
Lines 295-301
public class Sample {
Link Here
|
295 |
* @return the number of threads in the group of this sample |
303 |
* @return the number of threads in the group of this sample |
296 |
*/ |
304 |
*/ |
297 |
public int getGroupThreads() { |
305 |
public int getGroupThreads() { |
298 |
return getData(int.class, CSVSaveService.CSV_THREAD_COUNT1).intValue(); |
306 |
return this.groupThreads; |
299 |
} |
307 |
} |
300 |
|
308 |
|
301 |
/** |
309 |
/** |
302 |
- |
|
|