View Javadoc

1   package org.whatsitcalled.webflange.model;
2   
3   import java.io.Serializable;
4   
5   
6   
7   public class LoadTestSummary implements Serializable{
8   	public static final int TEST_SUMMARY_TYPE = 0;
9   	
10  	public static final int TOTALS_SUMMARY_TYPE = 1;
11  	
12  	private Long id;
13  	
14  	private LoadTestRun run;
15  	
16  	private int summaryType = TEST_SUMMARY_TYPE;
17  	
18  	private String testName;
19   
20  	private long tests;
21  
22  	private long errors;
23  
24  	private long meanTestTime;
25  
26  	private float testTimeStandardDeviation;
27  
28  	private long meanResponseLength;
29  
30  	private long responseBytesPerSecond;
31  
32  	private long responseErrors;
33  
34  	private long meanTimeToResolveHost;
35  
36  	private long meanTimeToEstablishConnection;
37  
38  	private long meanTimeToFirstByte;
39  
40  	private String testUri;
41  	
42  	public LoadTestSummary() {}
43  	
44  	public LoadTestSummary(int summaryType) {
45  		this.summaryType = summaryType;
46  	}
47  
48  	public long getErrors() {
49  		return errors;
50  	}
51  
52  	public void setErrors(long errors) {
53  		this.errors = errors;
54  	}
55  
56  	public long getMeanResponseLength() {
57  		return meanResponseLength;
58  	}
59  
60  	public void setMeanResponseLength(long meanResponseLength) {
61  		this.meanResponseLength = meanResponseLength;
62  	}
63  
64  	public long getMeanTestTime() {
65  		return meanTestTime;
66  	}
67  
68  	public void setMeanTestTime(long meanTestTime) {
69  		this.meanTestTime = meanTestTime;
70  	}
71  
72  	public long getMeanTimeToEstablishConnection() {
73  		return meanTimeToEstablishConnection;
74  	}
75  
76  	public void setMeanTimeToEstablishConnection(
77  			long meanTimeToEstablishConnection) {
78  		this.meanTimeToEstablishConnection = meanTimeToEstablishConnection;
79  	}
80  
81  	public long getMeanTimeToFirstByte() {
82  		return meanTimeToFirstByte;
83  	}
84  
85  	public void setMeanTimeToFirstByte(long meanTimeToFirstByte) {
86  		this.meanTimeToFirstByte = meanTimeToFirstByte;
87  	}
88  
89  	public long getMeanTimeToResolveHost() {
90  		return meanTimeToResolveHost;
91  	}
92  
93  	public void setMeanTimeToResolveHost(long meanTimeToResolveHost) {
94  		this.meanTimeToResolveHost = meanTimeToResolveHost;
95  	}
96  
97  	public long getResponseBytesPerSecond() {
98  		return responseBytesPerSecond;
99  	}
100 
101 	public void setResponseBytesPerSecond(long responseBytesPerSecond) {
102 		this.responseBytesPerSecond = responseBytesPerSecond;
103 	}
104 
105 	public long getResponseErrors() {
106 		return responseErrors;
107 	}
108 
109 	public void setResponseErrors(long responseErrors) {
110 		this.responseErrors = responseErrors;
111 	}
112 
113 	public String getTestName() {
114 		return testName;
115 	}
116 
117 	public void setTestName(String testName) {
118 		this.testName = testName;
119 	}
120 
121 	public long getTests() {
122 		return tests;
123 	}
124 
125 	public void setTests(long tests) {
126 		this.tests = tests;
127 	}
128 
129 	public float getTestTimeStandardDeviation() {
130 		return testTimeStandardDeviation;
131 	}
132 
133 	public void setTestTimeStandardDeviation(float testTimeStandardDeviation) {
134 		this.testTimeStandardDeviation = testTimeStandardDeviation;
135 	}
136 
137 	public String getTestUri() {
138 		return testUri;
139 	}
140 
141 	public void setTestUri(String testUri) {
142 		this.testUri = testUri;
143 	}
144 	
145 	public String toString() {
146 		StringBuffer sb = new StringBuffer("Grinder Summary for ");
147 		sb.append(testName);
148 		sb.append("\n[\n\tTests: ");
149 		sb.append(tests);
150 		sb.append("\n\tErrors: ");
151 		sb.append(errors);
152 		sb.append("\n\tMean test time: ");
153 		sb.append(meanTestTime);
154 		sb.append("\n\tTest Time Standard Deviation: ");
155 		sb.append(testTimeStandardDeviation);
156 		sb.append("\n\tMean Response Length: ");
157 		sb.append(meanResponseLength);
158 		sb.append("\n\tResponse Bytes per Second: ");
159 		sb.append(responseBytesPerSecond);
160 		sb.append("\n\tResponse Errors: ");
161 		sb.append(responseErrors);
162 		sb.append("\n\tMean Time to Resolve Host: ");
163 		sb.append(meanTimeToResolveHost);
164 		sb.append("\n\tMean Time to Establish Connection: ");
165 		sb.append(meanTimeToEstablishConnection);
166 		sb.append("\n\tMean Time to First Byte: ");
167 		sb.append(meanTimeToFirstByte);
168 		sb.append("\n]");
169 		
170 		return sb.toString();
171 		
172 	}
173 	
174 	public String toOvertimeSummaryString() {
175 		StringBuffer sb = new StringBuffer("Grinder Summary for ");
176 		sb.append(tests);
177 		sb.append("|");
178 		sb.append(errors);
179 		sb.append("|");
180 		sb.append(meanTestTime);
181 		sb.append("|");
182 		sb.append(testTimeStandardDeviation);
183 		sb.append("|");
184 		sb.append(meanResponseLength);
185 		sb.append("|");
186 		sb.append(responseBytesPerSecond);
187 		sb.append("|");
188 		sb.append(responseErrors);
189 		sb.append("|");
190 		sb.append(meanTimeToResolveHost);
191 		sb.append("|");
192 		sb.append(meanTimeToEstablishConnection);
193 		sb.append("|");
194 		sb.append(meanTimeToFirstByte);
195 		sb.append("/n");
196 		
197 		return sb.toString();
198 	}
199 
200 	public LoadTestRun getRun() {
201 		return run;
202 	}
203 
204 	public void setRun(LoadTestRun run) {
205 		this.run = run;
206 	}
207 
208 	public int getSummaryType() {
209 		return summaryType;
210 	}
211 
212 	public void setSummaryType(int summaryType) {
213 		this.summaryType = summaryType;
214 	}
215 
216 	public Long getId() {
217 		return id;
218 	}
219 
220 	public void setId(Long id) {
221 		this.id = id;
222 	}
223 }