File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import (
19
19
"strings"
20
20
"time"
21
21
22
+ "github.com/rs/zerolog"
22
23
"go.mau.fi/libsignal/groups"
23
24
"go.mau.fi/libsignal/keys/prekey"
24
25
"go.mau.fi/libsignal/protocol"
@@ -82,6 +83,24 @@ type MessageDebugTimings struct {
82
83
Retry time.Duration
83
84
}
84
85
86
+ func (mdt MessageDebugTimings ) MarshalZerologObject (evt * zerolog.Event ) {
87
+ evt .Dur ("queue" , mdt .Queue )
88
+ evt .Dur ("marshal" , mdt .Marshal )
89
+ if mdt .GetParticipants != 0 {
90
+ evt .Dur ("get_participants" , mdt .GetParticipants )
91
+ }
92
+ evt .Dur ("get_devices" , mdt .GetDevices )
93
+ if mdt .GroupEncrypt != 0 {
94
+ evt .Dur ("group_encrypt" , mdt .GroupEncrypt )
95
+ }
96
+ evt .Dur ("peer_encrypt" , mdt .PeerEncrypt )
97
+ evt .Dur ("send" , mdt .Send )
98
+ evt .Dur ("resp" , mdt .Resp )
99
+ if mdt .Retry != 0 {
100
+ evt .Dur ("retry" , mdt .Retry )
101
+ }
102
+ }
103
+
85
104
type SendResponse struct {
86
105
// The message timestamp returned by the server
87
106
Timestamp time.Time
You can’t perform that action at this time.
0 commit comments