Track rx time

This commit is contained in:
Daniel Pupius
2025-04-23 13:59:54 -07:00
parent 6c891198b5
commit 489f995433
7 changed files with 79 additions and 11 deletions

View File

@@ -3,6 +3,7 @@ package decoder
import (
"fmt"
"strings"
"time"
"google.golang.org/protobuf/proto"
@@ -77,7 +78,10 @@ func DecodeEncodedMessage(payload []byte) (*pb.ServiceEnvelope, error) {
// DecodeMessage creates a Data object from a binary encoded message
func DecodeMessage(payload []byte, topicInfo *meshtreampb.TopicInfo) *meshtreampb.Data {
data := &meshtreampb.Data{}
data := &meshtreampb.Data{
// Add reception timestamp (Unix timestamp in seconds)
RxTime: uint64(time.Now().Unix()),
}
// First decode the envelope
envelope, err := DecodeEncodedMessage(payload)