Exemple #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)
	}
}
Exemple #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()
}