-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat: Use ets for last-known server-time. #136
feat: Use ets for last-known server-time. #136
Conversation
@@ -46,8 +47,17 @@ send_events(Tag, Events, SummaryEvent) -> | |||
|
|||
-spec get_last_server_time(Tag :: atom()) -> integer(). | |||
get_last_server_time(Tag) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of calling into the process this now looks up a value from ets.
@@ -67,6 +77,7 @@ start_link(Tag) -> | |||
{ok, State :: state()} | {ok, State :: state(), timeout() | hibernate} | | |||
{stop, Reason :: term()} | ignore. | |||
init([Tag]) -> | |||
_Tid = ets:new(ets_table_name(Tag), [set, named_table, {read_concurrency, true}]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This theoretically should be a read-heavy operation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this data were large, then write_concurrency would probably be reasonable, but it is very small.
The contract tests cover this, but it would be nice to have some unit tests for it as well. |
This can be reviewed, but before release I am figuring out how to do some performance validation. |
🤖 I have created a release *beep* *boop* --- ## [3.4.0](v3.3.1...v3.4.0) (2024-10-24) ### Features * Add support for client-side prerequisite events. ([167308a](167308a)) * Add support for client-side visibility for all_flags_state. ([167308a](167308a)) * Use ets for last-known server-time. ([#136](#136)) ([568ac51](568ac51)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Addresses main bottleneck of #132.