Skip to content

series: sort points by full timestamp, not whole seconds - #3

Merged
honbin merged 1 commit into
mainfrom
fix/series-subsecond-sort
Oct 19, 2026
Merged

honbin merged 1 commit into
mainfrom
fix/series-subsecond-sort

Conversation

@honbin

@honbin honbin commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Sort ts-series points by the full DateTime instead of timestamp() (whole seconds), so points within the same second follow time order rather than input order.
  • Align ts-series with ts-align, ts-timeline and ts-correlate, which already keep sub-second precision. Output format is unchanged (rows still print at second resolution).
  • When the same min/max value appears twice within one second, its at time now points to the earlier one.
  • Add a regression test, sorts_within_the_same_second.

Verification

  • cargo fmt --check — passed
  • cargo clippy --workspace --all-targets -- -D warnings — passed
  • cargo test -p series — passed (the new test fails without the fix)
  • cargo test --workspace — passed
  • Manually confirmed that .900 then .100 within one second prints values 1 → 9.

Sorting on timestamp() collapsed points within the same second, so
sub-second inputs kept their input order. Sort on the DateTime itself,
matching align/timeline/correlate which already keep sub-second
precision. Display stays at second resolution.
@honbin
honbin merged commit 8ef11be into main Oct 19, 2026
1 check passed
@honbin
honbin deleted the fix/series-subsecond-sort branch October 19, 2026 11:35
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.

1 participant