Add metrics for pending request

Track the number of requests currently awaiting a response from a
request handler both from interally issued requests and requests
forwarded from other parties.
This commit is contained in:
Hornwitser committed 2024-01-22 20:48:01 +01:00
1 parent 51fe6c9519
commit d7edae99c5
4 files changed
+53 -6

No files matched your search

+7
View File
@@ -141,6 +141,13 @@ export class Link {
});
}
/**
* Count of requests currently waiting for a response on this link
*/
get pendingRequestCount() {
return this._pendingRequests.size + this._forwardedRequests.size;
}
_clearPendingRequests(err: Error & { code?: string }) {
for (let pending of this._pendingRequests.values()) {
pending.reject(err);