Issue #2313 - Dump HTTP/2 channel state.
Added HTTP/2 stream age to toString(). Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
21bdb367fd
commit
ff341fb420
|
@ -23,6 +23,7 @@ import java.io.IOException;
|
||||||
import java.nio.channels.WritePendingException;
|
import java.nio.channels.WritePendingException;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentMap;
|
import java.util.concurrent.ConcurrentMap;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.TimeoutException;
|
import java.util.concurrent.TimeoutException;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
@ -53,6 +54,7 @@ public class HTTP2Stream extends IdleTimeout implements IStream, Callback, Dumpa
|
||||||
private final AtomicReference<Callback> writing = new AtomicReference<>();
|
private final AtomicReference<Callback> writing = new AtomicReference<>();
|
||||||
private final AtomicInteger sendWindow = new AtomicInteger();
|
private final AtomicInteger sendWindow = new AtomicInteger();
|
||||||
private final AtomicInteger recvWindow = new AtomicInteger();
|
private final AtomicInteger recvWindow = new AtomicInteger();
|
||||||
|
private final long timeStamp = System.nanoTime();
|
||||||
private final ISession session;
|
private final ISession session;
|
||||||
private final int streamId;
|
private final int streamId;
|
||||||
private final boolean local;
|
private final boolean local;
|
||||||
|
@ -473,7 +475,15 @@ public class HTTP2Stream extends IdleTimeout implements IStream, Callback, Dumpa
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
return String.format("%s@%x#%d{sendWindow=%s,recvWindow=%s,reset=%b,%s,attachment=%s}", getClass().getSimpleName(),
|
return String.format("%s@%x#%d{sendWindow=%s,recvWindow=%s,reset=%b,%s,age=%d,attachment=%s}",
|
||||||
hashCode(), getId(), sendWindow, recvWindow, isReset(), closeState, attachment);
|
getClass().getSimpleName(),
|
||||||
|
hashCode(),
|
||||||
|
getId(),
|
||||||
|
sendWindow,
|
||||||
|
recvWindow,
|
||||||
|
isReset(),
|
||||||
|
closeState,
|
||||||
|
TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - timeStamp),
|
||||||
|
attachment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue