c# - Load testing server log-in -
i'm developer no test-experience.
i investigating how load test server handles log-ins mobile app. users logs in @ beginning of work-shift. therefor there heavy load during morning when wants log-in. have had issues server crashing high loads , want replicate behavior analyze it.
i got source-code developed application tests logging in, able add list of users , and let them log-in x amount of times. uses backgroundworker, can gather still use 1 thread , requests sent synchronously , not accurate representation of actual load in production?
private void backgroundworker1_dowork(object sender, doworkeventargs e) { foreach (iclient client in clientlist) { runtest(client); } }
how can modify better reflect actual usage? or there easier way test load?
i have looked using tasks , tpl. i'm having trouble wrapping head around it.
if instead do:
private void backgroundworker1_dowork(object sender, doworkeventargs e) { foreach (iclient client in clientlist) { task.factory.startnew(() => runtest(client)); } }
will "automatically" start new thread , manage it?
no, wrong backgroundworker1_dowork
launching background thread-pool thread , task.factory.startnew(() => { ... });
call. there no point in doing what-so-ever far can see.
i testing serially, why need multi-thread it? like:
private void runloadtests() { foreach (iclient client in clientlist) runisolatedtest(client)); }
in runisolatedtest
method can add load testing , ever want. ensure test each client run on same thread (which won't give accuracy in terms of other operations thread taking part in, better spinning off multiple threads!). can @ cpu-ticks or other processor stats required.
i hope helps.
Comments
Post a Comment