mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
Show last successful response time.
This commit is contained in:
parent
49b5430e49
commit
cb2b7f29f9
@ -242,6 +242,8 @@ public class InventoryWebServer {
|
||||
sb.append("Response received at: ").append(responseTime).append("<br/>");
|
||||
|
||||
sb.append(getErrorMsgLine(seedNode, requestInfo, map));
|
||||
|
||||
sb.append(getLastSuccessfulResponseLine(seedNode, map));
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@ -531,4 +533,20 @@ public class InventoryWebServer {
|
||||
historicalErrorsHtml +
|
||||
CLOSE_TAG;
|
||||
}
|
||||
|
||||
private String getLastSuccessfulResponseLine(NodeAddress seedNode,
|
||||
Map<NodeAddress, List<RequestInfo>> map) {
|
||||
long newestResponseTime = 0;
|
||||
List<RequestInfo> requestInfoList = map.get(seedNode);
|
||||
if (requestInfoList != null) {
|
||||
for (int i = 0; i < requestInfoList.size(); i++) {
|
||||
RequestInfo requestInfo1 = requestInfoList.get(i);
|
||||
newestResponseTime = Math.max(newestResponseTime, requestInfo1.getResponseTime());
|
||||
}
|
||||
}
|
||||
String responseMessage = newestResponseTime > 0 ? new Date(newestResponseTime).toString() : "none";
|
||||
return "Last response received: " +
|
||||
responseMessage +
|
||||
CLOSE_TAG;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user