Example #1
0
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)
	}
}
Example #2
0
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()
}
Example #3
0
func walEntryLength(p models.Point) int {
	return 8 + 4 + 4 + len(p.Key()) + len(p.Data())
}