MCPcopy Create free account
hub / github.com/avoidwork/tenso / mixedWorkloadTests

Function mixedWorkloadTests

benchmarks/load-test.js:470–499  ·  view source on GitHub ↗

* Mixed workload tests

(server)

Source from the content-addressed store, hash-verified

468 * Mixed workload tests
469 */
470async 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

Callers 1

mainFunction · 0.85

Calls 2

runLoadTestFunction · 0.85
logMethod · 0.80

Tested by

no test coverage detected