mirror of
https://github.com/libp2p/go-libp2p-resource-manager.git
synced 2025-03-31 22:50:19 +08:00
Record which direction the resource was blocked
This commit is contained in:
parent
52c042b471
commit
7dda49c55d
@ -320,11 +320,13 @@ func (r StatsTraceReporter) ConsumeEvent(evt rcmgr.TraceEvt) {
|
|||||||
tags := []tag.Mutator{tag.Upsert(scopeTag, scopeName), tag.Upsert(resourceTag, resource)}
|
tags := []tag.Mutator{tag.Upsert(scopeTag, scopeName), tag.Upsert(resourceTag, resource)}
|
||||||
|
|
||||||
if evt.DeltaIn != 0 {
|
if evt.DeltaIn != 0 {
|
||||||
stats.RecordWithTags(ctx, tags, blockedResources.M(int64(1)))
|
tagsWithDir := append([]tag.Mutator{tag.Insert(directionTag, "inbound")}, tags...)
|
||||||
|
stats.RecordWithTags(ctx, tagsWithDir, blockedResources.M(int64(1)))
|
||||||
}
|
}
|
||||||
|
|
||||||
if evt.DeltaOut != 0 {
|
if evt.DeltaOut != 0 {
|
||||||
stats.RecordWithTags(ctx, tags, blockedResources.M(int64(1)))
|
tagsWithDir := append([]tag.Mutator{tag.Insert(directionTag, "outbound")}, tags...)
|
||||||
|
stats.RecordWithTags(ctx, tagsWithDir, blockedResources.M(int64(1)))
|
||||||
}
|
}
|
||||||
|
|
||||||
if evt.Delta != 0 {
|
if evt.Delta != 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user