From f3cebdd9887be2a4adececf1f3acf48b4603cd93 Mon Sep 17 00:00:00 2001 From: Miguel Angel Rojo Fernandez Date: Fri, 10 Jan 2025 12:51:58 +0000 Subject: [PATCH] first commit --- cmd/thor/node/node.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/thor/node/node.go b/cmd/thor/node/node.go index 4b15db26c..f648e7755 100644 --- a/cmd/thor/node/node.go +++ b/cmd/thor/node/node.go @@ -274,13 +274,13 @@ func (n *Node) txStashLoop(ctx context.Context) { // guardBlockProcessing adds lock on block processing and maintains block conflicts. func (n *Node) guardBlockProcessing(blockNum uint32, process func(conflicts uint32) error) error { - startTime := mclock.Now() n.processLock.Lock() + startTime := mclock.Now() metricBlockProcessingLockCount().AddWithLabel(1, map[string]string{"type": "acquired"}) defer func() { n.processLock.Unlock() - metricBlockProcessingLockCount().AddWithLabel(1, map[string]string{"type": "released"}) lockElapsed := mclock.Now() - startTime + metricBlockProcessingLockCount().AddWithLabel(1, map[string]string{"type": "released"}) metricBlockProcessingLockDuration().Observe(time.Duration(lockElapsed).Milliseconds()) }()