@Override public void proxyToServerResolutionFailed(String hostAndPort) { // since this is a CONNECT, which is not handled by the HarCaptureFilter, we need to create and populate the // entire HarEntry and add it to this har. HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getResolutionFailedErrorMessage(hostAndPort)); har.getLog().addEntry(harEntry); // record the amount of time we attempted to resolve the hostname in the HarTimings object if (dnsResolutionStartedNanos > 0L) { harEntry.getTimings().setDns(System.nanoTime() - dnsResolutionStartedNanos, TimeUnit.NANOSECONDS); } httpConnectTimes.remove(clientAddress); }
@Override public void proxyToServerConnectionFailed() { // since this is a CONNECT, which is not handled by the HarCaptureFilter, we need to create and populate the // entire HarEntry and add it to this har. HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getConnectionFailedErrorMessage()); har.getLog().addEntry(harEntry); // record the amount of time we attempted to connect in the HarTimings object if (connectionStartedNanos > 0L) { harEntry.getTimings().setConnect(System.nanoTime() - connectionStartedNanos, TimeUnit.NANOSECONDS); } httpConnectTimes.remove(clientAddress); }
@Override public void serverToProxyResponseTimedOut() { HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getResponseTimedOutErrorMessage()); har.getLog().addEntry(harEntry); // include this timeout time in the HarTimings object long timeoutTimestampNanos = System.nanoTime(); // if the proxy started to send the request but has not yet finished, we are currently "sending" if (sendStartedNanos > 0L && sendFinishedNanos == 0L) { harEntry.getTimings().setSend(timeoutTimestampNanos - sendStartedNanos, TimeUnit.NANOSECONDS); } // if the entire request was sent but the proxy has not begun receiving the response, we are currently "waiting" else if (sendFinishedNanos > 0L && responseReceiveStartedNanos == 0L) { harEntry.getTimings().setWait(timeoutTimestampNanos - sendFinishedNanos, TimeUnit.NANOSECONDS); } // if the proxy has already begun to receive the response, we are currenting "receiving" else if (responseReceiveStartedNanos > 0L) { harEntry.getTimings().setReceive(timeoutTimestampNanos - responseReceiveStartedNanos, TimeUnit.NANOSECONDS); } }
logCopy.addEntry(entry);
har.getLog().addEntry(harEntry);
@Override public void proxyToServerResolutionFailed(String hostAndPort) { // since this is a CONNECT, which is not handled by the HarCaptureFilter, we need to create and populate the // entire HarEntry and add it to this har. HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getResolutionFailedErrorMessage(hostAndPort)); har.getLog().addEntry(harEntry); // record the amount of time we attempted to resolve the hostname in the HarTimings object if (dnsResolutionStartedNanos > 0L) { harEntry.getTimings().setDns(System.nanoTime() - dnsResolutionStartedNanos, TimeUnit.NANOSECONDS); } httpConnectTimes.remove(clientAddress); }
@Override public void proxyToServerResolutionFailed(String hostAndPort) { // since this is a CONNECT, which is not handled by the HarCaptureFilter, we need to create and populate the // entire HarEntry and add it to this har. HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getResolutionFailedErrorMessage(hostAndPort)); har.getLog().addEntry(harEntry); // record the amount of time we attempted to resolve the hostname in the HarTimings object if (dnsResolutionStartedNanos > 0L) { harEntry.getTimings().setDns(System.nanoTime() - dnsResolutionStartedNanos, TimeUnit.NANOSECONDS); } httpConnectTimes.remove(clientAddress); }
@Override public void proxyToServerConnectionFailed() { // since this is a CONNECT, which is not handled by the HarCaptureFilter, we need to create and populate the // entire HarEntry and add it to this har. HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getConnectionFailedErrorMessage()); har.getLog().addEntry(harEntry); // record the amount of time we attempted to connect in the HarTimings object if (connectionStartedNanos > 0L) { harEntry.getTimings().setConnect(System.nanoTime() - connectionStartedNanos, TimeUnit.NANOSECONDS); } httpConnectTimes.remove(clientAddress); }
@Override public void proxyToServerConnectionFailed() { // since this is a CONNECT, which is not handled by the HarCaptureFilter, we need to create and populate the // entire HarEntry and add it to this har. HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getConnectionFailedErrorMessage()); har.getLog().addEntry(harEntry); // record the amount of time we attempted to connect in the HarTimings object if (connectionStartedNanos > 0L) { harEntry.getTimings().setConnect(System.nanoTime() - connectionStartedNanos, TimeUnit.NANOSECONDS); } httpConnectTimes.remove(clientAddress); }
@Override public void proxyToServerResolutionFailed(String hostAndPort) { // since this is a CONNECT, which is not handled by the HarCaptureFilter, we need to create and populate the // entire HarEntry and add it to this har. HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getResolutionFailedErrorMessage(hostAndPort)); har.getLog().addEntry(harEntry); // record the amount of time we attempted to resolve the hostname in the HarTimings object if (dnsResolutionStartedNanos > 0L) { harEntry.getTimings().setDns(System.nanoTime() - dnsResolutionStartedNanos, TimeUnit.NANOSECONDS); } httpConnectTimes.remove(clientAddress); }
@Override public void proxyToServerConnectionFailed() { // since this is a CONNECT, which is not handled by the HarCaptureFilter, we need to create and populate the // entire HarEntry and add it to this har. HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getConnectionFailedErrorMessage()); har.getLog().addEntry(harEntry); // record the amount of time we attempted to connect in the HarTimings object if (connectionStartedNanos > 0L) { harEntry.getTimings().setConnect(System.nanoTime() - connectionStartedNanos, TimeUnit.NANOSECONDS); } httpConnectTimes.remove(clientAddress); }
@Override public void serverToProxyResponseTimedOut() { HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getResponseTimedOutErrorMessage()); har.getLog().addEntry(harEntry); // include this timeout time in the HarTimings object long timeoutTimestampNanos = System.nanoTime(); // if the proxy started to send the request but has not yet finished, we are currently "sending" if (sendStartedNanos > 0L && sendFinishedNanos == 0L) { harEntry.getTimings().setSend(timeoutTimestampNanos - sendStartedNanos, TimeUnit.NANOSECONDS); } // if the entire request was sent but the proxy has not begun receiving the response, we are currently "waiting" else if (sendFinishedNanos > 0L && responseReceiveStartedNanos == 0L) { harEntry.getTimings().setWait(timeoutTimestampNanos - sendFinishedNanos, TimeUnit.NANOSECONDS); } // if the proxy has already begun to receive the response, we are currenting "receiving" else if (responseReceiveStartedNanos > 0L) { harEntry.getTimings().setReceive(timeoutTimestampNanos - responseReceiveStartedNanos, TimeUnit.NANOSECONDS); } }
@Override public void serverToProxyResponseTimedOut() { HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getResponseTimedOutErrorMessage()); har.getLog().addEntry(harEntry); // include this timeout time in the HarTimings object long timeoutTimestampNanos = System.nanoTime(); // if the proxy started to send the request but has not yet finished, we are currently "sending" if (sendStartedNanos > 0L && sendFinishedNanos == 0L) { harEntry.getTimings().setSend(timeoutTimestampNanos - sendStartedNanos, TimeUnit.NANOSECONDS); } // if the entire request was sent but the proxy has not begun receiving the response, we are currently "waiting" else if (sendFinishedNanos > 0L && responseReceiveStartedNanos == 0L) { harEntry.getTimings().setWait(timeoutTimestampNanos - sendFinishedNanos, TimeUnit.NANOSECONDS); } // if the proxy has already begun to receive the response, we are currenting "receiving" else if (responseReceiveStartedNanos > 0L) { harEntry.getTimings().setReceive(timeoutTimestampNanos - responseReceiveStartedNanos, TimeUnit.NANOSECONDS); } }
@Override public void serverToProxyResponseTimedOut() { HarEntry harEntry = createHarEntryForFailedCONNECT(HarCaptureUtil.getResponseTimedOutErrorMessage()); har.getLog().addEntry(harEntry); // include this timeout time in the HarTimings object long timeoutTimestampNanos = System.nanoTime(); // if the proxy started to send the request but has not yet finished, we are currently "sending" if (sendStartedNanos > 0L && sendFinishedNanos == 0L) { harEntry.getTimings().setSend(timeoutTimestampNanos - sendStartedNanos, TimeUnit.NANOSECONDS); } // if the entire request was sent but the proxy has not begun receiving the response, we are currently "waiting" else if (sendFinishedNanos > 0L && responseReceiveStartedNanos == 0L) { harEntry.getTimings().setWait(timeoutTimestampNanos - sendFinishedNanos, TimeUnit.NANOSECONDS); } // if the proxy has already begun to receive the response, we are currenting "receiving" else if (responseReceiveStartedNanos > 0L) { harEntry.getTimings().setReceive(timeoutTimestampNanos - responseReceiveStartedNanos, TimeUnit.NANOSECONDS); } }
logCopy.addEntry(entry);
logCopy.addEntry(entry);
har.getLog().addEntry(harEntry);
har.getLog().addEntry(harEntry);
har.getLog().addEntry(harEntry);