mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-08-18 03:58:29 +00:00
fix: preserve timestamp precision of irate (#5904)
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -138,9 +138,7 @@ impl<const IS_RATE: bool> IDelta<IS_RATE> {
|
||||
}
|
||||
|
||||
// else is rate
|
||||
// TODO(ruihang): "divide 1000" converts the timestamp from millisecond to second.
|
||||
// it should consider other percisions.
|
||||
let sampled_interval = (timestamps[len - 1] - timestamps[len - 2]) / 1000;
|
||||
let sampled_interval = (timestamps[len - 1] - timestamps[len - 2]) as f64 / 1000.0;
|
||||
let last_value = values[len - 1];
|
||||
let prev_value = values[len - 2];
|
||||
let result_value = if last_value < prev_value {
|
||||
|
||||
Reference in New Issue
Block a user