ruvector/packages/agentic-synth/examples/benchmark-example.ts
Claude e333830d15
feat: Add agentic-synth package with comprehensive SDK and CLI
- 🎲 Standalone synthetic data generator with SDK and CLI (npx agentic-synth)
- 🤖 Multi-provider AI integration (Gemini & OpenRouter)
-  Context caching and intelligent model routing
- 📊 Multiple data types: time-series, events, structured data
- 🔌 Optional integrations: midstreamer, agentic-robotics, ruvector
- 🧪 98% test coverage with comprehensive test suite
- 📈 Benchmarking and performance optimization
- 📚 SEO-optimized documentation with 35+ keywords
- 🚀 Production-ready with ESM/CJS dual format exports

Built by 5-agent swarm: architect, coder, tester, perf-analyzer, api-docs
2025-11-21 22:09:46 +00:00

54 lines
1.6 KiB
TypeScript

/**
* Benchmark usage example
*/
import { BenchmarkRunner } from '../src/benchmarks/runner.js';
import { ThroughputBenchmark } from '../src/benchmarks/throughput.js';
import { LatencyBenchmark } from '../src/benchmarks/latency.js';
import { MemoryBenchmark } from '../src/benchmarks/memory.js';
import { CacheBenchmark } from '../src/benchmarks/cache.js';
import { BenchmarkAnalyzer } from '../src/benchmarks/analyzer.js';
import { BenchmarkReporter } from '../src/benchmarks/reporter.js';
import { AgenticSynth } from '../src/index.js';
async function main() {
console.log('🔥 Running Performance Benchmarks\n');
// Initialize
const synth = new AgenticSynth({
enableCache: true,
cacheSize: 1000,
maxConcurrency: 100,
});
const runner = new BenchmarkRunner();
const analyzer = new BenchmarkAnalyzer();
const reporter = new BenchmarkReporter();
// Register benchmark suites
runner.registerSuite(new ThroughputBenchmark(synth));
runner.registerSuite(new LatencyBenchmark(synth));
runner.registerSuite(new MemoryBenchmark(synth));
runner.registerSuite(new CacheBenchmark(synth));
// Run benchmarks
const result = await runner.runAll({
name: 'Performance Test',
iterations: 5,
concurrency: 50,
warmupIterations: 1,
timeout: 300000,
});
// Analyze results
analyzer.analyze(result);
// Generate reports
await reporter.generateMarkdown([result], 'benchmark-report.md');
await reporter.generateJSON([result], 'benchmark-data.json');
console.log('\n✅ Benchmarks complete!');
console.log('📄 Reports saved to benchmark-report.md and benchmark-data.json');
}
main().catch(console.error);