-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR 397.1 #4066
PR 397.1 #4066
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks great added some comments mainly around configurability but logic itself looks good.
The logs are super useful thanks for adding them
https://drive.google.com/drive/folders/1_qRS8XMCEyFXB4wSqQRsRe6S5E9PIgMu
// Create a header for the main log file | ||
fs.writeFileSync( | ||
mainLogFile, | ||
`AGENT SCALABILITY ANALYSIS\n` + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make this a single JSX string instead of multiple and make this a function in a utils file taking in the data as params that way if we have other scaling tests we can reference this
console.log('Starting Agent Scalability Analysis'); | ||
console.log(`Log file: ${mainLogFile}`); | ||
console.log('-------------------------------------'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elizaLogger everywhere
// Add visualization hint | ||
fs.appendFileSync( | ||
mainLogFile, | ||
`\n\nVISUALIZATION\n` + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
// If tests fail, still save the output and error | ||
fs.appendFileSync( | ||
mainLogFile, | ||
`\n\nERROR DURING TESTING:\n` + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here re adding to util and using here
|
||
// Write header to summary file | ||
fs.writeFileSync(summaryLogFile, | ||
'Scale Testing Summary - Finding Breaking Points\n' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here re making this a util
const metrics = await this.runSequentialLoadTest(runtime, config); | ||
|
||
// Check if this is a breaking point (high error rate or very slow responses) | ||
if (metrics.errorCount > 0.2 * metrics.messagesSent || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great addition - let's make these thresholds configurable / easier to discern by making this a constant and also consider running the load tests 3 with 3 different configurations of it i.e. with 3 thresholds like HIGH, MED, LOW and thresholds configured accordingly. That way in a single run we can see BREAKING POINT IDENTIFIED WITH HIGH THRESHOLD(details of thresholds), BREAKING POINT IDENTIFIED WITH MID THRESHOLD (details) , BREAKING POINT IDENTIFIED WITH LOW THRESHOLD (thresholds) lmk if you have any questions
|
||
// Write summary conclusion | ||
fs.appendFileSync(summaryLogFile, | ||
'\n\nSCALABILITY ANALYSIS\n' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in util
} catch (error) { | ||
breakingPointIdentified = true; | ||
logger.error(`BREAKING POINT: Error running test for ${config.description}:`, error); | ||
fs.appendFileSync(detailedLogFile, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^
// Check memory periodically during participant creation | ||
if (i % 100 === 0) { | ||
const currentMemory = process.memoryUsage().heapUsed / 1024 / 1024; | ||
if (currentMemory > 1024) { // If memory usage exceeds 1GB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make this configurable
} | ||
|
||
// Add early breaking point detection | ||
if (responseTime > 5000) { // If any single response takes > 5 seconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks for addressing comments
Relates to
Issue #397.1:Load Testing Agents at Scale
Risks
Low. This PR introduces load testing infrastructure that simulates high volumes of concurrent agent interactions. Risks include:
Background
What does this PR do?
Implements a load testing framework to simulate agent interactions in social environments at various scales (2-1000+ agents). The system measures performance metrics, stability, and error rates to determine system breaking points and scalability thresholds.
What kind of change is this?
Features (non-breaking change which adds functionality)
Documentation changes needed?
My changes require a change to the project documentation to explain how to run and interpret load tests.
Testing
Where should a reviewer start?
packages/the-org/src/loadTest/index.ts
- Main implementationpackages/the-org/src/loadTest/test-runner.js
- Test execution logicpackages/the-org/src/loadTest/types.ts
- Type definitionspackages/the-org/src/loadTest/service.ts
- Supporting servicesDetailed testing steps
Run small-scale test (2 agents):
Run medium-scale test (10-50 agents):
For large-scale tests (100+ agents), use dedicated environment: