|
Version 4.8.0
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Objecthirondelle.web4j.webmaster.PerformanceSnapshot
public final class PerformanceSnapshot
Statistics on server response time.
This class uses the metaphor of a 'photographic exposure' of, say, 10 minutes, whereby response times for a specific time interval are grouped together in a single bin, and average and maximum response times for that interval are derived for that group.
A particular PerformanceSnapshot is used only if its 'exposure time'
has not yet ended. A typical 'exposure' lasts a few minutes.
(See PerformanceMonitor and the web.xml
of the example application for more information.)
By inspecting the return value of getEndTime(), the caller
determines if a PerformanceSnapshot object can still be used, or if a new
PerformanceSnapshot object must be created for the 'next exposure'.
This class is immutable. In particular, addResponseTime(long, java.lang.String) returns a new object,
instead of changing the state of an existing one.
| Constructor Summary | |
|---|---|
PerformanceSnapshot(Integer aExposureTime)
|
|
| Method Summary | |
|---|---|
PerformanceSnapshot |
addResponseTime(long aResponseTime,
String aURL)
Return a new PerformanceSnapshot whose state reflects an additional data point. |
boolean |
equals(Object aThat)
|
static PerformanceSnapshot |
forGapInActivity(PerformanceSnapshot aCurrentSnapshot)
Return a PerformanceSnapshot having no activity. |
Long |
getAvgResponseTime()
Return the average response time recorded during this snapshot. |
Date |
getEndTime()
Return the time that this snapshot will 'end'. |
Integer |
getExposureTime()
Return the exposure time in minutes, as passed to the constructor. |
Long |
getMaxResponseTime()
Return the maximum response time recorded during this snapshot. |
Integer |
getNumRequests()
Return the number of server requests this snapshot has recorded. |
String |
getURLWithMaxResponseTime()
Return the URL of the request responsible for getMaxResponseTime(). |
int |
hashCode()
|
String |
toString()
Intended for debugging only. |
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PerformanceSnapshot(Integer aExposureTime)
aExposureTime - number of minutes to gather statistics ; see web.xml
for more information.| Method Detail |
|---|
public static PerformanceSnapshot forGapInActivity(PerformanceSnapshot aCurrentSnapshot)
The returned object has the same exposure time as aCurrentSnapshot. Its end time is taken as aCurrentSnapshot.getEndTime(), plus the exposure time. All other items are 0 or empty.
public PerformanceSnapshot addResponseTime(long aResponseTime,
String aURL)
aResponseTime - response time of a particular server request.aURL - URL of the underlying request.public Date getEndTime()
public Integer getNumRequests()
If a page contains two images, for example, the server will likely count 3 requests, not 1 (one page and two images).
public Long getAvgResponseTime()
public Long getMaxResponseTime()
public Integer getExposureTime()
public String getURLWithMaxResponseTime()
getMaxResponseTime().
public String toString()
toString in class Objectpublic boolean equals(Object aThat)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
Version 4.8.0
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||