mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-10-27 07:51:52 +00:00
feat(scheduler): execute load-test-agent daily run
- Implement `scripts/agent/simple-relay.mjs` for local load testing - Execute `load-test-agent` prompt via scheduler flow - Generate load test reports and run artifacts - Complete daily task for `load-test-agent` Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
bb4b860695
commit
45f0e16631
9 files changed
+300
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import { WebSocketServer } from 'ws';
|
||||
import http from 'http';
|
||||
|
||||
const server = http.createServer();
|
||||
const wss = new WebSocketServer({ server });
|
||||
|
||||
wss.on('connection', (ws) => {
|
||||
ws.on('message', (message) => {
|
||||
try {
|
||||
const data = JSON.parse(message);
|
||||
const type = data[0];
|
||||
if (type === 'REQ') {
|
||||
const subId = data[1];
|
||||
ws.send(JSON.stringify(['EOSE', subId]));
|
||||
} else if (type === 'EVENT') {
|
||||
const event = data[1];
|
||||
ws.send(JSON.stringify(['OK', event.id, true, '']));
|
||||
}
|
||||
} catch (_err) {
|
||||
// ignore
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
server.listen(0, '127.0.0.1', () => {
|
||||
const address = server.address();
|
||||
console.log(`ws://127.0.0.1:${address.port}`);
|
||||
});
|
||||
Reference in new issue
Block a user