MCPcopy Create free account
hub / github.com/PrairieLearn/PrairieLearn / singleRequest

Function singleRequest

tools/load-test.js:218–241  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

216}
217
218async function singleRequest() {
219 const totalStartMS = Date.now();
220 let startMS;
221
222 startMS = Date.now();
223 const courseInstanceUrl = await getCourseInstanceUrl();
224 const timeHomepage = (Date.now() - startMS) / 1000;
225
226 startMS = Date.now();
227 const questionUrl = await getQuestionUrl(courseInstanceUrl);
228 const timeQuestions = (Date.now() - startMS) / 1000;
229
230 startMS = Date.now();
231 const questionSubmitInfo = await getQuestionSubmitInfo(questionUrl);
232 const timeQuestion = (Date.now() - startMS) / 1000;
233
234 startMS = Date.now();
235 await postQuestionAnswer(questionSubmitInfo);
236 const timeSubmit = (Date.now() - startMS) / 1000;
237
238 const timeTotal = (Date.now() - totalStartMS) / 1000;
239
240 return {timeHomepage, timeQuestions, timeQuestion, timeSubmit, timeTotal};
241}
242
243async function singleClientTest(iterations, iClient, clients) {
244 let results = {

Callers 1

singleClientTestFunction · 0.85

Calls 4

getCourseInstanceUrlFunction · 0.85
getQuestionUrlFunction · 0.85
getQuestionSubmitInfoFunction · 0.85
postQuestionAnswerFunction · 0.85

Tested by

no test coverage detected