mirror of
https://github.com/livekit/livekit.git
synced 2026-09-16 10:42:36 +00:00
log telemetry guard details (#4817)
* log telemetry guard details * nil guard
This commit is contained in:
@@ -216,6 +216,7 @@ func (t *telemetryService) ParticipantLeft(ctx context.Context,
|
||||
"participant", participant.Identity,
|
||||
"participantID", participant.Sid,
|
||||
"worker", worker,
|
||||
"guard", guard,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import (
|
||||
"context"
|
||||
"sync"
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"go.uber.org/zap/zapcore"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
@@ -32,6 +33,17 @@ type ReferenceGuard struct {
|
||||
activated, released bool
|
||||
}
|
||||
|
||||
func (r *ReferenceGuard) MarshalLogObject(e zapcore.ObjectEncoder) error {
|
||||
if r != nil {
|
||||
e.AddUintptr("self", uintptr(unsafe.Pointer(r)))
|
||||
e.AddBool("activated", r.activated)
|
||||
e.AddBool("released", r.released)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ----------------------------------------
|
||||
|
||||
type ReferenceCount struct {
|
||||
count int
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user