-
Notifications
You must be signed in to change notification settings - Fork 24
Interarrival as throttle #186
New issue
Have a question about th 8000 is 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
base: master
Are you sure you want to change the base?
Conversation
a5f279b
to
42d65c5
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #186 +/- ##
==========================================
+ Coverage 75.83% 77.03% +1.20%
==========================================
Files 32 32
Lines 1200 1167 -33
==========================================
- Hits 910 899 -11
+ Misses 290 268 -22 ☔ View full report in Codecov by Sentry. |
c16c3d6
to
2ae0719
Compare
73f1e61
to
92ef315
Compare
This also very importantly removes timers and loops from the critical controller process.
58f94c0
to
416b25e
Compare
416b25e
to
8886183
Compare
incr_no_of_users(SupNum) when SupNum > 1 -> | ||
-spec handle_up_user(non_neg_integer(), pid(), amoc_scenario:user_id()) -> any(). | ||
handle_up_user(SupNum, Pid, Id) when SupNum > 1 -> | ||
ets:insert(?TABLE, {Pid, Id}), |
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.
can we just put user_id
into the process dictionary of the user process? and add an interface at amoc_user
to get user_id
by pid
(must be an rpc call for remote processes since process_info interface works only for the local processes)
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.
I'm not sure to understand what does that give. This is called by the supervisor worker, not the user process 🤔
src/users/amoc_users_sup.erl
Outdated
%% Supervisor | ||
|
||
%% @private | ||
-spec start_link() -> supervisor:startlink_ret(). | ||
start_link() -> | ||
Ret = supervisor:start_link({local, ?MODULE}, ?MODULE, no_args), | ||
UserSups = supervisor:which_children(?MODULE), | ||
IndexedSupsUnsorted = [ {Pid, N} || {{amoc_users_worker_sup, N}, Pid, _, _} <- UserSups], | ||
IndexedSupsUnsorted = [ {Pid, N} || {{amoc_users_worker_sup, N}, Pid, _, _} <- UserSups, |
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.
could you remind me why it's unsorted?
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.
and please add a comment at indexes/0
that we start indexes from 2 to simplify user_count atomics management.
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.
They'll be returned in reversed order from where they were started, so if they were declared as 1..12, this will return 12..1, so maybe even a reverse would do. But just to be safe I thought of a keysort.
Objects | ||
end, | ||
stop_children_assignments(Users, Force), | ||
length(Users). | ||
|
||
-spec get_all_children() -> [{pid(), amoc_scenario:user_id()}]. | ||
get_all_children() -> |
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.
seems that this function is used for testing only, we can remove it and rework testing a bit.
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.
Not sure how without literally doing ets:tab2list from tests instead of here, but that'd make this one a leaky abstraction 🤔
No description provided.