mirror of
https://github.com/libp2p/go-libp2p-resource-manager.git
synced 2025-04-01 07:00:51 +08:00
make service and protocol scope names distinguishable
This commit is contained in:
parent
50387915ba
commit
76b7e49ed7
4
rcmgr.go
4
rcmgr.go
@ -450,7 +450,7 @@ func (s *serviceScope) getPeerScope(p peer.ID) *resourceScope {
|
|||||||
s.peers = make(map[peer.ID]*resourceScope)
|
s.peers = make(map[peer.ID]*resourceScope)
|
||||||
}
|
}
|
||||||
|
|
||||||
ps = newResourceScope(l, nil, fmt.Sprintf("%s.peer:%s", s.name, p), s.rcmgr.trace, s.rcmgr.metrics)
|
ps = newResourceScope(l, nil, fmt.Sprintf("service:%s.peer:%s", s.name, p), s.rcmgr.trace, s.rcmgr.metrics)
|
||||||
s.peers[p] = ps
|
s.peers[p] = ps
|
||||||
|
|
||||||
ps.IncRef()
|
ps.IncRef()
|
||||||
@ -477,7 +477,7 @@ func (s *protocolScope) getPeerScope(p peer.ID) *resourceScope {
|
|||||||
s.peers = make(map[peer.ID]*resourceScope)
|
s.peers = make(map[peer.ID]*resourceScope)
|
||||||
}
|
}
|
||||||
|
|
||||||
ps = newResourceScope(l, nil, fmt.Sprintf("%s.peer:%s", s.name, p), s.rcmgr.trace, s.rcmgr.metrics)
|
ps = newResourceScope(l, nil, fmt.Sprintf("protocol:%s.peer:%s", s.name, p), s.rcmgr.trace, s.rcmgr.metrics)
|
||||||
s.peers[p] = ps
|
s.peers[p] = ps
|
||||||
|
|
||||||
ps.IncRef()
|
ps.IncRef()
|
||||||
|
Loading…
Reference in New Issue
Block a user