mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/protoparser/graphite: add more tests after eb45185eef
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/610
This commit is contained in:
parent
eb45185eef
commit
d0b694c5c8
1 changed files with 39 additions and 3 deletions
|
@ -86,6 +86,13 @@ func TestRowsUnmarshalSuccess(t *testing.T) {
|
|||
Value: 1123,
|
||||
}},
|
||||
})
|
||||
f("aaa 1123 -1", &Rows{
|
||||
Rows: []Row{{
|
||||
Metric: "aaa",
|
||||
Value: 1123,
|
||||
Timestamp: -1,
|
||||
}},
|
||||
})
|
||||
|
||||
// Timestamp bigger than 1<<31
|
||||
f("aaa 1123 429496729600", &Rows{
|
||||
|
@ -177,13 +184,42 @@ func Test_streamContext_Read(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// -1 timestamp
|
||||
currentTimestamp := int64(fasttime.UnixTimestamp())
|
||||
// Full line without tags
|
||||
f("aaa 1123 345", &Rows{
|
||||
Rows: []Row{{
|
||||
Metric: "aaa",
|
||||
Value: 1123,
|
||||
Timestamp: 345*1000,
|
||||
}},
|
||||
})
|
||||
// Full line with tags
|
||||
f("aaa;x=y 1123 345", &Rows{
|
||||
Rows: []Row{{
|
||||
Metric: "aaa",
|
||||
Tags: []Tag{{
|
||||
Key: "x",
|
||||
Value: "y",
|
||||
}},
|
||||
Value: 1123,
|
||||
Timestamp: 345*1000,
|
||||
}},
|
||||
})
|
||||
// missing timestamp.
|
||||
// Note that this test may be flaky due to timing issues. TODO: fix it
|
||||
f("aaa 1123", &Rows{
|
||||
Rows: []Row{{
|
||||
Metric: "aaa",
|
||||
Value: 1123,
|
||||
Timestamp: currentTimestamp * 1000,
|
||||
Timestamp: int64(fasttime.UnixTimestamp()) * 1000,
|
||||
}},
|
||||
})
|
||||
// -1 timestamp. See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/610
|
||||
// Note that this test may be flaky due to timing issues. TODO: fix it.
|
||||
f("aaa 1123 -1", &Rows{
|
||||
Rows: []Row{{
|
||||
Metric: "aaa",
|
||||
Value: 1123,
|
||||
Timestamp: int64(fasttime.UnixTimestamp()) * 1000,
|
||||
}},
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue