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

Interarrival as throttle #186

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

NelsonVides
Copy link
Collaborator

No description provided.

@NelsonVides NelsonVides force-pushed the interarrival_as_throttle branch from a5f279b to 42d65c5 Compare June 14, 2024 20:41
@codecov-commenter
Copy link

codecov-commenter commented Jun 14, 2024

Codecov Report

Attention: Patch coverage is 91.13924% with 7 lines in your changes missing coverage. Please review.

Project coverage is 77.20%. Comparing base (d842d1f) to head (acfdabc).

Files with missing lines Patch % Lines
src/users/amoc_users_sup.erl 86.66% 4 Missing ⚠️
src/amoc_controller.erl 87.50% 2 Missing ⚠️
src/users/amoc_users_worker_sup.erl 96.55% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #186      +/-   ##
==========================================
+ Coverage   75.83%   77.20%   +1.37%     
==========================================
  Files          32       32              
  Lines        1200     1167      -33     
==========================================
- Hits          910      901       -9     
+ Misses        290      266      -24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@NelsonVides NelsonVides force-pushed the throttle_api branch 2 times, most recently from c16c3d6 to 2ae0719 Compare July 1, 2024 05:54
@NelsonVides NelsonVides force-pushed the throttle_api branch 16 times, most recently from 73f1e61 to 92ef315 Compare November 29, 2024 14:59
Base automatically changed from throttle_api to master November 29, 2024 15:28
This also very importantly removes timers and loops from the critical
controller process.
@NelsonVides NelsonVides force-pushed the interarrival_as_throttle branch from 58f94c0 to 416b25e Compare December 2, 2024 20:55
@NelsonVides NelsonVides force-pushed the interarrival_as_throttle branch from 416b25e to 8886183 Compare December 2, 2024 21:01
@NelsonVides NelsonVides marked this pull request as ready for review December 4, 2024 10:38
@@ -25,7 +25,7 @@ do(Scenario, Count, Settings) ->
case {amoc_controller:start_scenario(Scenario, Settings), Count} of
{ok, 0} -> ok;
{ok, Count} -> amoc_controller:add_users(1, Count);
Error -> Error
{Error, _} -> Error
Copy link
Collaborator

Choose a reason for hiding this comment

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

why? according to the spec it was correct before the change:

-spec start_scenario(amoc:scenario(), amoc_config:settings()) ->
ok | {error, term()}.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Error was {{error, Reason}, Count}, which is not the spec. Here we want to return the error that amoc_controller:start_scenario/2 returned.

@@ -143,19 +143,13 @@ maybe_stop_timer(#state{tref = undefined}) ->
ok;
maybe_stop_timer(#state{tref = TRef}) ->
{ok, cancel} = timer:cancel(TRef),
consume_all_timer_ticks(delay_between_executions).
amoc_throttle_controller:consume_all_messages(delay_between_executions).
Copy link
Collaborator

@DenysGonchar DenysGonchar Dec 12, 2024

Choose a reason for hiding this comment

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

revert this change, it introduces erronous impression that we do here something with amoc_throttle_controller process.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So where would you put it? The code was duplicated, wanted to put it in some common helper.

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.

3 participants