Source Code Cross Referenced for Sample.java in  » Testing » jakarta-jmeter » org » apache » jmeter » visualizers » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » jakarta jmeter » org.apache.jmeter.visualizers 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         *
009:         *   http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         * 
017:         */
018:
019:        package org.apache.jmeter.visualizers;
020:
021:        import java.io.Serializable;
022:        import java.text.Format;
023:        import java.util.Date;
024:
025:        /**
026:         * @author Michael Stover
027:         * @version 1.0
028:         */
029:
030:        public class Sample implements  Serializable, Comparable {
031:            private final long data; // = elapsed
032:
033:            private final long average;
034:
035:            private final long median;
036:
037:            private final long distributionLine; // TODO: what is this for?
038:
039:            private final long deviation;
040:
041:            private final double throughput;
042:
043:            private final long errorCount;
044:
045:            private final boolean success;
046:
047:            private final String label;
048:
049:            private final String threadName;
050:
051:            private final long count;
052:
053:            private final long endTime;
054:
055:            private final int bytes;
056:
057:            // TODO - is this used?
058:            public Sample(long data, long average, long deviation,
059:                    double throughput, long median, boolean success) {
060:                this (null, data, average, deviation, median, 0, throughput, 0,
061:                        success, 0, 0);
062:            }
063:
064:            // TODO - is this used?
065:            public Sample(long data) {
066:                this (null, data, 0, 0, 0, 0, 0, 0, false, 0, 0);
067:            }
068:
069:            public Sample(String name, long data, long average, long deviation,
070:                    long median, long distributionLine, double throughput,
071:                    long errorCount, boolean success, long num, long endTime) {
072:                this .data = data;
073:                this .average = average;
074:                this .deviation = deviation;
075:                this .throughput = throughput;
076:                this .success = success;
077:                this .median = median;
078:                this .distributionLine = distributionLine;
079:                this .label = name;
080:                this .errorCount = errorCount;
081:                this .count = num;
082:                this .endTime = endTime;
083:                this .bytes = 0;
084:                this .threadName = "";
085:            }
086:
087:            public Sample(String name, long data, long average, long deviation,
088:                    long median, long distributionLine, double throughput,
089:                    long errorCount, boolean success, long num, long endTime,
090:                    int bytes) {
091:                this .data = data;
092:                this .average = average;
093:                this .deviation = deviation;
094:                this .throughput = throughput;
095:                this .success = success;
096:                this .median = median;
097:                this .distributionLine = distributionLine;
098:                this .label = name;
099:                this .errorCount = errorCount;
100:                this .count = num;
101:                this .endTime = endTime;
102:                this .bytes = bytes;
103:                this .threadName = "";
104:            }
105:
106:            public Sample(String name, long data, long average, long deviation,
107:                    long median, long distributionLine, double throughput,
108:                    long errorCount, boolean success, long num, long endTime,
109:                    int bytes, String threadName) {
110:                this .data = data;
111:                this .average = average;
112:                this .deviation = deviation;
113:                this .throughput = throughput;
114:                this .success = success;
115:                this .median = median;
116:                this .distributionLine = distributionLine;
117:                this .label = name;
118:                this .errorCount = errorCount;
119:                this .count = num;
120:                this .endTime = endTime;
121:                this .bytes = bytes;
122:                this .threadName = threadName;
123:            }
124:
125:            public Sample() {
126:                this (null, 0, 0, 0, 0, 0, 0, 0, true, 0, 0);
127:            }
128:
129:            // Appears not to be used - however it is invoked via the Functor class
130:            public int getBytes() {
131:                return bytes;
132:            }
133:
134:            /**
135:             * @return Returns the average.
136:             */
137:            public long getAverage() {
138:                return average;
139:            }
140:
141:            /**
142:             * @return Returns the count.
143:             */
144:            public long getCount() {
145:                return count;
146:            }
147:
148:            /**
149:             * @return Returns the data (usually elapsed time)
150:             */
151:            public long getData() {
152:                return data;
153:            }
154:
155:            /**
156:             * @return Returns the deviation.
157:             */
158:            public long getDeviation() {
159:                return deviation;
160:            }
161:
162:            /**
163:             * @return Returns the distributionLine.
164:             */
165:            public long getDistributionLine() {
166:                return distributionLine;
167:            }
168:
169:            /**
170:             * @return Returns the error.
171:             */
172:            public boolean isSuccess() {
173:                return success;
174:            }
175:
176:            /**
177:             * @return Returns the errorRate.
178:             */
179:            public long getErrorCount() {
180:                return errorCount;
181:            }
182:
183:            /**
184:             * @return Returns the label.
185:             */
186:            public String getLabel() {
187:                return label;
188:            }
189:
190:            /**
191:             * @return Returns the threadName.
192:             */
193:            public String getThreadName() {
194:                return threadName;
195:            }
196:
197:            /**
198:             * @return Returns the median.
199:             */
200:            public long getMedian() {
201:                return median;
202:            }
203:
204:            /**
205:             * @return Returns the throughput.
206:             */
207:            public double getThroughput() {
208:                return throughput;
209:            }
210:
211:            /*
212:             * (non-Javadoc)
213:             * 
214:             * @see java.lang.Comparable#compareTo(java.lang.Object)
215:             */
216:            public int compareTo(Object o) {
217:                Sample oo = (Sample) o;
218:                return ((count - oo.count) < 0 ? -1 : (count == oo.count ? 0
219:                        : 1));
220:            }
221:
222:            /**
223:             * @return Returns the endTime.
224:             */
225:            public long getEndTime() {
226:                return endTime;
227:            }
228:
229:            /**
230:             * @return Returns the (calculated) startTime, assuming Data is the elapsed time.
231:             */
232:            public long getStartTime() {
233:                return endTime - data;
234:            }
235:
236:            /**
237:             * @return the start time using the specified format
238:             * Intended for use from Functors
239:             */
240:            public String getStartTimeFormatted(Format format) {
241:                return format.format(new Date(getStartTime()));
242:            }
243:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.