Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Rounding of epoch seconds #650

Merged
merged 1 commit into from
Jan 18, 2025
Merged

Conversation

patriknw
Copy link
Member

Fixes #649

@@ -235,7 +235,8 @@ import org.slf4j.Logger
protected def appendEmptyBucketIfLastIsMissing(
buckets: IndexedSeq[Bucket],
toTimestamp: Instant): IndexedSeq[Bucket] = {
val startTimeOfLastBucket = (toTimestamp.getEpochSecond / 10) * 10
// db epoch seconds is rounding, but Instant is not
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

example with postgres:

SELECT db_timestamp, extract(EPOCH from db_timestamp)::BIGINT / 10 AS bucket from test order by db_timestamp;
         db_timestamp          |  bucket
-------------------------------+-----------
 2025-01-17 01:24:49.431768+00 | 173707708
 2025-01-17 01:24:49.631768+00 | 173707709
 2025-01-17 01:24:59.491768+00 | 173707709
 2025-01-17 01:24:59.531768+00 | 173707710
 2025-01-17 01:24:59.631768+00 | 173707710

@pvlugter pvlugter merged commit 85d1120 into main Jan 18, 2025
10 checks passed
@pvlugter pvlugter deleted the wip-BucketCountSpec-patriknw branch January 18, 2025 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

failed: BucketCountSpec
2 participants