MCPcopy Index your code
hub / github.com/parse-community/parse-server / benchmarkUserLogin

Function benchmarkUserLogin

benchmark/performance.js:462–487  ·  view source on GitHub ↗

* Benchmark: User Login

(name)

Source from the content-addressed store, hash-verified

460 * Benchmark: User Login
461 */
462async function benchmarkUserLogin(name) {
463 // Setup: Create test users
464 const users = [];
465
466 for (let i = 0; i < 10; i++) {
467 const user = new Parse.User();
468 user.set('username', `benchmark_login_user_${i}`);
469 user.set('password', 'benchmark_password');
470 user.set('email', `login${i}@example.com`);
471 await user.signUp();
472 users.push({ username: user.get('username'), password: 'benchmark_password' });
473 await Parse.User.logOut();
474 }
475
476 let counter = 0;
477
478 return measureOperation({
479 name,
480 iterations: 500,
481 operation: async () => {
482 const userCreds = users[counter++ % users.length];
483 await Parse.User.logIn(userCreds.username, userCreds.password);
484 await Parse.User.logOut();
485 },
486 });
487}
488
489/**
490 * Benchmark: Query with Include (Parallel Pointers)

Callers

nothing calls this directly

Calls 2

measureOperationFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected