|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectOutputStream
ServletOutputStream
LatencyCutoffStream
class LatencyCutoffStream
This class prints out latency information after a given number of bytes have been output.
Field Summary | |
---|---|
private boolean |
isReported
Whether the message has been printed yet |
private int |
limit
The limit on the number of bytes after which the message is printed |
private OutputStream |
realOut
The output stream to receive the output |
private long |
reqStartTime
The start of the request, for timing purposes |
private int |
total
How many bytes have been output so far |
private String |
url
The URL of the request being served |
Constructor Summary | |
---|---|
LatencyCutoffStream(OutputStream realOut,
int limit,
long reqStartTime,
String url)
Constructor. |
Method Summary | |
---|---|
void |
close()
Close the output stream |
void |
flush()
Flush any pending data to the output stream |
boolean |
isReported()
Tells whether the latency was reported yet |
private void |
reportLatency()
Report the latency and set the flag saying it has been done. |
void |
write(byte[] b)
Write an array of bytes to the output stream |
void |
write(byte[] b,
int off,
int len)
Write a subset of bytes to the stream |
void |
write(int b)
Write a single byte to the stream |
Methods inherited from class ServletOutputStream |
---|
print, print, print, print, print, print, print, println, println, println, println, println, println, println, println |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private OutputStream realOut
private int total
private int limit
private String url
private long reqStartTime
private boolean isReported
Constructor Detail |
---|
public LatencyCutoffStream(OutputStream realOut, int limit, long reqStartTime, String url)
realOut
- The output stream to receive the limited outputlimit
- How many characters to output the message afterurl
- The URL of the request being servedMethod Detail |
---|
public void close() throws IOException
close
in interface Closeable
close
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public boolean isReported()
private void reportLatency()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |