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

RLID Package #8

Merged
merged 4 commits into from Sep 16, 2022
Merged

RLID Package #8

merged 4 commits into from Sep 16, 2022

Conversation

bbengfort
Copy link
Contributor

Scope of changes

An RLID is a totally ordered, 80 byte data structure that encodes both time and a monotonically increasing sequence number. It is inspired by ULID and Snowflake IDs. The purpose of this package is to assign totally ordered IDs to events in the Ensign system.

Fixes SC-9291

Type of change

  • new feature
  • bug fix
  • documentation
  • testing
  • technical debt
  • other (describe)

Acceptance criteria

The benchmarks for the current implementation are as follows:

goos: darwin
goarch: arm64
pkg: github.com/rotationalio/ensign/pkg/rlid
BenchmarkMake-10           	23952832	        42.12 ns/op	 237.44 MB/s	       0 B/op	       0 allocs/op
BenchmarkNow-10            	28846992	        41.53 ns/op	 192.62 MB/s	       0 B/op	       0 allocs/op
BenchmarkTimestamp-10      	1000000000	         0.3154 ns/op	25367.04 MB/s	       0 B/op	       0 allocs/op
BenchmarkTime-10           	1000000000	         0.3111 ns/op	25712.95 MB/s	       0 B/op	       0 allocs/op
BenchmarkSetTime-10        	1000000000	         0.3110 ns/op	25724.50 MB/s	       0 B/op	       0 allocs/op
BenchmarkSequence-10       	1000000000	         0.3108 ns/op	12871.14 MB/s	       0 B/op	       0 allocs/op
BenchmarkSetSequence-10    	1000000000	         0.3111 ns/op	12858.91 MB/s	       0 B/op	       0 allocs/op

Given these benchmarks it seems like it is only possible to generate 23k ID

Author checklist

  • I have manually tested the change and/or added automation in the form of unit tests or integration tests
  • I have updated the dependencies list
  • I have recompiled and included new protocol buffers to reflect changes I made
  • I have added new test fixtures as needed to support added tests
  • Check this box if a reviewer can merge this pull request after approval (leave it unchecked if you want to do it yourself)
  • I have moved the associated Shortcut story to "Ready for Review"

Reviewer(s) checklist

  • Any new user-facing content that has been added for this PR has been QA'ed to ensure correct grammar, spelling, and understandability.

@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #9291: RLIDs.

@codecov
Copy link

codecov bot commented Sep 15, 2022

Codecov Report

Merging #8 (9c03d60) into main (c48bfc8) will increase coverage by 5.61%.
The diff coverage is n/a.

❗ Current head 9c03d60 differs from pull request most recent head 1435080. Consider uploading reports for the commit 1435080 to get more accurate results

@@            Coverage Diff             @@
##             main       #8      +/-   ##
==========================================
+ Coverage   59.24%   64.85%   +5.61%     
==========================================
  Files          10       11       +1     
  Lines         530      626      +96     
==========================================
+ Hits          314      406      +92     
- Misses        191      193       +2     
- Partials       25       27       +2     
Flag Coverage Δ
unittests 64.85% <ø> (+5.61%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...rc/github.com/rotationalio/ensign/pkg/rlid/rlid.go 95.83% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@bbengfort bbengfort marked this pull request as ready for review September 16, 2022 22:07
@bbengfort bbengfort merged commit cb0b1e6 into main Sep 16, 2022
@bbengfort bbengfort deleted the sc-9291/rlids branch September 16, 2022 22:08
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.

None yet

1 participant