agentic-qe 1.0.5 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/qe-coverage-analyzer.md +8 -0
- package/.claude/agents/qe-flaky-test-hunter.md +9 -1
- package/.claude/agents/qe-quality-analyzer.md +405 -0
- package/.claude/agents/qe-test-generator.md +7 -0
- package/.claude/agents/reasoning/agent.md +816 -0
- package/.claude/agents/reasoning/goal-planner.md +73 -0
- package/.claude/settings.json +21 -20
- package/.claude/skills/README.md +124 -0
- package/.claude/skills/agentdb-advanced/SKILL.md +550 -0
- package/.claude/skills/agentdb-learning/SKILL.md +545 -0
- package/.claude/skills/agentdb-memory-patterns/SKILL.md +339 -0
- package/.claude/skills/agentdb-optimization/SKILL.md +509 -0
- package/.claude/skills/agentdb-vector-search/SKILL.md +339 -0
- package/.claude/skills/agentic-quality-engineering/SKILL.md +604 -0
- package/.claude/skills/api-testing-patterns/SKILL.md +686 -0
- package/.claude/skills/bug-reporting-excellence/SKILL.md +632 -0
- package/.claude/skills/code-review-quality/SKILL.md +683 -0
- package/.claude/skills/consultancy-practices/SKILL.md +540 -0
- package/.claude/skills/context-driven-testing/SKILL.md +466 -0
- package/.claude/skills/exploratory-testing-advanced/SKILL.md +676 -0
- package/.claude/skills/flow-nexus-neural/SKILL.md +738 -0
- package/.claude/skills/flow-nexus-platform/SKILL.md +1157 -0
- package/.claude/skills/flow-nexus-swarm/SKILL.md +610 -0
- package/.claude/skills/github-code-review/SKILL.md +1140 -0
- package/.claude/skills/github-multi-repo/SKILL.md +874 -0
- package/.claude/skills/github-project-management/SKILL.md +1277 -0
- package/.claude/skills/github-release-management/SKILL.md +1081 -0
- package/.claude/skills/github-workflow-automation/SKILL.md +1065 -0
- package/.claude/skills/hive-mind-advanced/SKILL.md +712 -0
- package/.claude/skills/holistic-testing-pact/SKILL.md +225 -0
- package/.claude/skills/hooks-automation/SKILL.md +1201 -0
- package/.claude/skills/pair-programming/SKILL.md +1202 -0
- package/.claude/skills/performance-analysis/SKILL.md +563 -0
- package/.claude/skills/performance-testing/SKILL.md +662 -0
- package/.claude/skills/quality-metrics/SKILL.md +592 -0
- package/.claude/skills/reasoningbank-agentdb/SKILL.md +446 -0
- package/.claude/skills/reasoningbank-intelligence/SKILL.md +201 -0
- package/.claude/skills/refactoring-patterns/SKILL.md +778 -0
- package/.claude/skills/risk-based-testing/SKILL.md +721 -0
- package/.claude/skills/security-testing/SKILL.md +651 -0
- package/.claude/skills/skill-builder/SKILL.md +910 -0
- package/.claude/skills/sparc-methodology/SKILL.md +1115 -0
- package/.claude/skills/stream-chain/SKILL.md +563 -0
- package/.claude/skills/swarm-advanced/SKILL.md +973 -0
- package/.claude/skills/swarm-orchestration/SKILL.md +179 -0
- package/.claude/skills/tdd-london-chicago/SKILL.md +567 -0
- package/.claude/skills/technical-writing/SKILL.md +235 -0
- package/.claude/skills/test-automation-strategy/SKILL.md +842 -0
- package/.claude/skills/verification-quality/SKILL.md +649 -0
- package/.claude/skills/xp-practices/SKILL.md +671 -0
- package/.claude/statusline-command.sh +176 -0
- package/CHANGELOG.md +645 -1
- package/CONTRIBUTING.md +51 -0
- package/README.md +758 -162
- package/bin/aqe +90 -938
- package/config/improvement-loop.config.ts +323 -0
- package/config/neural-agent.config.ts +197 -0
- package/dist/adapters/MemoryStoreAdapter.d.ts +16 -16
- package/dist/adapters/MemoryStoreAdapter.d.ts.map +1 -1
- package/dist/adapters/MemoryStoreAdapter.js +22 -16
- package/dist/adapters/MemoryStoreAdapter.js.map +1 -1
- package/dist/agents/BaseAgent.d.ts +69 -0
- package/dist/agents/BaseAgent.d.ts.map +1 -1
- package/dist/agents/BaseAgent.js +382 -1
- package/dist/agents/BaseAgent.js.map +1 -1
- package/dist/agents/CoverageAnalyzerAgent.d.ts +69 -3
- package/dist/agents/CoverageAnalyzerAgent.d.ts.map +1 -1
- package/dist/agents/CoverageAnalyzerAgent.js +418 -51
- package/dist/agents/CoverageAnalyzerAgent.js.map +1 -1
- package/dist/agents/DeploymentReadinessAgent.d.ts.map +1 -1
- package/dist/agents/DeploymentReadinessAgent.js +13 -13
- package/dist/agents/DeploymentReadinessAgent.js.map +1 -1
- package/dist/agents/FlakyTestHunterAgent.d.ts +76 -4
- package/dist/agents/FlakyTestHunterAgent.d.ts.map +1 -1
- package/dist/agents/FlakyTestHunterAgent.js +375 -13
- package/dist/agents/FlakyTestHunterAgent.js.map +1 -1
- package/dist/agents/FleetCommanderAgent.d.ts.map +1 -1
- package/dist/agents/FleetCommanderAgent.js +2 -2
- package/dist/agents/FleetCommanderAgent.js.map +1 -1
- package/dist/agents/LearningAgent.d.ts +84 -0
- package/dist/agents/LearningAgent.d.ts.map +1 -0
- package/dist/agents/LearningAgent.js +197 -0
- package/dist/agents/LearningAgent.js.map +1 -0
- package/dist/agents/NeuralAgentExtension.d.ts +117 -0
- package/dist/agents/NeuralAgentExtension.d.ts.map +1 -0
- package/dist/agents/NeuralAgentExtension.js +288 -0
- package/dist/agents/NeuralAgentExtension.js.map +1 -0
- package/dist/agents/PerformanceTesterAgent.d.ts.map +1 -1
- package/dist/agents/PerformanceTesterAgent.js +4 -3
- package/dist/agents/PerformanceTesterAgent.js.map +1 -1
- package/dist/agents/ProductionIntelligenceAgent.js +7 -7
- package/dist/agents/ProductionIntelligenceAgent.js.map +1 -1
- package/dist/agents/QualityAnalyzerAgent.d.ts.map +1 -1
- package/dist/agents/QualityAnalyzerAgent.js +2 -2
- package/dist/agents/QualityAnalyzerAgent.js.map +1 -1
- package/dist/agents/QualityGateAgent.js +5 -5
- package/dist/agents/QualityGateAgent.js.map +1 -1
- package/dist/agents/RegressionRiskAnalyzerAgent.js +7 -7
- package/dist/agents/RegressionRiskAnalyzerAgent.js.map +1 -1
- package/dist/agents/RequirementsValidatorAgent.d.ts.map +1 -1
- package/dist/agents/RequirementsValidatorAgent.js +1 -1
- package/dist/agents/RequirementsValidatorAgent.js.map +1 -1
- package/dist/agents/SecurityScannerAgent.js +6 -6
- package/dist/agents/SecurityScannerAgent.js.map +1 -1
- package/dist/agents/TestExecutorAgent.d.ts.map +1 -1
- package/dist/agents/TestExecutorAgent.js +1 -3
- package/dist/agents/TestExecutorAgent.js.map +1 -1
- package/dist/agents/TestGeneratorAgent.d.ts +53 -2
- package/dist/agents/TestGeneratorAgent.d.ts.map +1 -1
- package/dist/agents/TestGeneratorAgent.js +372 -31
- package/dist/agents/TestGeneratorAgent.js.map +1 -1
- package/dist/agents/mixins/NeuralCapableMixin.d.ts +130 -0
- package/dist/agents/mixins/NeuralCapableMixin.d.ts.map +1 -0
- package/dist/agents/mixins/NeuralCapableMixin.js +358 -0
- package/dist/agents/mixins/NeuralCapableMixin.js.map +1 -0
- package/dist/agents/mixins/QUICCapableMixin.d.ts +34 -0
- package/dist/agents/mixins/QUICCapableMixin.d.ts.map +1 -0
- package/dist/agents/mixins/QUICCapableMixin.js +346 -0
- package/dist/agents/mixins/QUICCapableMixin.js.map +1 -0
- package/dist/cli/commands/agent/index.d.ts +5 -0
- package/dist/cli/commands/agent/index.d.ts.map +1 -1
- package/dist/cli/commands/agent/index.js +11 -6
- package/dist/cli/commands/agent/index.js.map +1 -1
- package/dist/cli/commands/agent/kill.d.ts +13 -0
- package/dist/cli/commands/agent/kill.d.ts.map +1 -0
- package/dist/cli/commands/agent/kill.js +65 -0
- package/dist/cli/commands/agent/kill.js.map +1 -0
- package/dist/cli/commands/agent/list.d.ts +19 -0
- package/dist/cli/commands/agent/list.d.ts.map +1 -0
- package/dist/cli/commands/agent/list.js +92 -0
- package/dist/cli/commands/agent/list.js.map +1 -0
- package/dist/cli/commands/agent/logs.d.ts +14 -0
- package/dist/cli/commands/agent/logs.d.ts.map +1 -0
- package/dist/cli/commands/agent/logs.js +77 -0
- package/dist/cli/commands/agent/logs.js.map +1 -0
- package/dist/cli/commands/agent/metrics.d.ts +21 -0
- package/dist/cli/commands/agent/metrics.d.ts.map +1 -0
- package/dist/cli/commands/agent/metrics.js +87 -0
- package/dist/cli/commands/agent/metrics.js.map +1 -0
- package/dist/cli/commands/agent/spawn.d.ts +28 -0
- package/dist/cli/commands/agent/spawn.d.ts.map +1 -0
- package/dist/cli/commands/agent/spawn.js +83 -0
- package/dist/cli/commands/agent/spawn.js.map +1 -0
- package/dist/cli/commands/improve/index.d.ts +70 -0
- package/dist/cli/commands/improve/index.d.ts.map +1 -0
- package/dist/cli/commands/improve/index.js +530 -0
- package/dist/cli/commands/improve/index.js.map +1 -0
- package/dist/cli/commands/init.d.ts +57 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +1127 -42
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learn/index.d.ts +68 -0
- package/dist/cli/commands/learn/index.d.ts.map +1 -0
- package/dist/cli/commands/learn/index.js +431 -0
- package/dist/cli/commands/learn/index.js.map +1 -0
- package/dist/cli/commands/patterns/index.d.ts +75 -0
- package/dist/cli/commands/patterns/index.d.ts.map +1 -0
- package/dist/cli/commands/patterns/index.js +502 -0
- package/dist/cli/commands/patterns/index.js.map +1 -0
- package/dist/cli/commands/skills/index.d.ts +51 -0
- package/dist/cli/commands/skills/index.d.ts.map +1 -0
- package/dist/cli/commands/skills/index.js +364 -0
- package/dist/cli/commands/skills/index.js.map +1 -0
- package/dist/cli/index.js +458 -8
- package/dist/cli/index.js.map +1 -1
- package/dist/core/EventBus.d.ts +38 -0
- package/dist/core/EventBus.d.ts.map +1 -1
- package/dist/core/EventBus.js +176 -31
- package/dist/core/EventBus.js.map +1 -1
- package/dist/core/FleetManager.d.ts +35 -1
- package/dist/core/FleetManager.d.ts.map +1 -1
- package/dist/core/FleetManager.js +121 -45
- package/dist/core/FleetManager.js.map +1 -1
- package/dist/core/MemoryManager.d.ts +19 -1
- package/dist/core/MemoryManager.d.ts.map +1 -1
- package/dist/core/MemoryManager.js +25 -1
- package/dist/core/MemoryManager.js.map +1 -1
- package/dist/core/embeddings/EmbeddingCache.d.ts +134 -0
- package/dist/core/embeddings/EmbeddingCache.d.ts.map +1 -0
- package/dist/core/embeddings/EmbeddingCache.js +239 -0
- package/dist/core/embeddings/EmbeddingCache.js.map +1 -0
- package/dist/core/embeddings/EmbeddingGenerator.d.ts +224 -0
- package/dist/core/embeddings/EmbeddingGenerator.d.ts.map +1 -0
- package/dist/core/embeddings/EmbeddingGenerator.js +459 -0
- package/dist/core/embeddings/EmbeddingGenerator.js.map +1 -0
- package/dist/core/embeddings/index.d.ts +15 -0
- package/dist/core/embeddings/index.d.ts.map +1 -0
- package/dist/core/embeddings/index.js +22 -0
- package/dist/core/embeddings/index.js.map +1 -0
- package/dist/core/memory/AgentDBIntegration.d.ts +35 -0
- package/dist/core/memory/AgentDBIntegration.d.ts.map +1 -0
- package/dist/core/memory/AgentDBIntegration.js +75 -0
- package/dist/core/memory/AgentDBIntegration.js.map +1 -0
- package/dist/core/memory/AgentDBManager.d.ts +200 -0
- package/dist/core/memory/AgentDBManager.d.ts.map +1 -0
- package/dist/core/memory/AgentDBManager.js +263 -0
- package/dist/core/memory/AgentDBManager.js.map +1 -0
- package/dist/core/memory/AgentDBService.d.ts +160 -0
- package/dist/core/memory/AgentDBService.d.ts.map +1 -0
- package/dist/core/memory/AgentDBService.js +450 -0
- package/dist/core/memory/AgentDBService.js.map +1 -0
- package/dist/core/memory/RealAgentDBAdapter.d.ts +51 -0
- package/dist/core/memory/RealAgentDBAdapter.d.ts.map +1 -0
- package/dist/core/memory/RealAgentDBAdapter.js +230 -0
- package/dist/core/memory/RealAgentDBAdapter.js.map +1 -0
- package/dist/core/memory/ReasoningBankAdapter.d.ts +58 -0
- package/dist/core/memory/ReasoningBankAdapter.d.ts.map +1 -0
- package/dist/core/memory/ReasoningBankAdapter.js +80 -0
- package/dist/core/memory/ReasoningBankAdapter.js.map +1 -0
- package/dist/core/memory/SwarmMemoryManager.d.ts +79 -2
- package/dist/core/memory/SwarmMemoryManager.d.ts.map +1 -1
- package/dist/core/memory/SwarmMemoryManager.js +243 -52
- package/dist/core/memory/SwarmMemoryManager.js.map +1 -1
- package/dist/core/memory/index.d.ts +4 -0
- package/dist/core/memory/index.d.ts.map +1 -1
- package/dist/core/memory/index.js +9 -1
- package/dist/core/memory/index.js.map +1 -1
- package/dist/core/neural/NeuralTrainer.d.ts +137 -0
- package/dist/core/neural/NeuralTrainer.d.ts.map +1 -0
- package/dist/core/neural/NeuralTrainer.js +543 -0
- package/dist/core/neural/NeuralTrainer.js.map +1 -0
- package/dist/core/neural/index.d.ts +8 -0
- package/dist/core/neural/index.d.ts.map +1 -0
- package/dist/core/neural/index.js +24 -0
- package/dist/core/neural/index.js.map +1 -0
- package/dist/core/neural/types.d.ts +216 -0
- package/dist/core/neural/types.d.ts.map +1 -0
- package/dist/core/neural/types.js +8 -0
- package/dist/core/neural/types.js.map +1 -0
- package/dist/core/security/CertificateValidator.d.ts +130 -0
- package/dist/core/security/CertificateValidator.d.ts.map +1 -0
- package/dist/core/security/CertificateValidator.js +376 -0
- package/dist/core/security/CertificateValidator.js.map +1 -0
- package/dist/core/transport/QUICTransport.d.ts +62 -0
- package/dist/core/transport/QUICTransport.d.ts.map +1 -0
- package/dist/core/transport/QUICTransport.js +381 -0
- package/dist/core/transport/QUICTransport.js.map +1 -0
- package/dist/core/transport/SecureQUICTransport.d.ts +71 -0
- package/dist/core/transport/SecureQUICTransport.d.ts.map +1 -0
- package/dist/core/transport/SecureQUICTransport.js +253 -0
- package/dist/core/transport/SecureQUICTransport.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/learning/AdvancedFeatureExtractor.d.ts +123 -0
- package/dist/learning/AdvancedFeatureExtractor.d.ts.map +1 -0
- package/dist/learning/AdvancedFeatureExtractor.js +423 -0
- package/dist/learning/AdvancedFeatureExtractor.js.map +1 -0
- package/dist/learning/FlakyFixRecommendations.d.ts +40 -0
- package/dist/learning/FlakyFixRecommendations.d.ts.map +1 -0
- package/dist/learning/FlakyFixRecommendations.js +247 -0
- package/dist/learning/FlakyFixRecommendations.js.map +1 -0
- package/dist/learning/FlakyPredictionModel.d.ts +67 -0
- package/dist/learning/FlakyPredictionModel.d.ts.map +1 -0
- package/dist/learning/FlakyPredictionModel.js +336 -0
- package/dist/learning/FlakyPredictionModel.js.map +1 -0
- package/dist/learning/FlakyTestDetector.d.ts +55 -0
- package/dist/learning/FlakyTestDetector.d.ts.map +1 -0
- package/dist/learning/FlakyTestDetector.js +237 -0
- package/dist/learning/FlakyTestDetector.js.map +1 -0
- package/dist/learning/ImprovementLoop.d.ts +133 -0
- package/dist/learning/ImprovementLoop.d.ts.map +1 -0
- package/dist/learning/ImprovementLoop.js +412 -0
- package/dist/learning/ImprovementLoop.js.map +1 -0
- package/dist/learning/ImprovementWorker.d.ts +83 -0
- package/dist/learning/ImprovementWorker.d.ts.map +1 -0
- package/dist/learning/ImprovementWorker.js +164 -0
- package/dist/learning/ImprovementWorker.js.map +1 -0
- package/dist/learning/LearningEngine.d.ts +144 -0
- package/dist/learning/LearningEngine.d.ts.map +1 -0
- package/dist/learning/LearningEngine.js +531 -0
- package/dist/learning/LearningEngine.js.map +1 -0
- package/dist/learning/NeuralPatternMatcher.d.ts +184 -0
- package/dist/learning/NeuralPatternMatcher.d.ts.map +1 -0
- package/dist/learning/NeuralPatternMatcher.js +702 -0
- package/dist/learning/NeuralPatternMatcher.js.map +1 -0
- package/dist/learning/NeuralTrainer.d.ts +209 -0
- package/dist/learning/NeuralTrainer.d.ts.map +1 -0
- package/dist/learning/NeuralTrainer.js +478 -0
- package/dist/learning/NeuralTrainer.js.map +1 -0
- package/dist/learning/PerformanceTracker.d.ts +118 -0
- package/dist/learning/PerformanceTracker.d.ts.map +1 -0
- package/dist/learning/PerformanceTracker.js +376 -0
- package/dist/learning/PerformanceTracker.js.map +1 -0
- package/dist/learning/StatisticalAnalysis.d.ts +47 -0
- package/dist/learning/StatisticalAnalysis.d.ts.map +1 -0
- package/dist/learning/StatisticalAnalysis.js +170 -0
- package/dist/learning/StatisticalAnalysis.js.map +1 -0
- package/dist/learning/SwarmIntegration.d.ts +107 -0
- package/dist/learning/SwarmIntegration.d.ts.map +1 -0
- package/dist/learning/SwarmIntegration.js +191 -0
- package/dist/learning/SwarmIntegration.js.map +1 -0
- package/dist/learning/index.d.ts +16 -0
- package/dist/learning/index.d.ts.map +1 -0
- package/dist/learning/index.js +32 -0
- package/dist/learning/index.js.map +1 -0
- package/dist/learning/types.d.ts +289 -0
- package/dist/learning/types.d.ts.map +1 -0
- package/dist/learning/types.js +25 -0
- package/dist/learning/types.js.map +1 -0
- package/dist/mcp/MCPToolRegistry.d.ts +34 -0
- package/dist/mcp/MCPToolRegistry.d.ts.map +1 -0
- package/dist/mcp/MCPToolRegistry.js +48 -0
- package/dist/mcp/MCPToolRegistry.js.map +1 -0
- package/dist/mcp/handlers/phase2/Phase2Tools.d.ts +175 -0
- package/dist/mcp/handlers/phase2/Phase2Tools.d.ts.map +1 -0
- package/dist/mcp/handlers/phase2/Phase2Tools.js +693 -0
- package/dist/mcp/handlers/phase2/Phase2Tools.js.map +1 -0
- package/dist/mcp/server.d.ts +4 -4
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +94 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/services/AgentRegistry.d.ts.map +1 -1
- package/dist/mcp/services/AgentRegistry.js +7 -1
- package/dist/mcp/services/AgentRegistry.js.map +1 -1
- package/dist/mcp/tools.d.ts +15 -0
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +17 -1
- package/dist/mcp/tools.js.map +1 -1
- package/dist/reasoning/CodeSignatureGenerator.d.ts +98 -0
- package/dist/reasoning/CodeSignatureGenerator.d.ts.map +1 -0
- package/dist/reasoning/CodeSignatureGenerator.js +427 -0
- package/dist/reasoning/CodeSignatureGenerator.js.map +1 -0
- package/dist/reasoning/PatternClassifier.d.ts +98 -0
- package/dist/reasoning/PatternClassifier.d.ts.map +1 -0
- package/dist/reasoning/PatternClassifier.js +345 -0
- package/dist/reasoning/PatternClassifier.js.map +1 -0
- package/dist/reasoning/PatternExtractor.d.ts +131 -0
- package/dist/reasoning/PatternExtractor.d.ts.map +1 -0
- package/dist/reasoning/PatternExtractor.js +539 -0
- package/dist/reasoning/PatternExtractor.js.map +1 -0
- package/dist/reasoning/PatternMemoryIntegration.d.ts +102 -0
- package/dist/reasoning/PatternMemoryIntegration.d.ts.map +1 -0
- package/dist/reasoning/PatternMemoryIntegration.js +336 -0
- package/dist/reasoning/PatternMemoryIntegration.js.map +1 -0
- package/dist/reasoning/QEReasoningBank.d.ts +121 -0
- package/dist/reasoning/QEReasoningBank.d.ts.map +1 -0
- package/dist/reasoning/QEReasoningBank.js +235 -0
- package/dist/reasoning/QEReasoningBank.js.map +1 -0
- package/dist/reasoning/TestTemplateCreator.d.ts +95 -0
- package/dist/reasoning/TestTemplateCreator.d.ts.map +1 -0
- package/dist/reasoning/TestTemplateCreator.js +535 -0
- package/dist/reasoning/TestTemplateCreator.js.map +1 -0
- package/dist/reasoning/index.d.ts +10 -0
- package/dist/reasoning/index.d.ts.map +1 -0
- package/dist/reasoning/index.js +31 -0
- package/dist/reasoning/index.js.map +1 -0
- package/dist/reasoning/types.d.ts +717 -0
- package/dist/reasoning/types.d.ts.map +1 -0
- package/dist/reasoning/types.js +57 -0
- package/dist/reasoning/types.js.map +1 -0
- package/dist/transport/QUICTransport.d.ts +340 -0
- package/dist/transport/QUICTransport.d.ts.map +1 -0
- package/dist/transport/QUICTransport.js +814 -0
- package/dist/transport/QUICTransport.js.map +1 -0
- package/dist/transport/UDPTransport.d.ts +348 -0
- package/dist/transport/UDPTransport.d.ts.map +1 -0
- package/dist/transport/UDPTransport.js +820 -0
- package/dist/transport/UDPTransport.js.map +1 -0
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/index.d.ts +41 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/pattern.types.d.ts +364 -0
- package/dist/types/pattern.types.d.ts.map +1 -0
- package/dist/types/pattern.types.js +60 -0
- package/dist/types/pattern.types.js.map +1 -0
- package/dist/types/quic.d.ts +339 -0
- package/dist/types/quic.d.ts.map +1 -0
- package/dist/types/quic.js +48 -0
- package/dist/types/quic.js.map +1 -0
- package/dist/utils/Config.js +1 -1
- package/dist/utils/Config.js.map +1 -1
- package/dist/utils/Database.d.ts +14 -0
- package/dist/utils/Database.d.ts.map +1 -1
- package/dist/utils/Database.js +51 -4
- package/dist/utils/Database.js.map +1 -1
- package/dist/utils/Logger.d.ts.map +1 -1
- package/dist/utils/Logger.js +111 -26
- package/dist/utils/Logger.js.map +1 -1
- package/package.json +54 -9
|
@@ -0,0 +1,662 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: performance-testing
|
|
3
|
+
description: Test application performance, scalability, and resilience. Use when planning load testing, stress testing, or optimizing system performance.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
category: testing
|
|
6
|
+
tags: [performance, load-testing, stress-testing, scalability, optimization, monitoring]
|
|
7
|
+
difficulty: intermediate
|
|
8
|
+
estimated_time: 45 minutes
|
|
9
|
+
author: user
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Performance Testing
|
|
13
|
+
|
|
14
|
+
## Core Principle
|
|
15
|
+
|
|
16
|
+
**Performance is a feature, not an afterthought.**
|
|
17
|
+
|
|
18
|
+
Test performance like you test functionality: continuously, automatically, and with clear acceptance criteria.
|
|
19
|
+
|
|
20
|
+
## Why Performance Testing Matters
|
|
21
|
+
|
|
22
|
+
### User Impact
|
|
23
|
+
- 100ms delay = 1% drop in conversions (Amazon)
|
|
24
|
+
- 53% of mobile users abandon sites taking > 3 seconds (Google)
|
|
25
|
+
- Slow = Broken (in users' eyes)
|
|
26
|
+
|
|
27
|
+
### Business Impact
|
|
28
|
+
- Lost revenue from abandoned transactions
|
|
29
|
+
- Increased infrastructure costs
|
|
30
|
+
- Degraded user experience
|
|
31
|
+
- Reputation damage
|
|
32
|
+
|
|
33
|
+
### Technical Impact
|
|
34
|
+
- Scalability limits
|
|
35
|
+
- Infrastructure bottlenecks
|
|
36
|
+
- Hidden architectural problems
|
|
37
|
+
|
|
38
|
+
## Types of Performance Testing
|
|
39
|
+
|
|
40
|
+
### 1. Load Testing
|
|
41
|
+
|
|
42
|
+
**What**: System behavior under expected load
|
|
43
|
+
|
|
44
|
+
**Goal**: Verify the system handles typical usage
|
|
45
|
+
|
|
46
|
+
**Example**:
|
|
47
|
+
- E-commerce site handling 1,000 concurrent users
|
|
48
|
+
- API serving 10,000 requests/minute
|
|
49
|
+
- Database processing 500 transactions/second
|
|
50
|
+
|
|
51
|
+
**When**: Before every major release
|
|
52
|
+
|
|
53
|
+
**Tools**: k6, JMeter, Gatling, Artillery
|
|
54
|
+
|
|
55
|
+
### 2. Stress Testing
|
|
56
|
+
|
|
57
|
+
**What**: System behavior under extreme load (beyond capacity)
|
|
58
|
+
|
|
59
|
+
**Goal**: Find breaking point, see how system fails
|
|
60
|
+
|
|
61
|
+
**Example**:
|
|
62
|
+
- Ramping up from 1,000 to 10,000 concurrent users
|
|
63
|
+
- Pushing API until response time degrades
|
|
64
|
+
- Filling database until queries slow
|
|
65
|
+
|
|
66
|
+
**When**: Before scaling infrastructure, quarterly at minimum
|
|
67
|
+
|
|
68
|
+
**What to look for**: Graceful degradation, not catastrophic failure
|
|
69
|
+
|
|
70
|
+
### 3. Spike Testing
|
|
71
|
+
|
|
72
|
+
**What**: System behavior under sudden load increase
|
|
73
|
+
|
|
74
|
+
**Goal**: Test auto-scaling, handling unexpected traffic
|
|
75
|
+
|
|
76
|
+
**Example**:
|
|
77
|
+
- Black Friday sale announcement
|
|
78
|
+
- Viral social media post
|
|
79
|
+
- Marketing campaign launch
|
|
80
|
+
|
|
81
|
+
**When**: Before major events, after infrastructure changes
|
|
82
|
+
|
|
83
|
+
**Pattern**: Instant ramp from normal to 5-10x load
|
|
84
|
+
|
|
85
|
+
### 4. Endurance/Soak Testing
|
|
86
|
+
|
|
87
|
+
**What**: System behavior over extended time
|
|
88
|
+
|
|
89
|
+
**Goal**: Find memory leaks, resource exhaustion, gradual degradation
|
|
90
|
+
|
|
91
|
+
**Example**:
|
|
92
|
+
- Run at normal load for 24-72 hours
|
|
93
|
+
- Monitor memory, connections, file handles
|
|
94
|
+
- Check for resource leaks
|
|
95
|
+
|
|
96
|
+
**When**: After significant code changes, quarterly
|
|
97
|
+
|
|
98
|
+
**What to look for**: Stable resource usage over time
|
|
99
|
+
|
|
100
|
+
### 5. Scalability Testing
|
|
101
|
+
|
|
102
|
+
**What**: How system performs as load increases
|
|
103
|
+
|
|
104
|
+
**Goal**: Validate horizontal/vertical scaling
|
|
105
|
+
|
|
106
|
+
**Example**:
|
|
107
|
+
- Add servers, measure throughput improvement
|
|
108
|
+
- Test auto-scaling triggers
|
|
109
|
+
- Find scaling limits
|
|
110
|
+
|
|
111
|
+
**When**: Before capacity planning, infrastructure changes
|
|
112
|
+
|
|
113
|
+
## Performance Testing Strategy
|
|
114
|
+
|
|
115
|
+
### Start with Requirements
|
|
116
|
+
|
|
117
|
+
**Bad**: "The system should be fast"
|
|
118
|
+
**Good**: "95th percentile response time < 200ms under 1,000 concurrent users"
|
|
119
|
+
|
|
120
|
+
**Define SLOs (Service Level Objectives)**:
|
|
121
|
+
- **Response Time**: 95th percentile < 200ms
|
|
122
|
+
- **Throughput**: 10,000 requests/minute minimum
|
|
123
|
+
- **Error Rate**: < 0.1% under load
|
|
124
|
+
- **Resource Usage**: CPU < 70%, Memory < 80%
|
|
125
|
+
|
|
126
|
+
### Identify Critical Paths
|
|
127
|
+
|
|
128
|
+
Don't test everything equally. Focus on:
|
|
129
|
+
- Revenue-generating flows (checkout, payment)
|
|
130
|
+
- High-traffic pages (homepage, product pages)
|
|
131
|
+
- Critical APIs (authentication, data access)
|
|
132
|
+
- Resource-intensive operations (search, reports)
|
|
133
|
+
|
|
134
|
+
### Realistic Scenarios
|
|
135
|
+
|
|
136
|
+
**Bad**: Every user hits homepage repeatedly
|
|
137
|
+
**Good**:
|
|
138
|
+
- 40% browse products
|
|
139
|
+
- 30% search
|
|
140
|
+
- 20% view product details
|
|
141
|
+
- 10% checkout
|
|
142
|
+
|
|
143
|
+
Include:
|
|
144
|
+
- Think time (users don't click instantly)
|
|
145
|
+
- Varied data (different products, users, queries)
|
|
146
|
+
- Realistic workflows (browse → search → add to cart → checkout)
|
|
147
|
+
|
|
148
|
+
## Setting Up Performance Tests
|
|
149
|
+
|
|
150
|
+
### Test Environment
|
|
151
|
+
|
|
152
|
+
**Ideal**: Production-like infrastructure
|
|
153
|
+
- Same server specs
|
|
154
|
+
- Same database size
|
|
155
|
+
- Same network topology
|
|
156
|
+
- Same third-party integrations (or mocks)
|
|
157
|
+
|
|
158
|
+
**Reality**: Often scaled-down version
|
|
159
|
+
- Document differences
|
|
160
|
+
- Extrapolate results carefully
|
|
161
|
+
- Validate with production monitoring
|
|
162
|
+
|
|
163
|
+
### Test Data
|
|
164
|
+
|
|
165
|
+
**Requirements**:
|
|
166
|
+
- Realistic volume (don't test with 100 users when you have 10M)
|
|
167
|
+
- Varied data (avoid cache hits skewing results)
|
|
168
|
+
- Production-like distribution (80/20 rule applies)
|
|
169
|
+
|
|
170
|
+
**Example**:
|
|
171
|
+
```
|
|
172
|
+
Products: 100,000 (matching production)
|
|
173
|
+
Users: 50,000 test accounts
|
|
174
|
+
Orders: 1M historical orders
|
|
175
|
+
Search queries: Real query distribution
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Monitoring During Tests
|
|
179
|
+
|
|
180
|
+
**Essential metrics**:
|
|
181
|
+
- Response time (avg, 50th, 95th, 99th percentile)
|
|
182
|
+
- Throughput (requests/second)
|
|
183
|
+
- Error rate
|
|
184
|
+
- CPU, memory, disk I/O
|
|
185
|
+
- Database query time
|
|
186
|
+
- Network latency
|
|
187
|
+
|
|
188
|
+
**Tools**:
|
|
189
|
+
- Application: New Relic, Datadog, Dynatrace
|
|
190
|
+
- Infrastructure: Prometheus, Grafana
|
|
191
|
+
- Database: Query analyzers, slow query logs
|
|
192
|
+
|
|
193
|
+
## Common Performance Bottlenecks
|
|
194
|
+
|
|
195
|
+
### 1. Database
|
|
196
|
+
|
|
197
|
+
**Symptoms**:
|
|
198
|
+
- Slow queries under load
|
|
199
|
+
- Connection pool exhaustion
|
|
200
|
+
- Lock contention
|
|
201
|
+
|
|
202
|
+
**Solutions**:
|
|
203
|
+
- Add indexes on filtered columns
|
|
204
|
+
- Optimize N+1 queries
|
|
205
|
+
- Increase connection pool size
|
|
206
|
+
- Add read replicas
|
|
207
|
+
- Implement caching
|
|
208
|
+
|
|
209
|
+
### 2. N+1 Queries
|
|
210
|
+
|
|
211
|
+
**Problem**:
|
|
212
|
+
```javascript
|
|
213
|
+
// Load 100 orders
|
|
214
|
+
const orders = await Order.findAll();
|
|
215
|
+
|
|
216
|
+
// For each order, load customer (100 queries!)
|
|
217
|
+
for (const order of orders) {
|
|
218
|
+
const customer = await Customer.findById(order.customerId);
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**Fix**:
|
|
223
|
+
```javascript
|
|
224
|
+
// Load orders with customers in one query
|
|
225
|
+
const orders = await Order.findAll({
|
|
226
|
+
include: [Customer]
|
|
227
|
+
});
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### 3. Synchronous Processing
|
|
231
|
+
|
|
232
|
+
**Problem**: Blocking operations in request path
|
|
233
|
+
|
|
234
|
+
**Example**: Sending email during checkout
|
|
235
|
+
|
|
236
|
+
**Fix**:
|
|
237
|
+
- Use message queues (RabbitMQ, SQS)
|
|
238
|
+
- Process asynchronously
|
|
239
|
+
- Return response immediately
|
|
240
|
+
|
|
241
|
+
### 4. Memory Leaks
|
|
242
|
+
|
|
243
|
+
**Symptoms**:
|
|
244
|
+
- Memory usage grows over time
|
|
245
|
+
- Performance degrades gradually
|
|
246
|
+
- Eventually crashes
|
|
247
|
+
|
|
248
|
+
**Detection**:
|
|
249
|
+
- Endurance testing
|
|
250
|
+
- Memory profiling (heap dumps)
|
|
251
|
+
- Monitor garbage collection
|
|
252
|
+
|
|
253
|
+
**Common causes**:
|
|
254
|
+
- Event listeners not cleaned up
|
|
255
|
+
- Caches without eviction
|
|
256
|
+
- Circular references
|
|
257
|
+
- Global state accumulation
|
|
258
|
+
|
|
259
|
+
### 5. Inadequate Caching
|
|
260
|
+
|
|
261
|
+
**Problem**: Recalculating same results repeatedly
|
|
262
|
+
|
|
263
|
+
**Strategy**:
|
|
264
|
+
- Cache expensive operations
|
|
265
|
+
- Use CDN for static assets
|
|
266
|
+
- Implement application-level caching (Redis)
|
|
267
|
+
- Browser caching (Cache-Control headers)
|
|
268
|
+
|
|
269
|
+
**Balance**: Cache hit rate vs. memory usage
|
|
270
|
+
|
|
271
|
+
### 6. External Dependencies
|
|
272
|
+
|
|
273
|
+
**Problem**: Third-party APIs slow or unavailable
|
|
274
|
+
|
|
275
|
+
**Solutions**:
|
|
276
|
+
- Set aggressive timeouts
|
|
277
|
+
- Implement circuit breakers
|
|
278
|
+
- Cache responses when possible
|
|
279
|
+
- Degrade gracefully if unavailable
|
|
280
|
+
|
|
281
|
+
## Performance Testing in CI/CD
|
|
282
|
+
|
|
283
|
+
### Continuous Performance Testing
|
|
284
|
+
|
|
285
|
+
**Approach 1: Smoke Tests**
|
|
286
|
+
- Run small load test on every commit
|
|
287
|
+
- 10 concurrent users for 1 minute
|
|
288
|
+
- Catch major regressions quickly
|
|
289
|
+
|
|
290
|
+
**Approach 2: Nightly Tests**
|
|
291
|
+
- Full load test overnight
|
|
292
|
+
- More comprehensive scenarios
|
|
293
|
+
- Trend analysis over time
|
|
294
|
+
|
|
295
|
+
**Approach 3: Pre-Production Gate**
|
|
296
|
+
- Load test before production deploy
|
|
297
|
+
- Automated pass/fail criteria
|
|
298
|
+
- Block deployment if performance degrades
|
|
299
|
+
|
|
300
|
+
### Example: k6 in CI/CD
|
|
301
|
+
|
|
302
|
+
```javascript
|
|
303
|
+
// performance-test.js
|
|
304
|
+
import http from 'k6/http';
|
|
305
|
+
import { check, sleep } from 'k6';
|
|
306
|
+
|
|
307
|
+
export const options = {
|
|
308
|
+
stages: [
|
|
309
|
+
{ duration: '1m', target: 50 }, // Ramp up
|
|
310
|
+
{ duration: '3m', target: 50 }, // Stay at 50 users
|
|
311
|
+
{ duration: '1m', target: 0 }, // Ramp down
|
|
312
|
+
],
|
|
313
|
+
thresholds: {
|
|
314
|
+
http_req_duration: ['p(95)<200'], // 95% of requests < 200ms
|
|
315
|
+
http_req_failed: ['rate<0.01'], // < 1% failures
|
|
316
|
+
},
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
export default function () {
|
|
320
|
+
const res = http.get('https://api.example.com/products');
|
|
321
|
+
|
|
322
|
+
check(res, {
|
|
323
|
+
'status is 200': (r) => r.status === 200,
|
|
324
|
+
'response time < 200ms': (r) => r.timings.duration < 200,
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
sleep(1);
|
|
328
|
+
}
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
```yaml
|
|
332
|
+
# .github/workflows/performance.yml
|
|
333
|
+
name: Performance Tests
|
|
334
|
+
|
|
335
|
+
on:
|
|
336
|
+
pull_request:
|
|
337
|
+
branches: [main]
|
|
338
|
+
|
|
339
|
+
jobs:
|
|
340
|
+
performance:
|
|
341
|
+
runs-on: ubuntu-latest
|
|
342
|
+
steps:
|
|
343
|
+
- uses: actions/checkout@v2
|
|
344
|
+
|
|
345
|
+
- name: Run k6 test
|
|
346
|
+
uses: grafana/k6-action@v0.3.0
|
|
347
|
+
with:
|
|
348
|
+
filename: performance-test.js
|
|
349
|
+
|
|
350
|
+
- name: Upload results
|
|
351
|
+
uses: actions/upload-artifact@v2
|
|
352
|
+
with:
|
|
353
|
+
name: k6-results
|
|
354
|
+
path: results.json
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
## Analyzing Performance Test Results
|
|
358
|
+
|
|
359
|
+
### Key Metrics
|
|
360
|
+
|
|
361
|
+
**Response Time Distribution**:
|
|
362
|
+
- **Average**: Misleading (outliers skew it)
|
|
363
|
+
- **Median (50th percentile)**: Typical user experience
|
|
364
|
+
- **95th percentile**: "Slow but acceptable"
|
|
365
|
+
- **99th percentile**: Worst user experience
|
|
366
|
+
|
|
367
|
+
**Throughput**:
|
|
368
|
+
- Requests/second sustained
|
|
369
|
+
- How it changes with load
|
|
370
|
+
- Where it plateaus (capacity)
|
|
371
|
+
|
|
372
|
+
**Error Rate**:
|
|
373
|
+
- Should stay flat as load increases
|
|
374
|
+
- Spike indicates breaking point
|
|
375
|
+
|
|
376
|
+
### Interpreting Results
|
|
377
|
+
|
|
378
|
+
**Good**:
|
|
379
|
+
```
|
|
380
|
+
Load: 1,000 users
|
|
381
|
+
Response time p95: 180ms
|
|
382
|
+
Throughput: 5,000 req/s
|
|
383
|
+
Error rate: 0.05%
|
|
384
|
+
CPU: 65%, Memory: 70%
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
**Problems**:
|
|
388
|
+
```
|
|
389
|
+
Load: 1,000 users
|
|
390
|
+
Response time p95: 3,500ms ❌ (too slow)
|
|
391
|
+
Throughput: 500 req/s ❌ (way below target)
|
|
392
|
+
Error rate: 5% ❌ (too many errors)
|
|
393
|
+
CPU: 95%, Memory: 90% ❌ (maxed out)
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
### Root Cause Analysis
|
|
397
|
+
|
|
398
|
+
1. **Correlate metrics**: When response time spikes, what else changes?
|
|
399
|
+
2. **Check logs**: Errors, warnings, slow queries
|
|
400
|
+
3. **Profile code**: Where is time spent?
|
|
401
|
+
4. **Monitor resources**: CPU, memory, network, disk
|
|
402
|
+
5. **Trace requests**: End-to-end request flow
|
|
403
|
+
|
|
404
|
+
## Production Performance Monitoring
|
|
405
|
+
|
|
406
|
+
### Synthetic Monitoring
|
|
407
|
+
|
|
408
|
+
**What**: Automated tests hitting production
|
|
409
|
+
|
|
410
|
+
**Example**:
|
|
411
|
+
- Every 5 minutes, test critical flows
|
|
412
|
+
- Measure response time from multiple locations
|
|
413
|
+
- Alert if degradation detected
|
|
414
|
+
|
|
415
|
+
**Tools**: Pingdom, Datadog Synthetics, New Relic Synthetics
|
|
416
|
+
|
|
417
|
+
### Real User Monitoring (RUM)
|
|
418
|
+
|
|
419
|
+
**What**: Measure actual user experience
|
|
420
|
+
|
|
421
|
+
**Metrics**:
|
|
422
|
+
- Page load time
|
|
423
|
+
- Time to interactive
|
|
424
|
+
- API response times
|
|
425
|
+
- Error rates
|
|
426
|
+
|
|
427
|
+
**Tools**: Google Analytics, New Relic Browser, Datadog RUM
|
|
428
|
+
|
|
429
|
+
### Alerting
|
|
430
|
+
|
|
431
|
+
**Set alerts on**:
|
|
432
|
+
- p95 response time > threshold
|
|
433
|
+
- Error rate > 1%
|
|
434
|
+
- Throughput drops suddenly
|
|
435
|
+
- Queue depth growing
|
|
436
|
+
|
|
437
|
+
**Don't alert on**:
|
|
438
|
+
- Average response time (too noisy)
|
|
439
|
+
- Single slow request (outliers happen)
|
|
440
|
+
|
|
441
|
+
## Performance Testing Anti-Patterns
|
|
442
|
+
|
|
443
|
+
### ❌ Testing Too Late
|
|
444
|
+
|
|
445
|
+
**Problem**: Find performance issues in production
|
|
446
|
+
|
|
447
|
+
**Fix**: Test early and often, catch issues before release
|
|
448
|
+
|
|
449
|
+
### ❌ Unrealistic Scenarios
|
|
450
|
+
|
|
451
|
+
**Problem**: Test doesn't match real usage
|
|
452
|
+
|
|
453
|
+
**Example**: All users hitting same endpoint simultaneously
|
|
454
|
+
|
|
455
|
+
**Fix**: Model realistic user journeys, think time, data distribution
|
|
456
|
+
|
|
457
|
+
### ❌ Ignoring Ramp-Up
|
|
458
|
+
|
|
459
|
+
**Problem**: 0 to 1,000 users instantly
|
|
460
|
+
|
|
461
|
+
**Real world**: Traffic grows gradually (usually)
|
|
462
|
+
|
|
463
|
+
**Fix**: Ramp up over time, see how system adapts
|
|
464
|
+
|
|
465
|
+
### ❌ Testing Without Monitoring
|
|
466
|
+
|
|
467
|
+
**Problem**: Can't see what's happening during test
|
|
468
|
+
|
|
469
|
+
**Fix**: Monitor everything during tests
|
|
470
|
+
|
|
471
|
+
### ❌ No Baseline
|
|
472
|
+
|
|
473
|
+
**Problem**: Don't know if results are good or bad
|
|
474
|
+
|
|
475
|
+
**Fix**: Establish baseline, track trends over time
|
|
476
|
+
|
|
477
|
+
### ❌ One-Time Testing
|
|
478
|
+
|
|
479
|
+
**Problem**: Test once before launch, never again
|
|
480
|
+
|
|
481
|
+
**Fix**: Continuous performance testing, trend monitoring
|
|
482
|
+
|
|
483
|
+
## Tools Overview
|
|
484
|
+
|
|
485
|
+
### Load Testing Tools
|
|
486
|
+
|
|
487
|
+
**k6**: Modern, developer-friendly, JavaScript-based
|
|
488
|
+
- Good for: CI/CD integration, API testing
|
|
489
|
+
- Learning curve: Low
|
|
490
|
+
|
|
491
|
+
**JMeter**: Mature, feature-rich, GUI-based
|
|
492
|
+
- Good for: Complex scenarios, extensive protocols
|
|
493
|
+
- Learning curve: Medium
|
|
494
|
+
|
|
495
|
+
**Gatling**: Scala-based, great reporting
|
|
496
|
+
- Good for: High load, detailed metrics
|
|
497
|
+
- Learning curve: Medium
|
|
498
|
+
|
|
499
|
+
**Artillery**: Node.js, simple YAML configs
|
|
500
|
+
- Good for: Quick tests, simple scenarios
|
|
501
|
+
- Learning curve: Very low
|
|
502
|
+
|
|
503
|
+
**Locust**: Python-based, distributed testing
|
|
504
|
+
- Good for: Custom user behavior, Python ecosystems
|
|
505
|
+
- Learning curve: Low-Medium
|
|
506
|
+
|
|
507
|
+
### APM (Application Performance Monitoring)
|
|
508
|
+
|
|
509
|
+
- **New Relic**: Comprehensive, expensive
|
|
510
|
+
- **Datadog**: Infrastructure + APM combined
|
|
511
|
+
- **Dynatrace**: AI-powered root cause analysis
|
|
512
|
+
- **AppDynamics**: Enterprise-focused
|
|
513
|
+
|
|
514
|
+
### Database Profiling
|
|
515
|
+
|
|
516
|
+
- **pg_stat_statements** (PostgreSQL)
|
|
517
|
+
- **MySQL slow query log**
|
|
518
|
+
- **MongoDB profiler**
|
|
519
|
+
- **Redis SLOWLOG**
|
|
520
|
+
|
|
521
|
+
## Real-World Example
|
|
522
|
+
|
|
523
|
+
### Scenario: E-Commerce Checkout Slow
|
|
524
|
+
|
|
525
|
+
**Problem**: Checkout taking 5+ seconds under load
|
|
526
|
+
|
|
527
|
+
**Investigation**:
|
|
528
|
+
1. Load test: Reproduce issue
|
|
529
|
+
2. Monitor: Database CPU at 95%
|
|
530
|
+
3. Profile: Slow query on order creation
|
|
531
|
+
4. Root cause: Missing index on `orders.user_id`
|
|
532
|
+
|
|
533
|
+
**Fix**:
|
|
534
|
+
```sql
|
|
535
|
+
CREATE INDEX idx_orders_user_id ON orders(user_id);
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
**Result**:
|
|
539
|
+
- Checkout time: 5s → 300ms
|
|
540
|
+
- Database CPU: 95% → 40%
|
|
541
|
+
- Throughput: 5x improvement
|
|
542
|
+
|
|
543
|
+
## When NOT to Performance Test
|
|
544
|
+
|
|
545
|
+
- **MVPs/Prototypes**: Focus on validating idea first
|
|
546
|
+
- **Internal tools**: With < 10 users, performance rarely matters
|
|
547
|
+
- **One-time scripts**: Not worth the effort
|
|
548
|
+
- **Before optimization**: Profile first, optimize second, then test
|
|
549
|
+
|
|
550
|
+
## Checklist: Before Going to Production
|
|
551
|
+
|
|
552
|
+
- [ ] Load test passed (expected traffic)
|
|
553
|
+
- [ ] Stress test passed (2-3x expected traffic)
|
|
554
|
+
- [ ] Spike test passed (sudden traffic surge)
|
|
555
|
+
- [ ] Endurance test passed (24+ hours)
|
|
556
|
+
- [ ] Database indexes in place
|
|
557
|
+
- [ ] Caching configured
|
|
558
|
+
- [ ] Monitoring and alerting set up
|
|
559
|
+
- [ ] Auto-scaling configured (if applicable)
|
|
560
|
+
- [ ] Performance baseline established
|
|
561
|
+
|
|
562
|
+
## Remember
|
|
563
|
+
|
|
564
|
+
**Performance is a feature**: Test it like functionality
|
|
565
|
+
**Test continuously**: Not just before launch
|
|
566
|
+
**Monitor production**: Synthetic + real user monitoring
|
|
567
|
+
**Set realistic goals**: Based on business requirements
|
|
568
|
+
**Fix what matters**: Focus on user-impacting bottlenecks
|
|
569
|
+
**Trend over time**: Performance degrades gradually, catch it early
|
|
570
|
+
|
|
571
|
+
## Using with QE Agents
|
|
572
|
+
|
|
573
|
+
### Automated Performance Testing
|
|
574
|
+
|
|
575
|
+
**qe-performance-tester** orchestrates load testing:
|
|
576
|
+
```typescript
|
|
577
|
+
// Agent runs comprehensive load test
|
|
578
|
+
const perfTest = await agent.runLoadTest({
|
|
579
|
+
target: 'https://api.example.com',
|
|
580
|
+
scenarios: {
|
|
581
|
+
checkout: { vus: 100, duration: '5m' },
|
|
582
|
+
search: { vus: 200, duration: '5m' },
|
|
583
|
+
browse: { vus: 500, duration: '5m' }
|
|
584
|
+
},
|
|
585
|
+
thresholds: {
|
|
586
|
+
'http_req_duration': ['p(95)<200'],
|
|
587
|
+
'http_req_failed': ['rate<0.01'],
|
|
588
|
+
'http_reqs': ['rate>100']
|
|
589
|
+
}
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
// Returns detailed performance report
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
### Bottleneck Analysis
|
|
596
|
+
|
|
597
|
+
```typescript
|
|
598
|
+
// Agent identifies performance bottlenecks
|
|
599
|
+
const analysis = await qe-performance-tester.analyzeBottlenecks({
|
|
600
|
+
testResults: perfTest,
|
|
601
|
+
metrics: ['cpu', 'memory', 'db_queries', 'network', 'cache_hits']
|
|
602
|
+
});
|
|
603
|
+
|
|
604
|
+
// Returns:
|
|
605
|
+
// {
|
|
606
|
+
// bottlenecks: [
|
|
607
|
+
// { component: 'database', severity: 'high', suggestion: 'Add index on orders.created_at' },
|
|
608
|
+
// { component: 'api', severity: 'medium', suggestion: 'Enable response caching' }
|
|
609
|
+
// ]
|
|
610
|
+
// }
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
### Continuous Performance Monitoring
|
|
614
|
+
|
|
615
|
+
```typescript
|
|
616
|
+
// Agent integrates performance testing in CI/CD
|
|
617
|
+
const ciPerformance = await qe-performance-tester.ciIntegration({
|
|
618
|
+
mode: 'smoke', // Quick test on every commit
|
|
619
|
+
duration: '1m',
|
|
620
|
+
vus: 10,
|
|
621
|
+
failOn: {
|
|
622
|
+
'p95_response_time': 300, // ms
|
|
623
|
+
'error_rate': 0.01 // 1%
|
|
624
|
+
}
|
|
625
|
+
});
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
### Fleet Coordination for Performance
|
|
629
|
+
|
|
630
|
+
```typescript
|
|
631
|
+
const performanceFleet = await FleetManager.coordinate({
|
|
632
|
+
strategy: 'performance-testing',
|
|
633
|
+
agents: [
|
|
634
|
+
'qe-performance-tester', // Run load tests
|
|
635
|
+
'qe-quality-analyzer', // Analyze results
|
|
636
|
+
'qe-production-intelligence', // Compare to production
|
|
637
|
+
'qe-deployment-readiness' // Go/no-go decision
|
|
638
|
+
],
|
|
639
|
+
topology: 'sequential'
|
|
640
|
+
});
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
---
|
|
644
|
+
|
|
645
|
+
## Related Skills
|
|
646
|
+
|
|
647
|
+
**Testing:**
|
|
648
|
+
- [agentic-quality-engineering](../agentic-quality-engineering/) - Agent coordination
|
|
649
|
+
- [api-testing-patterns](../api-testing-patterns/) - API performance testing
|
|
650
|
+
|
|
651
|
+
**Quality:**
|
|
652
|
+
- [quality-metrics](../quality-metrics/) - Performance metrics tracking
|
|
653
|
+
- [risk-based-testing](../risk-based-testing/) - Performance risk assessment
|
|
654
|
+
|
|
655
|
+
## Resources
|
|
656
|
+
|
|
657
|
+
- **k6 Documentation**: k6.io/docs
|
|
658
|
+
- **Google Web Fundamentals**: Performance optimization guides
|
|
659
|
+
- **"Release It!"** by Michael Nygard: Production-ready patterns
|
|
660
|
+
- **High Performance Browser Networking** by Ilya Grigorik
|
|
661
|
+
|
|
662
|
+
Performance testing isn't optional—it's how you ensure your system works when it matters most.
|