Add session duration and participant kind to closing log. (#4277)
To allow using "participant closing" log entry for calculating things like session duration by paricipant kind or some other client SDK based attribute.
This commit is contained in:
@@ -1365,11 +1365,18 @@ func (p *ParticipantImpl) Close(sendLeave bool, reason types.ParticipantCloseRea
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var sessionDuration time.Duration
|
||||||
|
if activeAt := p.ActiveAt(); !activeAt.IsZero() {
|
||||||
|
sessionDuration = time.Since(activeAt)
|
||||||
|
}
|
||||||
p.params.Logger.Infow(
|
p.params.Logger.Infow(
|
||||||
"participant closing",
|
"participant closing",
|
||||||
"sendLeave", sendLeave,
|
"sendLeave", sendLeave,
|
||||||
"reason", reason.String(),
|
"reason", reason.String(),
|
||||||
"isExpectedToResume", isExpectedToResume,
|
"isExpectedToResume", isExpectedToResume,
|
||||||
|
"clientInfo", logger.Proto(sutils.ClientInfoWithoutAddress(p.GetClientInfo())),
|
||||||
|
"kind", p.Kind(),
|
||||||
|
"sessionDuration", sessionDuration,
|
||||||
)
|
)
|
||||||
p.closeReason.Store(reason)
|
p.closeReason.Store(reason)
|
||||||
p.clearDisconnectTimer()
|
p.clearDisconnectTimer()
|
||||||
|
|||||||
Reference in New Issue
Block a user