* Benchmark: User Login
(name)
| 460 | * Benchmark: User Login |
| 461 | */ |
| 462 | async 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) |
nothing calls this directly
no test coverage detected