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

feat: Use ets for last-known server-time. #136

Merged
merged 13 commits into from
Oct 22, 2024

Conversation

kinyoklion
Copy link
Member

@kinyoklion kinyoklion commented Oct 18, 2024

Addresses main bottleneck of #132.

@@ -46,8 +47,17 @@ send_events(Tag, Events, SummaryEvent) ->

-spec get_last_server_time(Tag :: atom()) -> integer().
get_last_server_time(Tag) ->
Copy link
Member Author

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}]),
Copy link
Member Author

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.

Copy link
Member Author

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.

@kinyoklion
Copy link
Member Author

The contract tests cover this, but it would be nice to have some unit tests for it as well.

@kinyoklion kinyoklion marked this pull request as ready for review October 21, 2024 15:28
@kinyoklion kinyoklion requested a review from a team as a code owner October 21, 2024 15:28
@kinyoklion
Copy link
Member Author

This can be reviewed, but before release I am figuring out how to do some performance validation.

Base automatically changed from rlamb/meck-cover to main October 21, 2024 20:26
@kinyoklion kinyoklion merged commit 568ac51 into main Oct 22, 2024
4 checks passed
@kinyoklion kinyoklion deleted the rlamb/SDK-677/move-get-last-server-time-to-ets branch October 22, 2024 16:45
kinyoklion pushed a commit that referenced this pull request Oct 24, 2024
🤖 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>
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.

2 participants