forked from LBRYCommunity/lbry-sdk
remove request_flight metric
This commit is contained in:
parent
5686c2ade9
commit
44e647d85d
1 changed files with 0 additions and 7 deletions
|
@ -276,10 +276,6 @@ class KademliaProtocol(DatagramProtocol):
|
||||||
"request_success", "Number of successful requests", namespace="dht_node",
|
"request_success", "Number of successful requests", namespace="dht_node",
|
||||||
labelnames=("method",),
|
labelnames=("method",),
|
||||||
)
|
)
|
||||||
request_flight_metric = Gauge(
|
|
||||||
"request_flight", "Number of ongoing requests", namespace="dht_node",
|
|
||||||
labelnames=("method",),
|
|
||||||
)
|
|
||||||
request_error_metric = Counter(
|
request_error_metric = Counter(
|
||||||
"request_error", "Number of errors returned from request to other peers", namespace="dht_node",
|
"request_error", "Number of errors returned from request to other peers", namespace="dht_node",
|
||||||
labelnames=("method",),
|
labelnames=("method",),
|
||||||
|
@ -614,7 +610,6 @@ class KademliaProtocol(DatagramProtocol):
|
||||||
response_fut = self.sent_messages[request.rpc_id][1]
|
response_fut = self.sent_messages[request.rpc_id][1]
|
||||||
try:
|
try:
|
||||||
self.request_sent_metric.labels(method=request.method).inc()
|
self.request_sent_metric.labels(method=request.method).inc()
|
||||||
self.request_flight_metric.labels(method=request.method).inc()
|
|
||||||
start = time.perf_counter()
|
start = time.perf_counter()
|
||||||
response = await asyncio.wait_for(response_fut, self.rpc_timeout)
|
response = await asyncio.wait_for(response_fut, self.rpc_timeout)
|
||||||
self.response_time_metric.labels(method=request.method).observe(time.perf_counter() - start)
|
self.response_time_metric.labels(method=request.method).observe(time.perf_counter() - start)
|
||||||
|
@ -631,8 +626,6 @@ class KademliaProtocol(DatagramProtocol):
|
||||||
if self.peer_manager.peer_is_good(peer) is False:
|
if self.peer_manager.peer_is_good(peer) is False:
|
||||||
self.remove_peer(peer)
|
self.remove_peer(peer)
|
||||||
raise
|
raise
|
||||||
finally:
|
|
||||||
self.request_flight_metric.labels(method=request.method).dec()
|
|
||||||
|
|
||||||
def send_response(self, peer: 'KademliaPeer', response: ResponseDatagram):
|
def send_response(self, peer: 'KademliaPeer', response: ResponseDatagram):
|
||||||
self._send(peer, response)
|
self._send(peer, response)
|
||||||
|
|
Loading…
Reference in a new issue