MCPcopy
hub / github.com/tinode/chat / serializeAndUpdateStats

Method serializeAndUpdateStats

server/session.go:1364–1370  ·  view source on GitHub ↗
(msg *ServerComMessage)

Source from the content-addressed store, hash-verified

1362}
1363
1364func (s *Session) serializeAndUpdateStats(msg *ServerComMessage) any {
1365 dataSize, data := s.serialize(msg)
1366 if dataSize >= 0 {
1367 statsAddHistSample("OutgoingMessageSize", float64(dataSize))
1368 }
1369 return data
1370}
1371
1372func (s *Session) serialize(msg *ServerComMessage) (int, any) {
1373 if s.proto == GRPC {

Callers 3

writeGrpcLoopMethod · 0.95
writeLoopMethod · 0.95
writeOnceMethod · 0.95

Calls 2

serializeMethod · 0.95
statsAddHistSampleFunction · 0.85

Tested by

no test coverage detected