func assertEqual(t *testing.T, a tsm1.Value, b models.Point, field string) { if got, exp := a.UnixNano(), b.UnixNano(); got != exp { t.Fatalf("time mismatch: got %v, exp %v", got, exp) } if got, exp := a.Value(), b.Fields()[field]; got != exp { t.Fatalf("value mismatch: got %v, exp %v", got, exp) } }
func setMapValues(m map[string]interface{}, p models.Point) { m["%f"] = getRandomFieldKey(p.Fields()) m["%m"] = p.Name() m["%t"] = getRandomTagPair(p.Tags()) m["%a"] = p.UnixNano() }
func walEntryLength(p models.Point) int { return 8 + 4 + 4 + len(p.Key()) + len(p.Data()) }