* Mixed workload tests
(server)
| 468 | * Mixed workload tests |
| 469 | */ |
| 470 | async function mixedWorkloadTests (server) { |
| 471 | const baseUrl = `http://localhost:${server.server.address().port}`; |
| 472 | |
| 473 | console.log("\n🔥 Mixed Workload Tests"); |
| 474 | console.log("=".repeat(50)); |
| 475 | |
| 476 | // Create a mixed set of requests |
| 477 | const requests = [ |
| 478 | { path: "/ping", method: "GET" }, |
| 479 | { path: "/hello", method: "GET" }, |
| 480 | { path: "/users", method: "GET" }, |
| 481 | { path: "/users/1", method: "GET" }, |
| 482 | { path: "/users/50", method: "GET" }, |
| 483 | { |
| 484 | path: "/echo", |
| 485 | method: "POST", |
| 486 | body: JSON.stringify({ test: "data", id: Math.random() }) |
| 487 | } |
| 488 | ]; |
| 489 | |
| 490 | const result = await runLoadTest({ |
| 491 | title: "Mixed Workload Test", |
| 492 | url: baseUrl, |
| 493 | requests: requests, |
| 494 | connections: 30, |
| 495 | duration: 20 |
| 496 | }); |
| 497 | |
| 498 | return [{ title: "Mixed Workload", result }]; |
| 499 | } |
| 500 | |
| 501 | /** |
| 502 | * Tests with hypermedia options explicitly enabled for performance comparison |
no test coverage detected