DriveSomethingGreater: log data point id before name (#31202)

This commit is contained in:
andig 2026-06-25 11:18:33 +02:00 • committed by GitHub
parent 3f9e0872bc
commit 0d010f6c11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View file

@ -161,7 +161,7 @@ func (s *store) snapshot(vin string) map[string]point {
func logData(log *util.Logger, data map[string]point) {
for _, k := range slices.Sorted(maps.Keys(data)) {
p := data[k]
log.DEBUG.Printf("recv %s: %s (%s)", k, p.Value, p.Timestamp.Local().Format("2006-01-02 15:04:05"))
log.DEBUG.Printf("recv %s %s: %s (%s)", p.Key, p.Name, p.Value, p.Timestamp.Local().Format("2006-01-02 15:04:05"))
}
}

View file

@ -84,9 +84,11 @@ type dataPoint struct {
TimestampUtc *time.Time `json:"timestampUtc"`
}
// point is a decoded data point: its value, the time it was recorded and the
// delivery sequence of the dataset it last arrived in (higher Seq is newer).
// point is a decoded data point: its unique GUID (Key), delivered field Name,
// value, record time and dataset delivery sequence (higher Seq is newer).
type point struct {
Key string
Name string
Value string
Timestamp time.Time
Seq uint64
@ -228,7 +230,7 @@ func points(data []dataPoint) map[string]point {
if p.TimestampUtc != nil {
ts = *p.TimestampUtc
}
pt := point{Value: p.Value, Timestamp: ts}
pt := point{Key: p.Key, Name: p.DataFieldName, Value: p.Value, Timestamp: ts}
set(p.DataFieldName, pt)
if _, ok := knownKeys[p.Key]; ok {