Add management_grpc_updatechannel_queue_bucket histogram (#1158)

This should help to find better value for `server.channelBufferSize`
This commit is contained in:
Yury Gargay
2023-09-25 10:23:43 +02:00
committed by GitHub
parent 732afd8393
commit 1324169ebb
2 changed files with 24 additions and 0 deletions

View File

@@ -159,6 +159,11 @@ func (s *GRPCServer) Sync(req *proto.EncryptedMessage, srv proto.ManagementServi
select {
// condition when there are some updates
case update, open := <-updates:
if s.appMetrics != nil {
s.appMetrics.GRPCMetrics().UpdateChannelQueueLength(len(updates) + 1)
}
if !open {
log.Debugf("updates channel for peer %s was closed", peerKey.String())
s.cancelPeerRoutines(peer)