-
|
The following code snippet failed: timestamp
.round(
TimestampRound::new()
.smallest(Unit::Millisecond)
.increment(833)
.mode(RoundMode::Floor),
)
I'm using this method to implement something like a time range query over metric series. And 833 is the step in counting. That said, I'd like to align the timestamp to every 833 ms from the start of the day, and I'm OK that the last time window can be smaller than others. Is there some reason we forbid this use case? @BurntSushi |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Seems I can understand some of them now that without evenly division it's hard to tell where the alignment it starts with. If it starts with UNIX_EPOCH, it may not be aligned with the current hour, then it would be different from user's expectation. If it starts with the current hour, it's too special also. If it starts with the current day, one even needs a timezone to determinate the timestamp at the start of the day. |
Beta Was this translation helpful? Give feedback.
Seems I can understand some of them now that without evenly division it's hard to tell where the alignment it starts with.
If it starts with UNIX_EPOCH, it may not be aligned with the current hour, then it would be different from user's expectation.
If it starts with the current hour, it's too special also.
If it starts with the current day, one even needs a timezone to determinate the timestamp at the start of the day.