@teevee98/synapse-hub 0.0.0-stage → 3.8.2
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/.agents/agents/api-engineer.md +67 -0
- package/.agents/agents/failure-analyst.md +75 -0
- package/.agents/agents/live-explorer.md +70 -0
- package/.agents/agents/orchestrator.md +104 -0
- package/.agents/agents/perf-engineer.md +74 -0
- package/.agents/agents/pom-crafter.md +112 -0
- package/.agents/agents/quality-gatekeeper.md +87 -0
- package/.agents/agents/test-designer.md +73 -0
- package/.agents/agents/test-runner.md +67 -0
- package/.agents/rules/author-integrity-guard.md +33 -0
- package/.agents/rules/communication-style.md +18 -0
- package/.agents/rules/context-engineering.md +37 -0
- package/.agents/rules/git-push-protocol.md +33 -0
- package/.agents/rules/graphify.md +14 -0
- package/.agents/rules/lessons-learned.md +25 -0
- package/.agents/rules/mandatory-playwright-live.md +25 -0
- package/.agents/rules/mobile_appium_rules.md +43 -0
- package/.agents/rules/performance_testing_rules.md +35 -0
- package/.agents/rules/skill-precedence.md +29 -0
- package/.agents/rules/systematic-debugging.md +36 -0
- package/.agents/skills/actor-qa-swarm/SKILL.md +77 -0
- package/.agents/skills/actor-qa-swarm/examples/broker_sharding_sample.json +12 -0
- package/.agents/skills/agent-orchestration-multi-agent-optimize/SKILL.md +88 -0
- package/.agents/skills/agent-orchestration-multi-agent-optimize/examples/swarm_workload_config.json +15 -0
- package/.agents/skills/agentless-qa-repair/SKILL.md +69 -0
- package/.agents/skills/agentless-qa-repair/examples/healing_report_sample.json +17 -0
- package/.agents/skills/agentless-qa-repair/examples/three_phase_repair_workflow.md +40 -0
- package/.agents/skills/antigravity-test-sentinel/SKILL.md +63 -0
- package/.agents/skills/antigravity-test-sentinel/examples/dod_gate_policy.json +11 -0
- package/.agents/skills/antigravity-test-sentinel/examples/sprint_dod_enforcement.md +47 -0
- package/.agents/skills/api-network-mocking-interception/SKILL.md +142 -0
- package/.agents/skills/api-network-mocking-interception/examples/network_route_stub.json +9 -0
- package/.agents/skills/api-spec-to-e2e-matrix/SKILL.md +80 -0
- package/.agents/skills/api-spec-to-e2e-matrix/examples/sample_openapi.json +19 -0
- package/.agents/skills/architecture-decision-records/SKILL.md +64 -0
- package/.agents/skills/architecture-decision-records/examples/0001-record-architecture-decisions.md +12 -0
- package/.agents/skills/auth-session-and-cookie-manager/SKILL.md +75 -0
- package/.agents/skills/auth-session-and-cookie-manager/examples/multi_role_auth_matrix.md +70 -0
- package/.agents/skills/auth-session-and-cookie-manager/examples/storage_state_sample.json +11 -0
- package/.agents/skills/backend-load-and-stress-patterns/SKILL.md +85 -0
- package/.agents/skills/backend-load-and-stress-patterns/examples/k6_load_test_sample.js +13 -0
- package/.agents/skills/backend-load-and-stress-patterns/references/k6_load_template.js +82 -0
- package/.agents/skills/bats-testing-patterns/SKILL.md +100 -0
- package/.agents/skills/bats-testing-patterns/examples/cli_runner_test.bats +6 -0
- package/.agents/skills/bats-testing-patterns/resources/implementation-playbook.md +614 -0
- package/.agents/skills/clean-pom-crafter/SKILL.md +110 -0
- package/.agents/skills/clean-pom-crafter/examples/standard_test_case.groovy +28 -0
- package/.agents/skills/clean-pom-crafter/references/pom_patterns.groovy +138 -0
- package/.agents/skills/code-refactoring-refactor-clean/SKILL.md +64 -0
- package/.agents/skills/code-refactoring-refactor-clean/examples/refactored_page_sample.groovy +9 -0
- package/.agents/skills/code-refactoring-refactor-clean/examples/refactored_playwright_pom.ts +52 -0
- package/.agents/skills/code-refactoring-refactor-clean/resources/implementation-playbook.md +881 -0
- package/.agents/skills/consumer-driven-contract-testing/SKILL.md +147 -0
- package/.agents/skills/consumer-driven-contract-testing/examples/order_service_pact.json +45 -0
- package/.agents/skills/db-state-verifier-and-seeder/SKILL.md +123 -0
- package/.agents/skills/db-state-verifier-and-seeder/examples/db_fixture_seed.json +12 -0
- package/.agents/skills/e2e-testing-patterns/SKILL.md +103 -0
- package/.agents/skills/e2e-testing-patterns/examples/playwright_sharded_config.ts +12 -0
- package/.agents/skills/e2e-testing-patterns/resources/implementation-playbook.md +522 -0
- package/.agents/skills/event-stream-qa-orchestrator/SKILL.md +79 -0
- package/.agents/skills/event-stream-qa-orchestrator/examples/timeline_sample.jsonl +2 -0
- package/.agents/skills/failure-autopsy-and-healing/SKILL.md +66 -0
- package/.agents/skills/failure-autopsy-and-healing/examples/closed_loop_healing_walkthrough.md +48 -0
- package/.agents/skills/failure-autopsy-and-healing/examples/sample_junit_failure.xml +8 -0
- package/.agents/skills/failure-autopsy-and-healing/references/healing_matrix.md +64 -0
- package/.agents/skills/failure-autopsy-and-healing/references/qa_investigation_protocol.md +56 -0
- package/.agents/skills/failure-autopsy-and-healing/scripts/triage_failures.sh +83 -0
- package/.agents/skills/file-and-report-validator/SKILL.md +90 -0
- package/.agents/skills/file-and-report-validator/examples/sample_export_schema.json +14 -0
- package/.agents/skills/flaky-test-sentinel-and-quarantine/SKILL.md +114 -0
- package/.agents/skills/flaky-test-sentinel-and-quarantine/examples/quarantine_registry.json +11 -0
- package/.agents/skills/gherkin-to-suite/SKILL.md +103 -0
- package/.agents/skills/gherkin-to-suite/examples/checkout.feature +39 -0
- package/.agents/skills/gherkin-to-suite/examples/suite_report_sample.json +334 -0
- package/.agents/skills/github-actions-templates/SKILL.md +77 -0
- package/.agents/skills/github-actions-templates/examples/matrix_test_pipeline.yml +8 -0
- package/.agents/skills/graphify-impact-analyzer/SKILL.md +76 -0
- package/.agents/skills/graphify-impact-analyzer/examples/dependency_blast_radius.json +8 -0
- package/.agents/skills/katalon-cli-runner/SKILL.md +76 -0
- package/.agents/skills/katalon-cli-runner/examples/headless_kre_exec.sh +3 -0
- package/.agents/skills/katalon-cli-runner/references/groovy-patterns.md +209 -0
- package/.agents/skills/katalon-cli-runner/references/katalon-api.md +155 -0
- package/.agents/skills/katalon-cli-runner/references/runner_commands.md +67 -0
- package/.agents/skills/lam-script-generator/SKILL.md +123 -0
- package/.agents/skills/lam-script-generator/examples/user_story_sample.md +8 -0
- package/.agents/skills/lean-code-ladder/SKILL.md +94 -0
- package/.agents/skills/lean-code-ladder/examples/ladder_walkthrough.md +37 -0
- package/.agents/skills/lean-impact-scoreboard/SKILL.md +48 -0
- package/.agents/skills/lean-impact-scoreboard/examples/sample_benchmark_gain.md +20 -0
- package/.agents/skills/lean-impact-scoreboard/examples/sample_scoreboard.md +15 -0
- package/.agents/skills/meta-prompt-crafter/SKILL.md +107 -0
- package/.agents/skills/meta-prompt-crafter/examples/qa_prompt_template.md +35 -0
- package/.agents/skills/mipro-prompt-compiler/SKILL.md +59 -0
- package/.agents/skills/mipro-prompt-compiler/examples/compiled_module_sample.json +22 -0
- package/.agents/skills/mipro-prompt-compiler/examples/dspy_assertion_optimizer_case.md +46 -0
- package/.agents/skills/mobile-appium-som/SKILL.md +88 -0
- package/.agents/skills/mobile-appium-som/examples/BaseScreen.java +88 -0
- package/.agents/skills/mobile-appium-som/examples/LoginScreen.java +46 -0
- package/.agents/skills/mobile-appium-som/examples/TC_MobileLogin.java +43 -0
- package/.agents/skills/persistent-planning-files/SKILL.md +108 -0
- package/.agents/skills/persistent-planning-files/examples/task_plan_example.md +56 -0
- package/.agents/skills/playwright-live-interaction/SKILL.md +131 -0
- package/.agents/skills/playwright-live-interaction/examples/live_probe_script.js +5 -0
- package/.agents/skills/playwright-live-interaction/references/advanced_superpowers.md +160 -0
- package/.agents/skills/playwright-live-interaction/references/compact_accessibility_snapshots.md +75 -0
- package/.agents/skills/playwright-live-interaction/references/recipes.md +388 -0
- package/.agents/skills/playwright-live-interaction/references/swarm_orchestration.md +134 -0
- package/.agents/skills/playwright-webapp-testing/SKILL.md +93 -0
- package/.agents/skills/playwright-webapp-testing/examples/server_lifecycle_playwright.py +63 -0
- package/.agents/skills/qa-aci-interface/SKILL.md +67 -0
- package/.agents/skills/qa-aci-interface/examples/surgical_code_window_walkthrough.md +40 -0
- package/.agents/skills/qa-aci-interface/examples/surgical_edit_sample.json +12 -0
- package/.agents/skills/qa-memory-os/SKILL.md +80 -0
- package/.agents/skills/qa-memory-os/examples/archival_memory_sample.json +21 -0
- package/.agents/skills/rbt-manual-testing/SKILL.md +137 -0
- package/.agents/skills/rbt-manual-testing/examples/checkout_rbt_manual_suite.md +25 -0
- package/.agents/skills/rbt-manual-testing/references/field_validation_checklist.md +29 -0
- package/.agents/skills/repo-quality-audit/SKILL.md +68 -0
- package/.agents/skills/repo-quality-audit/examples/sample_audit_walkthrough.md +15 -0
- package/.agents/skills/repo-quality-audit/examples/sample_repo_audit.md +33 -0
- package/.agents/skills/review-spec/SKILL.md +60 -0
- package/.agents/skills/review-spec/examples/pocock_grilling_decision_rubric.md +40 -0
- package/.agents/skills/review-spec/examples/sample_spec_review.md +33 -0
- package/.agents/skills/security-dast-sentinel/SKILL.md +119 -0
- package/.agents/skills/security-dast-sentinel/examples/dast_scan_config.json +10 -0
- package/.agents/skills/security-dast-sentinel/references/AI-AND-LLM.md +113 -0
- package/.agents/skills/security-dast-sentinel/references/ATTACK-CLASSES.md +89 -0
- package/.agents/skills/security-dast-sentinel/references/dast_recipes.ts +33 -0
- package/.agents/skills/self-healing-locator/SKILL.md +86 -0
- package/.agents/skills/self-healing-locator/examples/aom_diff_sample.json +16 -0
- package/.agents/skills/senior-code-review/SKILL.md +108 -0
- package/.agents/skills/senior-code-review/examples/sample_review_walkthrough.md +29 -0
- package/.agents/skills/skillspector-security-guard/SKILL.md +57 -0
- package/.agents/skills/skillspector-security-guard/examples/audit_threat_vectors_report.json +35 -0
- package/.agents/skills/skillspector-security-guard/examples/safe_mcp_config.json +12 -0
- package/.agents/skills/surgical-coding-principles/SKILL.md +89 -0
- package/.agents/skills/surgical-coding-principles/examples/surgical_vs_scope_creep.md +46 -0
- package/.agents/skills/synthetic-test-data-generator/SKILL.md +135 -0
- package/.agents/skills/synthetic-test-data-generator/examples/idempotent_data_recipe.json +9 -0
- package/.agents/skills/systematic-debugging/SKILL.md +100 -0
- package/.agents/skills/systematic-debugging/examples/four_phase_case.md +44 -0
- package/.agents/skills/technical-debt-harvester/SKILL.md +70 -0
- package/.agents/skills/technical-debt-harvester/examples/sample_debt_ledger.md +25 -0
- package/.agents/skills/technical-debt-harvester/examples/sample_ledger_output.md +20 -0
- package/.agents/skills/test-driven-development/SKILL.md +114 -0
- package/.agents/skills/test-driven-development/examples/red_green_refactor_qa.md +78 -0
- package/.agents/skills/token-and-context-optimizer/SKILL.md +70 -0
- package/.agents/skills/token-and-context-optimizer/examples/distilled_log_sample.txt +3 -0
- package/.agents/skills/token-and-context-optimizer/references/context_engineering_guide.md +49 -0
- package/.agents/skills/tot-exploratory-testing/SKILL.md +59 -0
- package/.agents/skills/tot-exploratory-testing/examples/payment_gateway_tot_tree.json +62 -0
- package/.agents/skills/tot-exploratory-testing/examples/tot_graph_sample.json +35 -0
- package/.agents/skills/verification-before-completion/SKILL.md +100 -0
- package/.agents/skills/verification-before-completion/examples/evidence_log_example.md +46 -0
- package/.agents/skills/visual-regression-sentinel/SKILL.md +82 -0
- package/.agents/skills/visual-regression-sentinel/examples/visual_mask_rules.json +9 -0
- package/.agents/skills/wcag-audit-patterns/SKILL.md +77 -0
- package/.agents/skills/wcag-audit-patterns/examples/wcag_compliance_checklist.json +10 -0
- package/.agents/skills/wcag-audit-patterns/resources/implementation-playbook.md +541 -0
- package/.agents/skills/web-agent-gym-benchmarking/SKILL.md +62 -0
- package/.agents/skills/web-agent-gym-benchmarking/examples/benchmark_report_sample.json +22 -0
- package/.agents/skills/web-agent-gym-benchmarking/examples/enterprise_tasks_suite.json +38 -0
- package/.agents/skills/web-vitals-and-performance-profiler/SKILL.md +65 -0
- package/.agents/skills/web-vitals-and-performance-profiler/examples/cwv_budget_policy.json +6 -0
- package/.agents/skills/web-vitals-and-performance-profiler/examples/playwright_cwv_profiler_fixture.ts +118 -0
- package/.agents/templates/completion_report.md +57 -0
- package/.agents/workflows/analyze_requirement_document.md +18 -0
- package/.agents/workflows/export_testcases_excel.md +32 -0
- package/.agents/workflows/generate_combinatorial_test_data.md +28 -0
- package/.agents/workflows/generate_cross_module_test_plan.md +37 -0
- package/.agents/workflows/generate_manual_testcases_rbt.md +56 -0
- package/.agents/workflows/generate_requirements_from_website.md +25 -0
- package/.agents/workflows/generate_testcases_from_requirements.md +21 -0
- package/.agents/workflows/graphify.md +10 -0
- package/.agents/workflows/test-impact.md +15 -0
- package/.agents/workflows/verify.md +34 -0
- package/.cursor/rules/agents.mdc +16 -0
- package/.cursor/rules/language.mdc +7 -0
- package/.cursor/rules/synapse-qa.mdc +24 -0
- package/.cursorrules +27 -0
- package/.dockerignore +53 -0
- package/.pre-commit-hooks.yaml +14 -0
- package/.windsurfrules +26 -0
- package/AGENTS.md +86 -0
- package/CLAUDE.md +54 -0
- package/Dockerfile +81 -0
- package/LICENSE +52 -0
- package/NOTICE +264 -0
- package/README.en.md +172 -0
- package/README.md +171 -2
- package/action.yml +51 -0
- package/agentskills.json +16 -0
- package/bin/agent-qa.js +138 -0
- package/docker-compose.yml +74 -0
- package/docs/ARCHITECTURE.en.md +197 -0
- package/docs/ARCHITECTURE.md +198 -0
- package/docs/CI_CD_INTEGRATION.en.md +170 -0
- package/docs/CI_CD_INTEGRATION.md +170 -0
- package/docs/CLI_REFERENCE.en.md +175 -0
- package/docs/CLI_REFERENCE.md +177 -0
- package/docs/CONTRIBUTING.en.md +49 -0
- package/docs/CONTRIBUTING.md +49 -0
- package/docs/PERFORMANCE_AUDIT_REPORT.md +784 -0
- package/docs/PLUGIN_DEVELOPMENT_GUIDE.md +127 -0
- package/docs/QUALITY_GATES.en.md +121 -0
- package/docs/QUALITY_GATES.md +121 -0
- package/docs/TOKEN_QUOTA_PLAYBOOK.md +41 -0
- package/docs/TOOL_CATALOG.md +129 -0
- package/docs/adopted-ecosystem-tools.md +96 -0
- package/docs/research/EXTERNAL_AGENT_SKILLS_SURVEY.md +1062 -0
- package/docs/research/agent_skill_training_analysis.md +1359 -0
- package/docs/schemas/synapse.config.schema.json +87 -0
- package/package.json +94 -4
- package/plugin.json +31 -0
- package/scripts/generate_skill_examples.py +244 -0
- package/scripts/install.ps1 +112 -0
- package/scripts/install_global_plugin.ps1 +94 -0
- package/scripts/install_global_plugin.sh +49 -0
- package/scripts/lint_skills.ps1 +57 -0
- package/scripts/package_dist.py +337 -0
- package/scripts/setup.sh +59 -0
- package/scripts/update_hub.ps1 +19 -0
- package/scripts/update_hub.sh +15 -0
- package/skills_manifest.json +854 -0
- package/synapse.config.json +32 -0
- package/templates/PROJECT_AI_GUIDE_TEMPLATE.md +111 -0
- package/templates/PROJECT_STATE_TEMPLATE.md +20 -0
- package/templates/ai_bridges/CLAUDE.md +54 -0
- package/templates/ai_bridges/copilot-instructions.md +20 -0
- package/templates/ai_bridges/cursor_synapse_qa.mdc +24 -0
- package/templates/ai_bridges/windsurfrules +26 -0
- package/templates/ci/github-actions-synapse.yml +95 -0
- package/templates/ci/gitlab-ci-synapse.yml +16 -0
- package/templates/ui/index.html +1069 -0
- package/templates/welcome.html.tmpl +2079 -0
- package/tools/.infer_baseline.json +30 -0
- package/tools/TOOLS_RUNBOOK.md +1553 -0
- package/tools/TOOL_CATALOG.json +1769 -0
- package/tools/__init__.py +43 -0
- package/tools/_openapi_parser.py +158 -0
- package/tools/agent_canary.py +525 -0
- package/tools/agentless_patcher.py +417 -0
- package/tools/analyze_project.py +258 -0
- package/tools/api_drift_sentinel.py +208 -0
- package/tools/api_fuzzer.py +762 -0
- package/tools/author_integrity.py +184 -0
- package/tools/auto_heal.py +271 -0
- package/tools/auto_heal_reflexion.py +532 -0
- package/tools/autogen_qa_broker.py +844 -0
- package/tools/benchmark_swarm_context.py +394 -0
- package/tools/browser_helpers.js +746 -0
- package/tools/browsergym_eval.py +236 -0
- package/tools/bug_reporter.py +252 -0
- package/tools/bump_version.py +423 -0
- package/tools/cache_resolver.py +1214 -0
- package/tools/check_env.py +426 -0
- package/tools/check_version_sync.py +256 -0
- package/tools/ci_healing_hook.py +126 -0
- package/tools/cli.py +1598 -0
- package/tools/config_decoupler.py +253 -0
- package/tools/contract_validator.py +141 -0
- package/tools/core/__init__.py +70 -0
- package/tools/core/adapters.py +431 -0
- package/tools/core/circuit_breaker.py +263 -0
- package/tools/core/cli_runtime.py +66 -0
- package/tools/core/file_lock.py +159 -0
- package/tools/core/i18n.py +394 -0
- package/tools/core/memory_bus.py +905 -0
- package/tools/core/process_supervisor.py +332 -0
- package/tools/core/telemetry.py +329 -0
- package/tools/count_tokens.py +1267 -0
- package/tools/create_mock_docx.py +104 -0
- package/tools/dashboard_generator.py +2419 -0
- package/tools/db_sandbox.py +675 -0
- package/tools/debt_harvester.py +237 -0
- package/tools/distill_log.py +161 -0
- package/tools/dspy_qa_signatures.py +356 -0
- package/tools/e2e_flow_prober.py +132 -0
- package/tools/export_postman_collection.py +945 -0
- package/tools/flaky_detector.py +389 -0
- package/tools/fsm_enforcer.py +450 -0
- package/tools/fsm_middleware.py +401 -0
- package/tools/fuzz_payloads.py +197 -0
- package/tools/generate_allure_report.py +88 -0
- package/tools/generate_api_matrix.py +193 -0
- package/tools/generate_jmx_plan.py +1322 -0
- package/tools/generate_sbom.py +252 -0
- package/tools/generate_tc_from_story.py +203 -0
- package/tools/generate_test_reports.py +133 -0
- package/tools/generate_tool_catalog.py +482 -0
- package/tools/gherkin_suite.py +758 -0
- package/tools/git_pre_commit_guard.py +298 -0
- package/tools/goldfish_review.py +366 -0
- package/tools/heal/__init__.py +28 -0
- package/tools/heal_pr_automator.py +220 -0
- package/tools/heuristic_locator_matcher.py +351 -0
- package/tools/hub_publisher.py +623 -0
- package/tools/humanize_linter.py +438 -0
- package/tools/infer_linter.py +977 -0
- package/tools/init_config.py +307 -0
- package/tools/interview_story.py +116 -0
- package/tools/jira_sync.py +566 -0
- package/tools/jtl_analyzer.py +474 -0
- package/tools/lint/__init__.py +30 -0
- package/tools/lint_ai_docs.py +374 -0
- package/tools/lookup_tc.py +165 -0
- package/tools/lookup_xpath.py +167 -0
- package/tools/matrix_sharder.py +148 -0
- package/tools/mcp/__init__.py +18 -0
- package/tools/mcp_docx_server.ps1 +13 -0
- package/tools/mcp_docx_server.py +851 -0
- package/tools/mcp_excel_server.ps1 +13 -0
- package/tools/mcp_excel_server.py +441 -0
- package/tools/mcp_server.py +724 -0
- package/tools/md_to_xlsx.py +327 -0
- package/tools/micro_mutator.py +887 -0
- package/tools/mipro_assertion_tuner.py +210 -0
- package/tools/network_mock_shield.py +311 -0
- package/tools/newman_analyzer.py +384 -0
- package/tools/omni_emitter.py +579 -0
- package/tools/omni_parser.py +450 -0
- package/tools/omni_transpiler.py +168 -0
- package/tools/openxml_guard.py +438 -0
- package/tools/output_formatter.py +182 -0
- package/tools/package_release.py +325 -0
- package/tools/perf/__init__.py +24 -0
- package/tools/pinpoint_failure.py +190 -0
- package/tools/project_state.py +171 -0
- package/tools/qa_event_stream.py +358 -0
- package/tools/repo_map.py +346 -0
- package/tools/report/__init__.py +32 -0
- package/tools/reversible_sandbox.py +344 -0
- package/tools/safety_firewall.py +437 -0
- package/tools/security_coverage_ledger.py +538 -0
- package/tools/security_scanner.py +229 -0
- package/tools/senior_code_review.py +393 -0
- package/tools/setup_project.py +770 -0
- package/tools/skill_collision_guard.py +304 -0
- package/tools/skill_profiles.py +217 -0
- package/tools/skill_vault.py +481 -0
- package/tools/skillspector.py +1278 -0
- package/tools/smart_visual_masker.py +132 -0
- package/tools/spec_drift_sentinel.py +438 -0
- package/tools/swe_qa_aci.py +369 -0
- package/tools/synapse_observer.py +485 -0
- package/tools/synapse_qa_bench.py +190 -0
- package/tools/sync_agent_rules.py +274 -0
- package/tools/telemetry_correlator.py +397 -0
- package/tools/template_excel_exporter.py +514 -0
- package/tools/templates/jmeter-distributed/README.md +54 -0
- package/tools/templates/jmeter-distributed/docker-compose.yml +83 -0
- package/tools/test_impact.py +419 -0
- package/tools/test_memory_os.py +462 -0
- package/tools/textgrad_mutation_optimizer.py +237 -0
- package/tools/tms_sync_bridge.py +834 -0
- package/tools/tot_exploratory_tester.py +239 -0
- package/tools/trace_data_flow.py +240 -0
- package/tools/traffic_session_converter.py +256 -0
- package/tools/trend_analytics.py +314 -0
- package/tools/ui_server.py +401 -0
- package/tools/universal_ir.py +488 -0
- package/tools/update_sentinel.py +383 -0
- package/tools/validate_groovy_scripts.py +173 -0
- package/tools/verify_all.py +1259 -0
- package/tools/visual_diff_canvas.py +143 -0
- package/tools/visual_som_helper.py +550 -0
- package/tools/watch_mode.py +308 -0
- package/tools/wcag_audit.py +239 -0
- package/tools/welcome_page.py +290 -0
|
@@ -0,0 +1,1322 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
"""
|
|
4
|
+
tools/generate_jmx_plan.py — Enterprise Apache JMeter 5.x Test Plan XML Generator (JMeter 360° Pinnacle)
|
|
5
|
+
---------------------------------------------------------------------------------------------------------
|
|
6
|
+
Transforms OpenAPI / Swagger specifications, Postman Collections (v2.1.0), or HAR
|
|
7
|
+
traces into production-ready Apache JMeter (.jmx) load, stress, spike, and soak test plans.
|
|
8
|
+
|
|
9
|
+
Comprehensive 10/10 Pinnacle Performance Features:
|
|
10
|
+
1. Multi-Format Ingestion: OpenAPI 3.0 / Swagger 2.0, Postman Collection JSON, and HAR traces.
|
|
11
|
+
2. Browser State Simulation: Injects HTTP Cookie Manager & HTTP Cache Manager by default.
|
|
12
|
+
3. Dynamic Parameterization: Injects CSV Data Set Config for multi-user test data.
|
|
13
|
+
4. Advanced Logic Controllers:
|
|
14
|
+
- Transaction Controllers (Parent aggregations for end-to-end SLA tracking)
|
|
15
|
+
- Traffic Shaping & Weighted Routing via ThroughputController (Pareto 70/20/10 traffic mix)
|
|
16
|
+
- Uniform Random Timers for realistic human think-time.
|
|
17
|
+
5. Deep Data Correlation Engine:
|
|
18
|
+
- RegexExtractor for HTML hidden CSRF / Anti-Forgery tokens
|
|
19
|
+
- JSONPostProcessor with Match Number 0 (Random dynamic item choice avoiding duplicate lockups)
|
|
20
|
+
- Chaining Bearer JWT token & entity IDs.
|
|
21
|
+
6. Workload Archetypes: Linear, Step-Up (Break-point), Spike, and Soak profiles -
|
|
22
|
+
step/spike emit staged ThreadGroups (per-stage threads/ramp/hold/delay windows).
|
|
23
|
+
6b. Locust Code-as-Code Export (`--emit-locust`): generates a runnable
|
|
24
|
+
locustfile.py (User class + weighted @task endpoints) from the same
|
|
25
|
+
OpenAPI/Postman/HAR ingestion - concept borrowed from Locust (MIT).
|
|
26
|
+
7. Enterprise Security: JSR223 Groovy HMAC-SHA256 payload signer & correlation IDs.
|
|
27
|
+
8. Full-Stack Observability & Telemetry:
|
|
28
|
+
- InfluxDB Backend Listener for live Grafana APM dashboard streaming
|
|
29
|
+
- PerfMon Server Agent Collector (CPU, RAM, Disks, Network I/O).
|
|
30
|
+
9. Multi-Protocol Coverage (100% Comprehensive):
|
|
31
|
+
- REST / HTTP(S) Samplers
|
|
32
|
+
- JDBC Database Connection Pool & Query Samplers
|
|
33
|
+
- WebSocket Real-Time Samplers (Connect, Send, Receive, Close)
|
|
34
|
+
- gRPC Microservices Samplers (Protobuf & Unary RPC)
|
|
35
|
+
- Kafka / JMS Event-Driven Producer Samplers.
|
|
36
|
+
|
|
37
|
+
Usage:
|
|
38
|
+
python tools/generate_jmx_plan.py --spec swagger.json -o perf_plan.jmx --weighted-mix "70,20,10"
|
|
39
|
+
python tools/generate_jmx_plan.py --postman col.json -o perf_plan.jmx --csv-data users.csv --deep-correlation
|
|
40
|
+
python tools/generate_jmx_plan.py --ws-sample -o websocket_plan.jmx
|
|
41
|
+
python tools/generate_jmx_plan.py --grpc-sample -o grpc_plan.jmx
|
|
42
|
+
python tools/generate_jmx_plan.py --kafka-sample -o kafka_plan.jmx
|
|
43
|
+
python tools/generate_jmx_plan.py --jdbc-sample -o jdbc_plan.jmx
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
import os
|
|
47
|
+
import sys
|
|
48
|
+
import json
|
|
49
|
+
import re
|
|
50
|
+
import argparse
|
|
51
|
+
from typing import Dict, Any, List, Optional, Tuple
|
|
52
|
+
from urllib.parse import urlparse
|
|
53
|
+
from xml.sax.saxutils import escape as xml_escape
|
|
54
|
+
|
|
55
|
+
# Enforce UTF-8 stdout encoding for Windows/macOS/Linux console compatibility
|
|
56
|
+
if hasattr(sys.stdout, "reconfigure"):
|
|
57
|
+
try:
|
|
58
|
+
sys.stdout.reconfigure(encoding="utf-8")
|
|
59
|
+
sys.stderr.reconfigure(encoding="utf-8")
|
|
60
|
+
except Exception:
|
|
61
|
+
pass
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def compute_workload_stages(workload_profile: str, vus: int, ramp_up: int, duration: int) -> List[Dict[str, int]]:
|
|
65
|
+
"""Computes staged execution windows for step/spike profiles.
|
|
66
|
+
|
|
67
|
+
Each stage is a plain JMeter ThreadGroup with its own scheduler window
|
|
68
|
+
(threads, ramp, hold, delay) so staged load works on vanilla JMeter 5.x
|
|
69
|
+
without plugins. Linear/soak return a single stage (behavior unchanged).
|
|
70
|
+
"""
|
|
71
|
+
if workload_profile == "step":
|
|
72
|
+
step_count = 4
|
|
73
|
+
per_step = max(1, (vus + step_count - 1) // step_count)
|
|
74
|
+
window_ramp = max(1, min(10, ramp_up))
|
|
75
|
+
window_hold = max(30, duration // step_count)
|
|
76
|
+
stages = []
|
|
77
|
+
for i in range(step_count):
|
|
78
|
+
threads = min(per_step * (i + 1), vus)
|
|
79
|
+
stages.append({"threads": threads, "ramp": window_ramp,
|
|
80
|
+
"hold": window_hold, "delay": i * (window_ramp + window_hold)})
|
|
81
|
+
return stages
|
|
82
|
+
|
|
83
|
+
if workload_profile == "spike":
|
|
84
|
+
base = max(1, round(vus * 0.2))
|
|
85
|
+
base_hold = max(10, round(duration * 0.7))
|
|
86
|
+
spike_hold = max(10, round(duration * 0.15))
|
|
87
|
+
tail_hold = max(10, duration - base_hold - spike_hold)
|
|
88
|
+
return [
|
|
89
|
+
{"threads": base, "ramp": ramp_up, "hold": base_hold, "delay": 0},
|
|
90
|
+
{"threads": vus, "ramp": 5, "hold": spike_hold, "delay": base_hold},
|
|
91
|
+
{"threads": base, "ramp": 5, "hold": tail_hold, "delay": base_hold + spike_hold},
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
# linear / soak: single continuous stage (legacy behavior, property-overridable)
|
|
95
|
+
return [{"threads": vus, "ramp": ramp_up, "hold": duration, "delay": 0}]
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def build_jmx_xml(
|
|
99
|
+
plan_name: str,
|
|
100
|
+
base_host: str,
|
|
101
|
+
protocol: str,
|
|
102
|
+
port: str,
|
|
103
|
+
vus: int,
|
|
104
|
+
ramp_up: int,
|
|
105
|
+
duration: int,
|
|
106
|
+
loop_count: int,
|
|
107
|
+
sla_p95: int,
|
|
108
|
+
samplers: List[Dict[str, Any]],
|
|
109
|
+
enable_cookies: bool = True,
|
|
110
|
+
enable_cache: bool = True,
|
|
111
|
+
csv_file: Optional[str] = None,
|
|
112
|
+
csv_variables: str = "username,password",
|
|
113
|
+
group_transactions: bool = False,
|
|
114
|
+
weighted_mix: Optional[str] = None,
|
|
115
|
+
deep_correlation: bool = True,
|
|
116
|
+
workload_profile: str = "linear",
|
|
117
|
+
jsr223_hmac: bool = False,
|
|
118
|
+
influxdb_url: Optional[str] = None,
|
|
119
|
+
perfmon_server: Optional[str] = None,
|
|
120
|
+
think_time_min: int = 0,
|
|
121
|
+
think_time_max: int = 0,
|
|
122
|
+
abort_on_fail: bool = True,
|
|
123
|
+
abort_error_threshold: float = 0.10,
|
|
124
|
+
jdbc_config: Optional[Dict[str, Any]] = None,
|
|
125
|
+
ws_config: Optional[Dict[str, Any]] = None,
|
|
126
|
+
grpc_config: Optional[Dict[str, Any]] = None,
|
|
127
|
+
kafka_config: Optional[Dict[str, Any]] = None
|
|
128
|
+
) -> str:
|
|
129
|
+
"""Builds valid, production-grade Apache JMeter 5.x XML Test Plan."""
|
|
130
|
+
|
|
131
|
+
loops_str = "-1" if loop_count < 0 else str(loop_count)
|
|
132
|
+
continue_forever = "true" if loop_count < 0 else "false"
|
|
133
|
+
|
|
134
|
+
xml_lines = [
|
|
135
|
+
'<?xml version="1.0" encoding="UTF-8"?>',
|
|
136
|
+
'<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.6.3">',
|
|
137
|
+
' <hashTree>',
|
|
138
|
+
f' <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="{xml_escape(plan_name)}" enabled="true">',
|
|
139
|
+
' <stringProp name="TestPlan.comments">Enterprise Performance Test Plan auto-generated by Synapse-Hub</stringProp>',
|
|
140
|
+
' <boolProp name="TestPlan.functional_mode">false</boolProp>',
|
|
141
|
+
' <boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>',
|
|
142
|
+
' <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>',
|
|
143
|
+
' <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">',
|
|
144
|
+
' <collectionProp name="Arguments.arguments">',
|
|
145
|
+
' <elementProp name="BASE_URL" elementType="Argument">',
|
|
146
|
+
' <stringProp name="Argument.name">BASE_URL</stringProp>',
|
|
147
|
+
f' <stringProp name="Argument.value">{xml_escape(base_host)}</stringProp>',
|
|
148
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
149
|
+
' </elementProp>',
|
|
150
|
+
' <elementProp name="PROTOCOL" elementType="Argument">',
|
|
151
|
+
' <stringProp name="Argument.name">PROTOCOL</stringProp>',
|
|
152
|
+
f' <stringProp name="Argument.value">{xml_escape(protocol)}</stringProp>',
|
|
153
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
154
|
+
' </elementProp>',
|
|
155
|
+
' <elementProp name="PORT" elementType="Argument">',
|
|
156
|
+
' <stringProp name="Argument.name">PORT</stringProp>',
|
|
157
|
+
f' <stringProp name="Argument.value">{xml_escape(port)}</stringProp>',
|
|
158
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
159
|
+
' </elementProp>',
|
|
160
|
+
' <elementProp name="SLA_P95" elementType="Argument">',
|
|
161
|
+
' <stringProp name="Argument.name">SLA_P95</stringProp>',
|
|
162
|
+
f' <stringProp name="Argument.value">{sla_p95}</stringProp>',
|
|
163
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
164
|
+
' </elementProp>',
|
|
165
|
+
' <elementProp name="MAX_LATENCY" elementType="Argument">',
|
|
166
|
+
' <stringProp name="Argument.name">MAX_LATENCY</stringProp>',
|
|
167
|
+
f' <stringProp name="Argument.value">${{__P(max_latency, {max(3000, sla_p95 * 2)})}}</stringProp>',
|
|
168
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
169
|
+
' </elementProp>',
|
|
170
|
+
' <elementProp name="LAST_CREATED_ID" elementType="Argument">',
|
|
171
|
+
' <stringProp name="Argument.name">LAST_CREATED_ID</stringProp>',
|
|
172
|
+
' <stringProp name="Argument.value">1</stringProp>',
|
|
173
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
174
|
+
' </elementProp>',
|
|
175
|
+
' <elementProp name="BEARER_TOKEN" elementType="Argument">',
|
|
176
|
+
' <stringProp name="Argument.name">BEARER_TOKEN</stringProp>',
|
|
177
|
+
' <stringProp name="Argument.value"></stringProp>',
|
|
178
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
179
|
+
' </elementProp>',
|
|
180
|
+
' <elementProp name="CSRF_TOKEN" elementType="Argument">',
|
|
181
|
+
' <stringProp name="Argument.name">CSRF_TOKEN</stringProp>',
|
|
182
|
+
' <stringProp name="Argument.value"></stringProp>',
|
|
183
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
184
|
+
' </elementProp>',
|
|
185
|
+
' <elementProp name="RANDOM_ITEM_ID" elementType="Argument">',
|
|
186
|
+
' <stringProp name="Argument.name">RANDOM_ITEM_ID</stringProp>',
|
|
187
|
+
' <stringProp name="Argument.value">1</stringProp>',
|
|
188
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
189
|
+
' </elementProp>',
|
|
190
|
+
' <elementProp name="HMAC_SECRET" elementType="Argument">',
|
|
191
|
+
' <stringProp name="Argument.name">HMAC_SECRET</stringProp>',
|
|
192
|
+
' <stringProp name="Argument.value">SynapseEnterpriseVault#2026</stringProp>',
|
|
193
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
194
|
+
' </elementProp>',
|
|
195
|
+
' </collectionProp>',
|
|
196
|
+
' </elementProp>',
|
|
197
|
+
' <stringProp name="TestPlan.user_define_classpath"></stringProp>',
|
|
198
|
+
' </TestPlan>',
|
|
199
|
+
' <hashTree>'
|
|
200
|
+
]
|
|
201
|
+
|
|
202
|
+
# Global HTTP Cookie Manager
|
|
203
|
+
if enable_cookies:
|
|
204
|
+
xml_lines.extend([
|
|
205
|
+
' <!-- Global Cookie Manager (Browser Session Emulation) -->',
|
|
206
|
+
' <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true">',
|
|
207
|
+
' <collectionProp name="CookieManager.cookies"/>',
|
|
208
|
+
' <boolProp name="CookieManager.clearEachIteration">false</boolProp>',
|
|
209
|
+
' <boolProp name="CookieManager.controlledByThreadGroup">false</boolProp>',
|
|
210
|
+
' </CookieManager>',
|
|
211
|
+
' <hashTree/>'
|
|
212
|
+
])
|
|
213
|
+
|
|
214
|
+
# Global HTTP Cache Manager
|
|
215
|
+
if enable_cache:
|
|
216
|
+
xml_lines.extend([
|
|
217
|
+
' <!-- Global Cache Manager (ETag & Cache-Control Emulation) -->',
|
|
218
|
+
' <CacheManager guiclass="CacheManagerGui" testclass="CacheManager" testname="HTTP Cache Manager" enabled="true">',
|
|
219
|
+
' <boolProp name="clearEachIteration">false</boolProp>',
|
|
220
|
+
' <boolProp name="useCacheControl">true</boolProp>',
|
|
221
|
+
' <intProp name="maxSize">5000</intProp>',
|
|
222
|
+
' </CacheManager>',
|
|
223
|
+
' <hashTree/>'
|
|
224
|
+
])
|
|
225
|
+
|
|
226
|
+
# Global Header Manager
|
|
227
|
+
xml_lines.extend([
|
|
228
|
+
' <!-- Global Header Manager -->',
|
|
229
|
+
' <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">',
|
|
230
|
+
' <collectionProp name="HeaderManager.headers">',
|
|
231
|
+
' <elementProp name="" elementType="Header">',
|
|
232
|
+
' <stringProp name="Header.name">Content-Type</stringProp>',
|
|
233
|
+
' <stringProp name="Header.value">application/json</stringProp>',
|
|
234
|
+
' </elementProp>',
|
|
235
|
+
' <elementProp name="" elementType="Header">',
|
|
236
|
+
' <stringProp name="Header.name">Accept</stringProp>',
|
|
237
|
+
' <stringProp name="Header.value">application/json</stringProp>',
|
|
238
|
+
' </elementProp>',
|
|
239
|
+
' <elementProp name="" elementType="Header">',
|
|
240
|
+
' <stringProp name="Header.name">Authorization</stringProp>',
|
|
241
|
+
' <stringProp name="Header.value">Bearer ${BEARER_TOKEN}</stringProp>',
|
|
242
|
+
' </elementProp>',
|
|
243
|
+
' <elementProp name="" elementType="Header">',
|
|
244
|
+
' <stringProp name="Header.name">X-CSRF-Token</stringProp>',
|
|
245
|
+
' <stringProp name="Header.value">${CSRF_TOKEN}</stringProp>',
|
|
246
|
+
' </elementProp>',
|
|
247
|
+
' </collectionProp>',
|
|
248
|
+
' </HeaderManager>',
|
|
249
|
+
' <hashTree/>',
|
|
250
|
+
' <!-- HTTP Request Defaults -->',
|
|
251
|
+
' <ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP Request Defaults" enabled="true">',
|
|
252
|
+
' <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">',
|
|
253
|
+
' <collectionProp name="Arguments.arguments"/>',
|
|
254
|
+
' </elementProp>',
|
|
255
|
+
' <stringProp name="HTTPSampler.domain">${BASE_URL}</stringProp>',
|
|
256
|
+
' <stringProp name="HTTPSampler.port">${PORT}</stringProp>',
|
|
257
|
+
' <stringProp name="HTTPSampler.protocol">${PROTOCOL}</stringProp>',
|
|
258
|
+
' <stringProp name="HTTPSampler.contentEncoding">UTF-8</stringProp>',
|
|
259
|
+
' <stringProp name="HTTPSampler.connect_timeout">5000</stringProp>',
|
|
260
|
+
' <stringProp name="HTTPSampler.response_timeout">30000</stringProp>',
|
|
261
|
+
' </ConfigTestElement>',
|
|
262
|
+
' <hashTree/>'
|
|
263
|
+
])
|
|
264
|
+
|
|
265
|
+
# InfluxDB Backend Listener for live Grafana streaming
|
|
266
|
+
if influxdb_url:
|
|
267
|
+
xml_lines.extend([
|
|
268
|
+
' <!-- InfluxDB Live Telemetry Backend Listener (Grafana APM) -->',
|
|
269
|
+
' <BackendListener guiclass="BackendListenerGui" testclass="BackendListener" testname="Backend Listener - InfluxDB" enabled="true">',
|
|
270
|
+
' <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">',
|
|
271
|
+
' <collectionProp name="Arguments.arguments">',
|
|
272
|
+
' <elementProp name="influxdbMetricsSender" elementType="Argument">',
|
|
273
|
+
' <stringProp name="Argument.name">influxdbMetricsSender</stringProp>',
|
|
274
|
+
' <stringProp name="Argument.value">org.apache.jmeter.visualizers.backend.influxdb.HttpMetricsSender</stringProp>',
|
|
275
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
276
|
+
' </elementProp>',
|
|
277
|
+
' <elementProp name="influxdbUrl" elementType="Argument">',
|
|
278
|
+
' <stringProp name="Argument.name">influxdbUrl</stringProp>',
|
|
279
|
+
f' <stringProp name="Argument.value">{xml_escape(influxdb_url)}</stringProp>',
|
|
280
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
281
|
+
' </elementProp>',
|
|
282
|
+
' <elementProp name="application" elementType="Argument">',
|
|
283
|
+
' <stringProp name="Argument.name">application</stringProp>',
|
|
284
|
+
f' <stringProp name="Argument.value">{xml_escape(plan_name)}</stringProp>',
|
|
285
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
286
|
+
' </elementProp>',
|
|
287
|
+
' <elementProp name="measurement" elementType="Argument">',
|
|
288
|
+
' <stringProp name="Argument.name">measurement</stringProp>',
|
|
289
|
+
' <stringProp name="Argument.value">jmeter</stringProp>',
|
|
290
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
291
|
+
' </elementProp>',
|
|
292
|
+
' <elementProp name="summaryOnly" elementType="Argument">',
|
|
293
|
+
' <stringProp name="Argument.name">summaryOnly</stringProp>',
|
|
294
|
+
' <stringProp name="Argument.value">false</stringProp>',
|
|
295
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
296
|
+
' </elementProp>',
|
|
297
|
+
' <elementProp name="samplersRegex" elementType="Argument">',
|
|
298
|
+
' <stringProp name="Argument.name">samplersRegex</stringProp>',
|
|
299
|
+
' <stringProp name="Argument.value">.*</stringProp>',
|
|
300
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
301
|
+
' </elementProp>',
|
|
302
|
+
' <elementProp name="percentiles" elementType="Argument">',
|
|
303
|
+
' <stringProp name="Argument.name">percentiles</stringProp>',
|
|
304
|
+
' <stringProp name="Argument.value">90;95;99</stringProp>',
|
|
305
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
306
|
+
' </elementProp>',
|
|
307
|
+
' <elementProp name="testTitle" elementType="Argument">',
|
|
308
|
+
' <stringProp name="Argument.name">testTitle</stringProp>',
|
|
309
|
+
f' <stringProp name="Argument.value">{xml_escape(plan_name)} Load Test</stringProp>',
|
|
310
|
+
' <stringProp name="Argument.metadata">=</stringProp>',
|
|
311
|
+
' </elementProp>',
|
|
312
|
+
' </collectionProp>',
|
|
313
|
+
' </elementProp>',
|
|
314
|
+
' <stringProp name="classname">org.apache.jmeter.visualizers.backend.influxdb.InfluxdbBackendListenerClient</stringProp>',
|
|
315
|
+
' </BackendListener>',
|
|
316
|
+
' <hashTree/>'
|
|
317
|
+
])
|
|
318
|
+
|
|
319
|
+
# PerfMon Server Agent Collector
|
|
320
|
+
if perfmon_server:
|
|
321
|
+
server_host = perfmon_server.split(":")[0]
|
|
322
|
+
server_port = perfmon_server.split(":")[1] if ":" in perfmon_server else "4444"
|
|
323
|
+
xml_lines.extend([
|
|
324
|
+
' <!-- PerfMon Server Hardware Resource Metrics Collector -->',
|
|
325
|
+
' <kg.apc.jmeter.perfmon.PerfMonCollector guiclass="kg.apc.jmeter.vizualizers.PerfMonGui" testclass="kg.apc.jmeter.perfmon.PerfMonCollector" testname="PerfMon Server Agent Metrics" enabled="true">',
|
|
326
|
+
' <boolProp name="ResultCollector.error_logging">false</boolProp>',
|
|
327
|
+
' <objProp>',
|
|
328
|
+
' <name>saveConfig</name>',
|
|
329
|
+
' <value class="SampleSaveConfiguration">',
|
|
330
|
+
' <time>true</time><latency>true</latency><timestamp>true</timestamp><success>true</success>',
|
|
331
|
+
' </value>',
|
|
332
|
+
' </objProp>',
|
|
333
|
+
' <stringProp name="filename">perfmon_server_metrics.csv</stringProp>',
|
|
334
|
+
' <collectionProp name="metricConnections">',
|
|
335
|
+
' <collectionProp name="">',
|
|
336
|
+
f' <stringProp name="">{xml_escape(server_host)}</stringProp>',
|
|
337
|
+
f' <stringProp name="">{xml_escape(server_port)}</stringProp>',
|
|
338
|
+
' <stringProp name="">CPU</stringProp>',
|
|
339
|
+
' <stringProp name="">combined</stringProp>',
|
|
340
|
+
' </collectionProp>',
|
|
341
|
+
' <collectionProp name="">',
|
|
342
|
+
f' <stringProp name="">{xml_escape(server_host)}</stringProp>',
|
|
343
|
+
f' <stringProp name="">{xml_escape(server_port)}</stringProp>',
|
|
344
|
+
' <stringProp name="">Memory</stringProp>',
|
|
345
|
+
' <stringProp name="">usedperc</stringProp>',
|
|
346
|
+
' </collectionProp>',
|
|
347
|
+
' <collectionProp name="">',
|
|
348
|
+
f' <stringProp name="">{xml_escape(server_host)}</stringProp>',
|
|
349
|
+
f' <stringProp name="">{xml_escape(server_port)}</stringProp>',
|
|
350
|
+
' <stringProp name="">Disks I/O</stringProp>',
|
|
351
|
+
' <stringProp name="">queue</stringProp>',
|
|
352
|
+
' </collectionProp>',
|
|
353
|
+
' </collectionProp>',
|
|
354
|
+
' </kg.apc.jmeter.perfmon.PerfMonCollector>',
|
|
355
|
+
' <hashTree/>'
|
|
356
|
+
])
|
|
357
|
+
|
|
358
|
+
# JDBC Database Connection Configuration if requested
|
|
359
|
+
if jdbc_config:
|
|
360
|
+
pool_name = xml_escape(jdbc_config.get("pool_name", "EnterpriseDBPool"))
|
|
361
|
+
db_url = xml_escape(jdbc_config.get("url", "jdbc:postgresql://localhost:5432/enterprise_db"))
|
|
362
|
+
db_driver = xml_escape(jdbc_config.get("driver", "org.postgresql.Driver"))
|
|
363
|
+
db_user = xml_escape(jdbc_config.get("user", "postgres"))
|
|
364
|
+
db_pass = xml_escape(jdbc_config.get("password", "postgres"))
|
|
365
|
+
xml_lines.extend([
|
|
366
|
+
' <!-- JDBC Database Connection Pool Configuration -->',
|
|
367
|
+
' <JDBCDataSource guiclass="TestBeanGUI" testclass="JDBCDataSource" testname="JDBC Connection Configuration" enabled="true">',
|
|
368
|
+
' <boolProp name="autocommit">true</boolProp>',
|
|
369
|
+
' <stringProp name="checkQuery"></stringProp>',
|
|
370
|
+
' <stringProp name="connectionAge">5000</stringProp>',
|
|
371
|
+
' <stringProp name="connectionProperties"></stringProp>',
|
|
372
|
+
f' <stringProp name="dataSource">{pool_name}</stringProp>',
|
|
373
|
+
f' <stringProp name="dbUrl">{db_url}</stringProp>',
|
|
374
|
+
f' <stringProp name="driver">{db_driver}</stringProp>',
|
|
375
|
+
' <stringProp name="initQuery"></stringProp>',
|
|
376
|
+
' <boolProp name="keepAlive">true</boolProp>',
|
|
377
|
+
f' <stringProp name="password">{db_pass}</stringProp>',
|
|
378
|
+
' <stringProp name="poolMax">20</stringProp>',
|
|
379
|
+
' <stringProp name="timeout">10000</stringProp>',
|
|
380
|
+
' <stringProp name="transactionIsolation">DEFAULT</stringProp>',
|
|
381
|
+
' <stringProp name="trimInterval">60000</stringProp>',
|
|
382
|
+
f' <stringProp name="username">{db_user}</stringProp>',
|
|
383
|
+
' <boolProp name="preinit">false</boolProp>',
|
|
384
|
+
' </JDBCDataSource>',
|
|
385
|
+
' <hashTree/>'
|
|
386
|
+
])
|
|
387
|
+
|
|
388
|
+
# Workload Profile Thread Group Setup
|
|
389
|
+
tg_name = f"Workload Engine [{workload_profile.upper()}] ({vus} VUs)"
|
|
390
|
+
actual_duration = duration
|
|
391
|
+
if workload_profile == "soak" and duration < 3600:
|
|
392
|
+
actual_duration = 3600 # Default 1h for soak
|
|
393
|
+
|
|
394
|
+
stages = compute_workload_stages(workload_profile, vus, ramp_up, actual_duration)
|
|
395
|
+
is_staged = len(stages) > 1
|
|
396
|
+
|
|
397
|
+
def _emit_stage_group(stage: Dict[str, int], stage_index: int) -> None:
|
|
398
|
+
"""Emits one stage ThreadGroup header. Single-stage plans keep the
|
|
399
|
+
legacy property-overridable form (${__P(vus,...)}); staged plans use
|
|
400
|
+
concrete per-stage windows."""
|
|
401
|
+
name = tg_name if not is_staged else f"{tg_name} - Stage {stage_index + 1}"
|
|
402
|
+
if is_staged:
|
|
403
|
+
threads_prop = str(stage["threads"])
|
|
404
|
+
ramp_prop = str(stage["ramp"])
|
|
405
|
+
duration_prop = str(stage["hold"])
|
|
406
|
+
delay_prop = str(stage["delay"])
|
|
407
|
+
header = f' <!-- Workload Stage {stage_index + 1}/{len(stages)}: {stage["threads"]} VUs, ramp {stage["ramp"]}s, hold {stage["hold"]}s, delay {stage["delay"]}s -->'
|
|
408
|
+
else:
|
|
409
|
+
threads_prop = f'${{__P(vus,{stage["threads"]})}}'
|
|
410
|
+
ramp_prop = f'${{__P(ramp_up,{stage["ramp"]})}}'
|
|
411
|
+
duration_prop = f'${{__P(duration,{stage["hold"]})}}'
|
|
412
|
+
delay_prop = "0"
|
|
413
|
+
header = f' <!-- Main Thread Group: {workload_profile.upper()} Profile -->'
|
|
414
|
+
xml_lines.extend([
|
|
415
|
+
header,
|
|
416
|
+
f' <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="{name}" enabled="true">',
|
|
417
|
+
' <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>',
|
|
418
|
+
' <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">',
|
|
419
|
+
f' <boolProp name="LoopController.continue_forever">{continue_forever}</boolProp>',
|
|
420
|
+
f' <stringProp name="LoopController.loops">${{__P(loops,{loops_str})}}</stringProp>',
|
|
421
|
+
' </elementProp>',
|
|
422
|
+
f' <stringProp name="ThreadGroup.num_threads">{threads_prop}</stringProp>',
|
|
423
|
+
f' <stringProp name="ThreadGroup.ramp_time">{ramp_prop}</stringProp>',
|
|
424
|
+
' <boolProp name="ThreadGroup.scheduler">true</boolProp>',
|
|
425
|
+
f' <stringProp name="ThreadGroup.duration">{duration_prop}</stringProp>',
|
|
426
|
+
f' <stringProp name="ThreadGroup.delay">{delay_prop}</stringProp>',
|
|
427
|
+
' <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>',
|
|
428
|
+
' </ThreadGroup>',
|
|
429
|
+
' <hashTree>'
|
|
430
|
+
])
|
|
431
|
+
|
|
432
|
+
_emit_stage_group(stages[0], 0)
|
|
433
|
+
stage_body_start = len(xml_lines)
|
|
434
|
+
|
|
435
|
+
# JSR223 Assertion Circuit Breaker (AutoStop on SLA Breach / Disaster Recovery)
|
|
436
|
+
if abort_on_fail:
|
|
437
|
+
xml_lines.extend([
|
|
438
|
+
' <!-- JSR223 Assertion Circuit Breaker: AutoStop on SLA Disaster -->',
|
|
439
|
+
' <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223 - AutoStop Circuit Breaker" enabled="true">',
|
|
440
|
+
' <stringProp name="scriptLanguage">groovy</stringProp>',
|
|
441
|
+
' <stringProp name="parameters"></stringProp>',
|
|
442
|
+
' <stringProp name="filename"></stringProp>',
|
|
443
|
+
' <stringProp name="cacheKey">true</stringProp>',
|
|
444
|
+
' <stringProp name="script"><![CDATA[',
|
|
445
|
+
'long total = vars.getObject("TOTAL_REQUESTS") ?: 0;',
|
|
446
|
+
'long failed = vars.getObject("FAILED_REQUESTS") ?: 0;',
|
|
447
|
+
'total++;',
|
|
448
|
+
'if (!prev.isSuccessful()) { failed++; }',
|
|
449
|
+
'vars.putObject("TOTAL_REQUESTS", total);',
|
|
450
|
+
'vars.putObject("FAILED_REQUESTS", failed);',
|
|
451
|
+
'',
|
|
452
|
+
'double errorRate = (double) failed / (double) total;',
|
|
453
|
+
f'double threshold = {abort_error_threshold};',
|
|
454
|
+
'if (total > 50 && errorRate > threshold) {',
|
|
455
|
+
' log.error("CRITICAL SLA BREACH: Error rate " + Math.round(errorRate * 100) + "% exceeds threshold " + Math.round(threshold * 100) + "%. Halting test immediately.");',
|
|
456
|
+
' prev.setStopTestNow(true);',
|
|
457
|
+
'}',
|
|
458
|
+
']]></stringProp>',
|
|
459
|
+
' </JSR223Assertion>',
|
|
460
|
+
' <hashTree/>'
|
|
461
|
+
])
|
|
462
|
+
|
|
463
|
+
# CSV Data Set Config (Dynamic credentials / entities)
|
|
464
|
+
if csv_file:
|
|
465
|
+
xml_lines.extend([
|
|
466
|
+
' <!-- CSV Data Set Config (Multi-User Dynamic Data Parameterization) -->',
|
|
467
|
+
' <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true">',
|
|
468
|
+
' <stringProp name="delimiter">,</stringProp>',
|
|
469
|
+
' <stringProp name="fileEncoding">UTF-8</stringProp>',
|
|
470
|
+
f' <stringProp name="filename">{xml_escape(csv_file)}</stringProp>',
|
|
471
|
+
' <boolProp name="ignoreFirstLine">true</boolProp>',
|
|
472
|
+
' <boolProp name="quotedData">false</boolProp>',
|
|
473
|
+
' <boolProp name="recycle">true</boolProp>',
|
|
474
|
+
' <stringProp name="shareMode">shareMode.all</stringProp>',
|
|
475
|
+
' <boolProp name="stopThread">false</boolProp>',
|
|
476
|
+
f' <stringProp name="variableNames">{xml_escape(csv_variables)}</stringProp>',
|
|
477
|
+
' </CSVDataSet>',
|
|
478
|
+
' <hashTree/>'
|
|
479
|
+
])
|
|
480
|
+
|
|
481
|
+
# JSR223 Groovy PreProcessor for HMAC-SHA256 Payload Signature
|
|
482
|
+
if jsr223_hmac:
|
|
483
|
+
xml_lines.extend([
|
|
484
|
+
' <!-- JSR223 Groovy PreProcessor: HMAC-SHA256 Payload Signer -->',
|
|
485
|
+
' <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="JSR223 - HMAC Payload Signer" enabled="true">',
|
|
486
|
+
' <stringProp name="scriptLanguage">groovy</stringProp>',
|
|
487
|
+
' <stringProp name="parameters"></stringProp>',
|
|
488
|
+
' <stringProp name="filename"></stringProp>',
|
|
489
|
+
' <stringProp name="cacheKey">true</stringProp>',
|
|
490
|
+
' <stringProp name="script"><![CDATA[',
|
|
491
|
+
'import javax.crypto.Mac',
|
|
492
|
+
'import javax.crypto.spec.SecretKeySpec',
|
|
493
|
+
'',
|
|
494
|
+
'String secret = vars.get("HMAC_SECRET") ?: "SynapseEnterpriseVault#2026"',
|
|
495
|
+
'String body = sampler.getArguments().getArgument(0)?.getValue() ?: ""',
|
|
496
|
+
'String timestamp = String.valueOf(System.currentTimeMillis())',
|
|
497
|
+
'',
|
|
498
|
+
'Mac mac = Mac.getInstance("HmacSHA256")',
|
|
499
|
+
'mac.init(new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256"))',
|
|
500
|
+
'byte[] rawHmac = mac.doFinal((timestamp + ":" + body).getBytes("UTF-8"))',
|
|
501
|
+
'String signature = rawHmac.encodeHex().toString()',
|
|
502
|
+
'',
|
|
503
|
+
'sampler.getHeaderManager().add(new org.apache.jmeter.protocol.http.control.Header("X-Signature", signature))',
|
|
504
|
+
'sampler.getHeaderManager().add(new org.apache.jmeter.protocol.http.control.Header("X-Timestamp", timestamp))',
|
|
505
|
+
'sampler.getHeaderManager().add(new org.apache.jmeter.protocol.http.control.Header("X-Correlation-ID", "CORR-" + UUID.randomUUID().toString()))',
|
|
506
|
+
']]></stringProp>',
|
|
507
|
+
' </JSR223PreProcessor>',
|
|
508
|
+
' <hashTree/>'
|
|
509
|
+
])
|
|
510
|
+
|
|
511
|
+
# Uniform Random Timer for realistic user think-time
|
|
512
|
+
if think_time_max > think_time_min and think_time_max > 0:
|
|
513
|
+
timer_range = think_time_max - think_time_min
|
|
514
|
+
xml_lines.extend([
|
|
515
|
+
' <!-- Uniform Random Timer (Simulate Realistic User Think-Time) -->',
|
|
516
|
+
' <UniformRandomTimer guiclass="UniformRandomTimerGui" testclass="UniformRandomTimer" testname="User Think-Time Timer" enabled="true">',
|
|
517
|
+
f' <stringProp name="ConstantTimer.delay">{think_time_min}</stringProp>',
|
|
518
|
+
f' <stringProp name="RandomTimer.range">{timer_range}</stringProp>',
|
|
519
|
+
' </UniformRandomTimer>',
|
|
520
|
+
' <hashTree/>'
|
|
521
|
+
])
|
|
522
|
+
|
|
523
|
+
def render_sampler(idx: int, s: Dict[str, Any], indent: str = " ") -> List[str]:
|
|
524
|
+
lines = []
|
|
525
|
+
s_name = xml_escape(s.get("name", f"HTTP Request {idx}"))
|
|
526
|
+
s_path = xml_escape(s.get("path", "/"))
|
|
527
|
+
s_method = xml_escape(s.get("method", "GET").upper())
|
|
528
|
+
s_body = s.get("body", "")
|
|
529
|
+
has_body = bool(s_body and s_method in ("POST", "PUT", "PATCH"))
|
|
530
|
+
escaped_body = xml_escape(s_body) if has_body else ""
|
|
531
|
+
expected_status = s.get("expected_status", 200)
|
|
532
|
+
|
|
533
|
+
lines.extend([
|
|
534
|
+
f'{indent}<!-- Sampler {idx}: [{s_method}] {s_name} -->',
|
|
535
|
+
f'{indent}<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="[{s_method}] {s_name}" enabled="true">',
|
|
536
|
+
f'{indent} <boolProp name="HTTPSampler.postBodyRaw">{str(has_body).lower()}</boolProp>',
|
|
537
|
+
f'{indent} <elementProp name="HTTPsampler.Arguments" elementType="Arguments">',
|
|
538
|
+
f'{indent} <collectionProp name="Arguments.arguments">'
|
|
539
|
+
])
|
|
540
|
+
|
|
541
|
+
if has_body:
|
|
542
|
+
lines.extend([
|
|
543
|
+
f'{indent} <elementProp name="" elementType="HTTPArgument">',
|
|
544
|
+
f'{indent} <boolProp name="HTTPArgument.always_encode">false</boolProp>',
|
|
545
|
+
f'{indent} <stringProp name="Argument.value">{escaped_body}</stringProp>',
|
|
546
|
+
f'{indent} <stringProp name="Argument.metadata">=</stringProp>',
|
|
547
|
+
f'{indent} </elementProp>'
|
|
548
|
+
])
|
|
549
|
+
|
|
550
|
+
lines.extend([
|
|
551
|
+
f'{indent} </collectionProp>',
|
|
552
|
+
f'{indent} </elementProp>',
|
|
553
|
+
f'{indent} <stringProp name="HTTPSampler.path">{s_path}</stringProp>',
|
|
554
|
+
f'{indent} <stringProp name="HTTPSampler.method">{s_method}</stringProp>',
|
|
555
|
+
f'{indent} <boolProp name="HTTPSampler.follow_redirects">true</boolProp>',
|
|
556
|
+
f'{indent} <boolProp name="HTTPSampler.auto_redirects">false</boolProp>',
|
|
557
|
+
f'{indent} <boolProp name="HTTPSampler.use_keepalive">true</boolProp>',
|
|
558
|
+
f'{indent} <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>',
|
|
559
|
+
f'{indent}</HTTPSamplerProxy>',
|
|
560
|
+
f'{indent}<hashTree>',
|
|
561
|
+
f'{indent} <!-- Response Status Assertion -->',
|
|
562
|
+
f'{indent} <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Status ({expected_status})" enabled="true">',
|
|
563
|
+
f'{indent} <collectionProp name="Asserion.test_strings">',
|
|
564
|
+
f'{indent} <stringProp name="{expected_status}">{expected_status}</stringProp>',
|
|
565
|
+
f'{indent} <stringProp name="200">200</stringProp>',
|
|
566
|
+
f'{indent} <stringProp name="201">201</stringProp>',
|
|
567
|
+
f'{indent} </collectionProp>',
|
|
568
|
+
f'{indent} <stringProp name="Assertion.test_field">Assertion.response_code</stringProp>',
|
|
569
|
+
f'{indent} <boolProp name="Assertion.assume_success">false</boolProp>',
|
|
570
|
+
f'{indent} <intProp name="Assertion.test_type">40</intProp>',
|
|
571
|
+
f'{indent} </ResponseAssertion>',
|
|
572
|
+
f'{indent} <hashTree/>',
|
|
573
|
+
f'{indent} <!-- SLA Ceiling Assertion (Percentile P95 is validated post-run by jtl_analyzer.py) -->',
|
|
574
|
+
f'{indent} <DurationAssertion guiclass="DurationAssertionGui" testclass="DurationAssertion" testname="Assert Max Latency Ceiling (< ${{MAX_LATENCY}}ms)" enabled="true">',
|
|
575
|
+
f'{indent} <stringProp name="DurationAssertion.duration">${{MAX_LATENCY}}</stringProp>',
|
|
576
|
+
f'{indent} </DurationAssertion>',
|
|
577
|
+
f'{indent} <hashTree/>'
|
|
578
|
+
])
|
|
579
|
+
|
|
580
|
+
# Deep Correlation Engine: CSRF Regex Extractor on HTML/Auth/Form responses
|
|
581
|
+
if deep_correlation:
|
|
582
|
+
lines.extend([
|
|
583
|
+
f'{indent} <!-- Deep Correlation: Regex Extract Hidden CSRF Token -->',
|
|
584
|
+
f'{indent} <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regex - Extract CSRF Token" enabled="true">',
|
|
585
|
+
f'{indent} <stringProp name="RegexExtractor.useHeaders">false</stringProp>',
|
|
586
|
+
f'{indent} <stringProp name="RegexExtractor.refname">CSRF_TOKEN</stringProp>',
|
|
587
|
+
f'{indent} <stringProp name="RegexExtractor.regex"><["\']\\s+value=["\']([^"\']+)["\'])|(?:content=["\']([^"\']+)["\']\\s+name=["\']csrf[-_]?token["\'])]]></stringProp>',
|
|
588
|
+
f'{indent} <stringProp name="RegexExtractor.template">$1$$2$</stringProp>',
|
|
589
|
+
f'{indent} <stringProp name="RegexExtractor.default">${{CSRF_TOKEN}}</stringProp>',
|
|
590
|
+
f'{indent} <stringProp name="RegexExtractor.match_number">1</stringProp>',
|
|
591
|
+
f'{indent} </RegexExtractor>',
|
|
592
|
+
f'{indent} <hashTree/>',
|
|
593
|
+
f'{indent} <!-- Deep Correlation: Random Array Item Selection (Match No: 0) -->',
|
|
594
|
+
f'{indent} <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="JSON Extractor - Random Item Selector" enabled="true">',
|
|
595
|
+
f'{indent} <stringProp name="JSONPostProcessor.referenceNames">RANDOM_ITEM_ID</stringProp>',
|
|
596
|
+
f'{indent} <stringProp name="JSONPostProcessor.jsonPathExprs">$..id</stringProp>',
|
|
597
|
+
f'{indent} <stringProp name="JSONPostProcessor.match_numbers">0</stringProp>',
|
|
598
|
+
f'{indent} <stringProp name="JSONPostProcessor.defaultValues">${{RANDOM_ITEM_ID}}</stringProp>',
|
|
599
|
+
f'{indent} </JSONPostProcessor>',
|
|
600
|
+
f'{indent} <hashTree/>'
|
|
601
|
+
])
|
|
602
|
+
|
|
603
|
+
# Dynamic Token Extractor
|
|
604
|
+
if "auth" in s_path.lower() or "login" in s_path.lower():
|
|
605
|
+
lines.extend([
|
|
606
|
+
f'{indent} <!-- Auto-Extract Dynamic Bearer Token -->',
|
|
607
|
+
f'{indent} <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="JSON Extractor - Bearer Token" enabled="true">',
|
|
608
|
+
f'{indent} <stringProp name="JSONPostProcessor.referenceNames">BEARER_TOKEN</stringProp>',
|
|
609
|
+
f'{indent} <stringProp name="JSONPostProcessor.jsonPathExprs">$..[\'token\',\'access_token\']</stringProp>',
|
|
610
|
+
f'{indent} <stringProp name="JSONPostProcessor.match_numbers">1</stringProp>',
|
|
611
|
+
f'{indent} <stringProp name="JSONPostProcessor.defaultValues">${{BEARER_TOKEN}}</stringProp>',
|
|
612
|
+
f'{indent} </JSONPostProcessor>',
|
|
613
|
+
f'{indent} <hashTree/>'
|
|
614
|
+
])
|
|
615
|
+
elif s_method == "POST":
|
|
616
|
+
lines.extend([
|
|
617
|
+
f'{indent} <!-- Auto-Extract Created Entity ID -->',
|
|
618
|
+
f'{indent} <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="JSON Extractor - Entity ID" enabled="true">',
|
|
619
|
+
f'{indent} <stringProp name="JSONPostProcessor.referenceNames">LAST_CREATED_ID</stringProp>',
|
|
620
|
+
f'{indent} <stringProp name="JSONPostProcessor.jsonPathExprs">$..[\'id\',\'code\']</stringProp>',
|
|
621
|
+
f'{indent} <stringProp name="JSONPostProcessor.match_numbers">1</stringProp>',
|
|
622
|
+
f'{indent} <stringProp name="JSONPostProcessor.defaultValues">${{LAST_CREATED_ID}}</stringProp>',
|
|
623
|
+
f'{indent} </JSONPostProcessor>',
|
|
624
|
+
f'{indent} <hashTree/>'
|
|
625
|
+
])
|
|
626
|
+
|
|
627
|
+
lines.append(f'{indent}</hashTree>')
|
|
628
|
+
return lines
|
|
629
|
+
|
|
630
|
+
# Render Samplers with optional Traffic Shaping (Weighted Throughput Controller)
|
|
631
|
+
if weighted_mix:
|
|
632
|
+
# Parse weights: e.g. "70,20,10" or "70:Browse,20:Cart,10:Checkout"
|
|
633
|
+
parts = [p.strip() for p in weighted_mix.split(",") if p.strip()]
|
|
634
|
+
weights: List[Tuple[float, str]] = []
|
|
635
|
+
for p in parts:
|
|
636
|
+
if ":" in p:
|
|
637
|
+
w_str, label = p.split(":", 1)
|
|
638
|
+
weights.append((float(w_str), label))
|
|
639
|
+
else:
|
|
640
|
+
weights.append((float(p), f"Route {len(weights) + 1}"))
|
|
641
|
+
|
|
642
|
+
# Partition samplers across weights
|
|
643
|
+
chunk_size = max(1, len(samplers) // len(weights)) if weights else len(samplers)
|
|
644
|
+
for w_idx, (weight, label) in enumerate(weights):
|
|
645
|
+
start_i = w_idx * chunk_size
|
|
646
|
+
end_i = start_i + chunk_size if w_idx < len(weights) - 1 else len(samplers)
|
|
647
|
+
group_samplers = samplers[start_i:end_i] if start_i < len(samplers) else samplers[-1:]
|
|
648
|
+
|
|
649
|
+
xml_lines.extend([
|
|
650
|
+
f' <!-- Traffic Shaping Controller: {weight}% Load ({label}) -->',
|
|
651
|
+
f' <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Traffic Weight {weight}% - {xml_escape(label)}" enabled="true">',
|
|
652
|
+
' <intProp name="ThroughputController.style">1</intProp>',
|
|
653
|
+
' <boolProp name="ThroughputController.perThread">false</boolProp>',
|
|
654
|
+
f' <stringProp name="ThroughputController.maxThroughput">{weight}</stringProp>',
|
|
655
|
+
' <FloatProperty>',
|
|
656
|
+
' <name>ThroughputController.percentThroughput</name>',
|
|
657
|
+
f' <value>{weight}</value>',
|
|
658
|
+
' <savedValue>0.0</savedValue>',
|
|
659
|
+
' </FloatProperty>',
|
|
660
|
+
' </ThroughputController>',
|
|
661
|
+
' <hashTree>'
|
|
662
|
+
])
|
|
663
|
+
for idx, s in enumerate(group_samplers, 1):
|
|
664
|
+
xml_lines.extend(render_sampler(idx, s, indent=" "))
|
|
665
|
+
xml_lines.append(' </hashTree>')
|
|
666
|
+
|
|
667
|
+
elif group_transactions:
|
|
668
|
+
# Group samplers into Transaction Controllers by operation prefix or chunks
|
|
669
|
+
xml_lines.extend([
|
|
670
|
+
' <!-- Transaction Controller: End-to-End User Journey Flow -->',
|
|
671
|
+
' <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="Transaction - End-to-End Business Flow" enabled="true">',
|
|
672
|
+
' <boolProp name="TransactionController.includeTimers">false</boolProp>',
|
|
673
|
+
' <boolProp name="TransactionController.parent">true</boolProp>',
|
|
674
|
+
' </TransactionController>',
|
|
675
|
+
' <hashTree>'
|
|
676
|
+
])
|
|
677
|
+
for idx, s in enumerate(samplers, 1):
|
|
678
|
+
xml_lines.extend(render_sampler(idx, s, indent=" "))
|
|
679
|
+
xml_lines.append(' </hashTree>')
|
|
680
|
+
else:
|
|
681
|
+
for idx, s in enumerate(samplers, 1):
|
|
682
|
+
xml_lines.extend(render_sampler(idx, s, indent=" "))
|
|
683
|
+
|
|
684
|
+
# Render JDBC Samplers if present
|
|
685
|
+
if jdbc_config and "queries" in jdbc_config:
|
|
686
|
+
pool_name = xml_escape(jdbc_config.get("pool_name", "EnterpriseDBPool"))
|
|
687
|
+
for q_idx, q in enumerate(jdbc_config["queries"], 1):
|
|
688
|
+
q_name = xml_escape(q.get("name", f"JDBC Query {q_idx}"))
|
|
689
|
+
sql = xml_escape(q.get("sql", "SELECT 1"))
|
|
690
|
+
q_type = xml_escape(q.get("type", "Select Statement"))
|
|
691
|
+
xml_lines.extend([
|
|
692
|
+
f' <!-- JDBC Sampler {q_idx}: {q_name} -->',
|
|
693
|
+
f' <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="[JDBC] {q_name}" enabled="true">',
|
|
694
|
+
f' <stringProp name="dataSource">{pool_name}</stringProp>',
|
|
695
|
+
f' <stringProp name="query">{sql}</stringProp>',
|
|
696
|
+
' <stringProp name="queryArguments"></stringProp>',
|
|
697
|
+
' <stringProp name="queryArgumentsTypes"></stringProp>',
|
|
698
|
+
f' <stringProp name="queryType">{q_type}</stringProp>',
|
|
699
|
+
' <stringProp name="resultVariable"></stringProp>',
|
|
700
|
+
' <stringProp name="variableNames"></stringProp>',
|
|
701
|
+
' <stringProp name="resultSetHandler">Store as String</stringProp>',
|
|
702
|
+
' </JDBCSampler>',
|
|
703
|
+
' <hashTree/>'
|
|
704
|
+
])
|
|
705
|
+
|
|
706
|
+
# Render WebSocket Samplers if present
|
|
707
|
+
if ws_config:
|
|
708
|
+
ws_server = xml_escape(ws_config.get("server", "localhost"))
|
|
709
|
+
ws_port = xml_escape(str(ws_config.get("port", "8080")))
|
|
710
|
+
ws_path = xml_escape(ws_config.get("path", "/ws/feed"))
|
|
711
|
+
xml_lines.extend([
|
|
712
|
+
' <!-- WebSocket Lifecycle Samplers (Connect, Send, Receive, Close) -->',
|
|
713
|
+
' <eu.luminis.jmeter.wssampler.OpenWebSocketSampler guiclass="eu.luminis.jmeter.wssampler.OpenWebSocketSamplerGui" testclass="eu.luminis.jmeter.wssampler.OpenWebSocketSampler" testname="[WS] Open Connection" enabled="true">',
|
|
714
|
+
' <boolProp name="TLS">false</boolProp>',
|
|
715
|
+
f' <stringProp name="server">{ws_server}</stringProp>',
|
|
716
|
+
f' <stringProp name="port">{ws_port}</stringProp>',
|
|
717
|
+
f' <stringProp name="path">{ws_path}</stringProp>',
|
|
718
|
+
' <stringProp name="connectTimeout">5000</stringProp>',
|
|
719
|
+
' <stringProp name="readTimeout">10000</stringProp>',
|
|
720
|
+
' </eu.luminis.jmeter.wssampler.OpenWebSocketSampler>',
|
|
721
|
+
' <hashTree/>',
|
|
722
|
+
' <eu.luminis.jmeter.wssampler.RequestResponseWebSocketSampler guiclass="eu.luminis.jmeter.wssampler.RequestResponseWebSocketSamplerGui" testclass="eu.luminis.jmeter.wssampler.RequestResponseWebSocketSampler" testname="[WS] Request-Response Frame" enabled="true">',
|
|
723
|
+
' <boolProp name="createNewConnection">false</boolProp>',
|
|
724
|
+
' <boolProp name="loadDataFromFile">false</boolProp>',
|
|
725
|
+
' <stringProp name="requestData">{"event": "subscribe", "channel": "ticker", "pair": "BTC_USDT"}</stringProp>',
|
|
726
|
+
' <stringProp name="readTimeout">5000</stringProp>',
|
|
727
|
+
' </eu.luminis.jmeter.wssampler.RequestResponseWebSocketSampler>',
|
|
728
|
+
' <hashTree/>',
|
|
729
|
+
' <eu.luminis.jmeter.wssampler.CloseWebSocketSampler guiclass="eu.luminis.jmeter.wssampler.CloseWebSocketSamplerGui" testclass="eu.luminis.jmeter.wssampler.CloseWebSocketSampler" testname="[WS] Close Connection" enabled="true">',
|
|
730
|
+
' <stringProp name="statusCode">1000</stringProp>',
|
|
731
|
+
' <stringProp name="readTimeout">3000</stringProp>',
|
|
732
|
+
' </eu.luminis.jmeter.wssampler.CloseWebSocketSampler>',
|
|
733
|
+
' <hashTree/>'
|
|
734
|
+
])
|
|
735
|
+
|
|
736
|
+
# Render gRPC Samplers if present
|
|
737
|
+
if grpc_config:
|
|
738
|
+
grpc_host = xml_escape(grpc_config.get("host", "localhost"))
|
|
739
|
+
grpc_port = xml_escape(str(grpc_config.get("port", "50051")))
|
|
740
|
+
grpc_service = xml_escape(grpc_config.get("service", "enterprise.OrderService/ProcessOrder"))
|
|
741
|
+
xml_lines.extend([
|
|
742
|
+
' <!-- gRPC Microservice RPC Sampler -->',
|
|
743
|
+
' <vn.zalopay.benchmark.core.protobuf.ProtobufSampler guiclass="TestBeanGUI" testclass="vn.zalopay.benchmark.core.protobuf.ProtobufSampler" testname="[gRPC] Unary RPC Call" enabled="true">',
|
|
744
|
+
f' <stringProp name="hostname">{grpc_host}</stringProp>',
|
|
745
|
+
f' <stringProp name="port">{grpc_port}</stringProp>',
|
|
746
|
+
f' <stringProp name="fullMethod">{grpc_service}</stringProp>',
|
|
747
|
+
' <boolProp name="useTls">false</boolProp>',
|
|
748
|
+
' <stringProp name="protoFolder">proto</stringProp>',
|
|
749
|
+
' <stringProp name="libFolder">proto/libs</stringProp>',
|
|
750
|
+
' <stringProp name="requestJson">{"order_id": "${LAST_CREATED_ID}", "amount": 250000, "currency": "VND"}</stringProp>',
|
|
751
|
+
' <stringProp name="deadline">5000</stringProp>',
|
|
752
|
+
' </vn.zalopay.benchmark.core.protobuf.ProtobufSampler>',
|
|
753
|
+
' <hashTree/>'
|
|
754
|
+
])
|
|
755
|
+
|
|
756
|
+
# Render Kafka Samplers if present
|
|
757
|
+
if kafka_config:
|
|
758
|
+
kafka_brokers = xml_escape(kafka_config.get("brokers", "localhost:9092"))
|
|
759
|
+
kafka_topic = xml_escape(kafka_config.get("topic", "enterprise.orders.stream"))
|
|
760
|
+
xml_lines.extend([
|
|
761
|
+
' <!-- Kafka Producer Event-Driven Message Sampler -->',
|
|
762
|
+
' <org.apache.jmeter.protocol.jms.sampler.PublisherSampler guiclass="TestBeanGUI" testclass="org.apache.jmeter.protocol.jms.sampler.PublisherSampler" testname="[Kafka] Stream Message Producer" enabled="true">',
|
|
763
|
+
' <stringProp name="jndiConfig">org.apache.kafka.common.security.plain.PlainLoginModule</stringProp>',
|
|
764
|
+
f' <stringProp name="destination">{kafka_topic}</stringProp>',
|
|
765
|
+
f' <stringProp name="providerUrl">{kafka_brokers}</stringProp>',
|
|
766
|
+
' <stringProp name="textMessage">{"timestamp": "${__time()}", "correlation_id": "CORR-${__UUID()}", "event": "ORDER_SUBMITTED"}</stringProp>',
|
|
767
|
+
' </org.apache.jmeter.protocol.jms.sampler.PublisherSampler>',
|
|
768
|
+
' <hashTree/>'
|
|
769
|
+
])
|
|
770
|
+
|
|
771
|
+
# Capture the first stage's hashTree body, close it, then replicate it for
|
|
772
|
+
# the remaining staged profiles (step/spike) so every stage executes the
|
|
773
|
+
# full sampler set inside its own scheduler window (vanilla JMeter, no
|
|
774
|
+
# plugins). The Result Collector moves to Test-Plan level so all stages
|
|
775
|
+
# stream into one JTL file.
|
|
776
|
+
stage_body = xml_lines[stage_body_start:]
|
|
777
|
+
xml_lines.append(' </hashTree>')
|
|
778
|
+
|
|
779
|
+
for stage_idx in range(1, len(stages)):
|
|
780
|
+
_emit_stage_group(stages[stage_idx], stage_idx)
|
|
781
|
+
xml_lines.extend(stage_body)
|
|
782
|
+
xml_lines.append(' </hashTree>')
|
|
783
|
+
|
|
784
|
+
# Result Collectors for CLI JTL export and Summary (plan-level: one JTL
|
|
785
|
+
# across all workload stages)
|
|
786
|
+
xml_lines.extend([
|
|
787
|
+
' <!-- Headless JTL Result Collector & Summary Report (plan-level, all stages) -->',
|
|
788
|
+
' <ResultCollector guiclass="SummaryReport" testclass="ResultCollector" testname="Summary Report" enabled="true">',
|
|
789
|
+
' <boolProp name="ResultCollector.error_logging">false</boolProp>',
|
|
790
|
+
' <objProp>',
|
|
791
|
+
' <name>saveConfig</name>',
|
|
792
|
+
' <value class="SampleSaveConfiguration">',
|
|
793
|
+
' <time>true</time>',
|
|
794
|
+
' <latency>true</latency>',
|
|
795
|
+
' <timestamp>true</timestamp>',
|
|
796
|
+
' <success>true</success>',
|
|
797
|
+
' <label>true</label>',
|
|
798
|
+
' <code>true</code>',
|
|
799
|
+
' <message>true</message>',
|
|
800
|
+
' <threadName>true</threadName>',
|
|
801
|
+
' <dataType>true</dataType>',
|
|
802
|
+
' <encoding>false</encoding>',
|
|
803
|
+
' <assertions>true</assertions>',
|
|
804
|
+
' <subresults>true</subresults>',
|
|
805
|
+
' <responseData>false</responseData>',
|
|
806
|
+
' <samplerData>false</samplerData>',
|
|
807
|
+
' <xml>false</xml>',
|
|
808
|
+
' <fieldNames>true</fieldNames>',
|
|
809
|
+
' <responseHeaders>false</responseHeaders>',
|
|
810
|
+
' <requestHeaders>false</requestHeaders>',
|
|
811
|
+
' <responseDataOnError>false</responseDataOnError>',
|
|
812
|
+
' <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>',
|
|
813
|
+
' <assertionsResultsToSave>0</assertionsResultsToSave>',
|
|
814
|
+
' <bytes>true</bytes>',
|
|
815
|
+
' <sentBytes>true</sentBytes>',
|
|
816
|
+
' <url>true</url>',
|
|
817
|
+
' <threadCounts>true</threadCounts>',
|
|
818
|
+
' <idleTime>true</idleTime>',
|
|
819
|
+
' <connectTime>true</connectTime>',
|
|
820
|
+
' </value>',
|
|
821
|
+
' </objProp>',
|
|
822
|
+
' <stringProp name="filename">jmeter_results.jtl</stringProp>',
|
|
823
|
+
' </ResultCollector>',
|
|
824
|
+
' <hashTree/>',
|
|
825
|
+
' </hashTree>',
|
|
826
|
+
' </hashTree>',
|
|
827
|
+
'</jmeterTestPlan>'
|
|
828
|
+
])
|
|
829
|
+
|
|
830
|
+
return "\n".join(xml_lines)
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
def generate_locustfile(
|
|
834
|
+
plan_name: str,
|
|
835
|
+
base_host: str,
|
|
836
|
+
protocol: str,
|
|
837
|
+
port: str,
|
|
838
|
+
samplers: List[Dict[str, Any]],
|
|
839
|
+
weighted_mix: Optional[str] = None,
|
|
840
|
+
think_time_min_ms: int = 0,
|
|
841
|
+
think_time_max_ms: int = 0,
|
|
842
|
+
) -> str:
|
|
843
|
+
"""Generates a runnable locustfile.py (code-as-code load model).
|
|
844
|
+
|
|
845
|
+
Concept borrowed from Locust (MIT): the plan becomes a User class with
|
|
846
|
+
weighted @task endpoints, honoring the same --weighted-mix traffic shaping
|
|
847
|
+
as the JMX export (weights chunk the samplers sequentially).
|
|
848
|
+
"""
|
|
849
|
+
host = f"{protocol}://{base_host}" if port in ("80", "443") else f"{protocol}://{base_host}:{port}"
|
|
850
|
+
|
|
851
|
+
# Distribute weights: chunk samplers sequentially per percentage.
|
|
852
|
+
task_weights: List[int] = [1] * len(samplers)
|
|
853
|
+
if weighted_mix:
|
|
854
|
+
try:
|
|
855
|
+
parts = [p.strip() for p in weighted_mix.split(",")]
|
|
856
|
+
pcts = [int(p.split(":")[0]) for p in parts if p]
|
|
857
|
+
total = sum(pcts) or 1
|
|
858
|
+
chunk = max(1, (len(samplers) + len(pcts) - 1) // len(pcts))
|
|
859
|
+
for gi, pct in enumerate(pcts):
|
|
860
|
+
for si in range(gi * chunk, min((gi + 1) * chunk, len(samplers))):
|
|
861
|
+
task_weights[si] = max(1, round(pct * 10 / total))
|
|
862
|
+
except ValueError:
|
|
863
|
+
task_weights = [1] * len(samplers)
|
|
864
|
+
|
|
865
|
+
def _slug(name: str, idx: int) -> str:
|
|
866
|
+
words = re.sub(r"[^a-zA-Z0-9]+", "_", name).strip("_").lower() or f"endpoint_{idx}"
|
|
867
|
+
return f"task_{idx + 1:02d}_{words[:40]}"
|
|
868
|
+
|
|
869
|
+
def _locust_body(raw: str) -> str:
|
|
870
|
+
"""Converts JMeter placeholders into a runtime-safe .format() body."""
|
|
871
|
+
if not raw:
|
|
872
|
+
return ""
|
|
873
|
+
s = raw.replace("${__time(HMS,)}", "\x01ts\x01")
|
|
874
|
+
s = s.replace("${RANDOM_ITEM_ID}", "\x01rnd\x01")
|
|
875
|
+
s = s.replace("${LAST_CREATED_ID}", "\x01last_id\x01")
|
|
876
|
+
s = re.sub(r"\$\{([A-Za-z0-9_]+)\}", lambda m: "sample_" + m.group(1).lower(), s)
|
|
877
|
+
s = s.replace("{", "{{").replace("}", "}}")
|
|
878
|
+
s = s.replace("\x01ts\x01", "{ts}").replace("\x01rnd\x01", "{rnd}").replace("\x01last_id\x01", "{last_id}")
|
|
879
|
+
return s
|
|
880
|
+
|
|
881
|
+
method_lines: List[str] = []
|
|
882
|
+
for idx, s in enumerate(samplers):
|
|
883
|
+
fn = _slug(s.get("name", f"{s.get('method')} {s.get('path')}"), idx)
|
|
884
|
+
weight = task_weights[idx] if idx < len(task_weights) else 1
|
|
885
|
+
method = (s.get("method") or "GET").upper()
|
|
886
|
+
path = (s.get("path") or "/").replace('"', '\\"')
|
|
887
|
+
method_lines.append(f" @task({weight})")
|
|
888
|
+
method_lines.append(f" def {fn}(self):")
|
|
889
|
+
method_lines.append(f' """{s.get("name", method + " " + path)}"""')
|
|
890
|
+
if method in ("POST", "PUT", "PATCH"):
|
|
891
|
+
method_lines.append(
|
|
892
|
+
f' self.client.{method.lower()}("{path}", '
|
|
893
|
+
f'name="{method} {path}", '
|
|
894
|
+
f'json=json.loads(BODIES["{fn}"].format(ts=datetime.now(timezone.utc).strftime("%H%M%S"), rnd=random.randint(1, 9999), last_id=LAST_CREATED_ID)))'
|
|
895
|
+
)
|
|
896
|
+
else:
|
|
897
|
+
method_lines.append(f' self.client.get("{path}", name="{method} {path}")')
|
|
898
|
+
method_lines.append("")
|
|
899
|
+
|
|
900
|
+
think_time = (
|
|
901
|
+
f"between({think_time_min_ms / 1000:.2f}, {think_time_max_ms / 1000:.2f})"
|
|
902
|
+
if think_time_max_ms > 0
|
|
903
|
+
else "constant_pacing(1.0)"
|
|
904
|
+
)
|
|
905
|
+
|
|
906
|
+
bodies = "\n".join(
|
|
907
|
+
f' "{_slug(s.get("name", ""), i)}": {_locust_body(s.get("body", ""))!r},'
|
|
908
|
+
for i, s in enumerate(samplers)
|
|
909
|
+
if (s.get("method") or "").upper() in ("POST", "PUT", "PATCH")
|
|
910
|
+
)
|
|
911
|
+
|
|
912
|
+
class_name = re.sub(r"[^A-Za-z0-9]+", "", plan_name.title()) or "EnterpriseUser"
|
|
913
|
+
|
|
914
|
+
return (
|
|
915
|
+
'"""Generated by Synapse Hub tools/generate_jmx_plan.py --emit-locust\n'
|
|
916
|
+
"Code-as-code load model (concept borrowed from Locust, MIT).\n"
|
|
917
|
+
"Run: locust -f this_file.py --host=HOST\n"
|
|
918
|
+
'"""\n'
|
|
919
|
+
"import json\n"
|
|
920
|
+
"import random\n"
|
|
921
|
+
"from datetime import datetime, timezone\n\n"
|
|
922
|
+
"from locust import HttpUser, task, between, constant_pacing\n\n"
|
|
923
|
+
"LAST_CREATED_ID = 1\n\n"
|
|
924
|
+
"BODIES = {\n"
|
|
925
|
+
f"{bodies}\n"
|
|
926
|
+
"}\n\n\n"
|
|
927
|
+
f"class {class_name}(HttpUser):\n"
|
|
928
|
+
f' """{plan_name}"""\n\n'
|
|
929
|
+
f" host = \"{host}\"\n"
|
|
930
|
+
f" wait_time = {think_time}\n\n"
|
|
931
|
+
+ "\n".join(method_lines)
|
|
932
|
+
)
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
def parse_openapi_for_jmeter(spec_data: Dict[str, Any]) -> tuple:
|
|
936
|
+
"""Extracts base configuration and samplers list from OpenAPI spec."""
|
|
937
|
+
info_dict = spec_data.get("info", {})
|
|
938
|
+
plan_name = info_dict.get("title", "Enterprise Performance Test Plan")
|
|
939
|
+
|
|
940
|
+
base_host = "api.staging.enterprise.local"
|
|
941
|
+
protocol = "https"
|
|
942
|
+
port = "443"
|
|
943
|
+
|
|
944
|
+
if "servers" in spec_data and spec_data["servers"]:
|
|
945
|
+
srv_url = spec_data["servers"][0].get("url", "")
|
|
946
|
+
if srv_url:
|
|
947
|
+
p = urlparse(srv_url)
|
|
948
|
+
if p.netloc:
|
|
949
|
+
base_host = p.hostname or base_host
|
|
950
|
+
protocol = p.scheme or protocol
|
|
951
|
+
port = str(p.port) if p.port else ("443" if protocol == "https" else "80")
|
|
952
|
+
elif "host" in spec_data:
|
|
953
|
+
base_host = spec_data["host"].split(":")[0]
|
|
954
|
+
schemes = spec_data.get("schemes", ["https"])
|
|
955
|
+
protocol = schemes[0]
|
|
956
|
+
port = "443" if protocol == "https" else "80"
|
|
957
|
+
|
|
958
|
+
samplers = []
|
|
959
|
+
paths = spec_data.get("paths", {})
|
|
960
|
+
|
|
961
|
+
for path_str, path_item in paths.items():
|
|
962
|
+
for method in ("get", "post", "put", "patch", "delete"):
|
|
963
|
+
if method not in path_item:
|
|
964
|
+
continue
|
|
965
|
+
|
|
966
|
+
op = path_item[method]
|
|
967
|
+
summary = op.get("summary") or f"{method.upper()} {path_str}"
|
|
968
|
+
|
|
969
|
+
def replace_path_param(match):
|
|
970
|
+
pname = match.group(1)
|
|
971
|
+
plow = pname.lower()
|
|
972
|
+
if plow in ("itemid", "productid", "item_id", "product_id"):
|
|
973
|
+
return "${RANDOM_ITEM_ID}"
|
|
974
|
+
if plow in ("id", "categoryid", "entityid", "userid", "orderid", "order_id"):
|
|
975
|
+
return "${LAST_CREATED_ID}"
|
|
976
|
+
return f"${{{pname}}}"
|
|
977
|
+
|
|
978
|
+
jmeter_path = re.sub(r'\{([a-zA-Z0-9_]+)\}', replace_path_param, path_str)
|
|
979
|
+
|
|
980
|
+
body_str = ""
|
|
981
|
+
if method in ("post", "put", "patch"):
|
|
982
|
+
req_body = op.get("requestBody", {})
|
|
983
|
+
content = req_body.get("content", {})
|
|
984
|
+
json_content = content.get("application/json", {})
|
|
985
|
+
schema = json_content.get("schema")
|
|
986
|
+
|
|
987
|
+
if schema:
|
|
988
|
+
props = schema.get("properties", {})
|
|
989
|
+
sample_payload = {}
|
|
990
|
+
for p_name, p_schema in props.items():
|
|
991
|
+
ptype = p_schema.get("type", "string")
|
|
992
|
+
if ptype == "string":
|
|
993
|
+
sample_payload[p_name] = p_schema.get("example") or "PERF_AUTO_${__time(HMS,)}"
|
|
994
|
+
elif ptype in ("integer", "number"):
|
|
995
|
+
sample_payload[p_name] = p_schema.get("example") or 100
|
|
996
|
+
elif ptype == "boolean":
|
|
997
|
+
sample_payload[p_name] = True
|
|
998
|
+
body_str = json.dumps(sample_payload, ensure_ascii=False)
|
|
999
|
+
else:
|
|
1000
|
+
body_str = '{"data": "PERF_LOAD_TEST"}'
|
|
1001
|
+
|
|
1002
|
+
expected_status = 200
|
|
1003
|
+
for code_str in op.get("responses", {}).keys():
|
|
1004
|
+
if code_str.isdigit():
|
|
1005
|
+
expected_status = int(code_str)
|
|
1006
|
+
break
|
|
1007
|
+
|
|
1008
|
+
samplers.append({
|
|
1009
|
+
"name": summary,
|
|
1010
|
+
"path": jmeter_path,
|
|
1011
|
+
"method": method.upper(),
|
|
1012
|
+
"body": body_str,
|
|
1013
|
+
"expected_status": expected_status
|
|
1014
|
+
})
|
|
1015
|
+
|
|
1016
|
+
def sampler_sort_key(s: Dict[str, Any]) -> int:
|
|
1017
|
+
p = s.get("path", "").lower()
|
|
1018
|
+
m = s.get("method", "GET")
|
|
1019
|
+
if "auth" in p or "login" in p or "token" in p:
|
|
1020
|
+
return 1
|
|
1021
|
+
if m == "POST" and "{" not in s.get("path", "") and "${" not in s.get("path", ""):
|
|
1022
|
+
return 2
|
|
1023
|
+
if m == "GET" and "{" not in s.get("path", "") and "${" not in s.get("path", ""):
|
|
1024
|
+
return 3
|
|
1025
|
+
if m == "GET":
|
|
1026
|
+
return 4
|
|
1027
|
+
if m in ("PUT", "PATCH"):
|
|
1028
|
+
return 5
|
|
1029
|
+
if m == "DELETE":
|
|
1030
|
+
return 6
|
|
1031
|
+
return 7
|
|
1032
|
+
|
|
1033
|
+
samplers.sort(key=sampler_sort_key)
|
|
1034
|
+
|
|
1035
|
+
return plan_name, base_host, protocol, port, samplers
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
def parse_postman_for_jmeter(postman_data: Dict[str, Any]) -> tuple:
|
|
1039
|
+
"""Extracts samplers from Postman Collection v2.1.0."""
|
|
1040
|
+
info = postman_data.get("info", {})
|
|
1041
|
+
plan_name = info.get("name", "Postman Converted Performance Plan")
|
|
1042
|
+
|
|
1043
|
+
base_host = "api.staging.enterprise.local"
|
|
1044
|
+
protocol = "https"
|
|
1045
|
+
port = "443"
|
|
1046
|
+
|
|
1047
|
+
samplers = []
|
|
1048
|
+
|
|
1049
|
+
def recurse_items(items):
|
|
1050
|
+
for it in items:
|
|
1051
|
+
if "item" in it:
|
|
1052
|
+
recurse_items(it["item"])
|
|
1053
|
+
elif "request" in it:
|
|
1054
|
+
req = it["request"]
|
|
1055
|
+
req_name = it.get("name", "Request")
|
|
1056
|
+
method = req.get("method", "GET").upper()
|
|
1057
|
+
url_obj = req.get("url", {})
|
|
1058
|
+
|
|
1059
|
+
if isinstance(url_obj, str):
|
|
1060
|
+
p = urlparse(url_obj)
|
|
1061
|
+
path = p.path or "/"
|
|
1062
|
+
else:
|
|
1063
|
+
path_parts = url_obj.get("path", [])
|
|
1064
|
+
path = "/" + "/".join(path_parts) if path_parts else "/"
|
|
1065
|
+
|
|
1066
|
+
jmeter_path = re.sub(r'\{\{([a-zA-Z0-9_]+)\}\}', r'${\1}', path)
|
|
1067
|
+
|
|
1068
|
+
body_str = ""
|
|
1069
|
+
body_obj = req.get("body", {})
|
|
1070
|
+
if body_obj.get("mode") == "raw":
|
|
1071
|
+
raw_text = body_obj.get("raw", "")
|
|
1072
|
+
body_str = re.sub(r'\{\{([a-zA-Z0-9_]+)\}\}', r'${\1}', raw_text)
|
|
1073
|
+
|
|
1074
|
+
samplers.append({
|
|
1075
|
+
"name": req_name,
|
|
1076
|
+
"path": jmeter_path,
|
|
1077
|
+
"method": method,
|
|
1078
|
+
"body": body_str,
|
|
1079
|
+
"expected_status": 200
|
|
1080
|
+
})
|
|
1081
|
+
|
|
1082
|
+
recurse_items(postman_data.get("item", []))
|
|
1083
|
+
return plan_name, base_host, protocol, port, samplers
|
|
1084
|
+
|
|
1085
|
+
|
|
1086
|
+
def parse_har_for_jmeter(har_data: Dict[str, Any]) -> tuple:
|
|
1087
|
+
"""Extracts samplers from HTTP Archive (HAR)."""
|
|
1088
|
+
entries = har_data.get("log", {}).get("entries", [])
|
|
1089
|
+
plan_name = "HAR Recorded Performance Test Plan"
|
|
1090
|
+
base_host = "api.staging.enterprise.local"
|
|
1091
|
+
protocol = "https"
|
|
1092
|
+
port = "443"
|
|
1093
|
+
samplers = []
|
|
1094
|
+
|
|
1095
|
+
if entries:
|
|
1096
|
+
first_url = entries[0].get("request", {}).get("url", "")
|
|
1097
|
+
p = urlparse(first_url)
|
|
1098
|
+
if p.netloc:
|
|
1099
|
+
base_host = p.hostname or base_host
|
|
1100
|
+
protocol = p.scheme or protocol
|
|
1101
|
+
port = str(p.port) if p.port else ("443" if protocol == "https" else "80")
|
|
1102
|
+
|
|
1103
|
+
for idx, e in enumerate(entries, 1):
|
|
1104
|
+
req = e.get("request", {})
|
|
1105
|
+
url = req.get("url", "/")
|
|
1106
|
+
p = urlparse(url)
|
|
1107
|
+
method = req.get("method", "GET").upper()
|
|
1108
|
+
|
|
1109
|
+
post_data = req.get("postData", {})
|
|
1110
|
+
body_str = post_data.get("text", "")
|
|
1111
|
+
status_code = e.get("response", {}).get("status", 200)
|
|
1112
|
+
|
|
1113
|
+
samplers.append({
|
|
1114
|
+
"name": f"HAR Step {idx}: {p.path or '/'}",
|
|
1115
|
+
"path": p.path + (f"?{p.query}" if p.query else ""),
|
|
1116
|
+
"method": method,
|
|
1117
|
+
"body": body_str,
|
|
1118
|
+
"expected_status": status_code if status_code > 0 else 200
|
|
1119
|
+
})
|
|
1120
|
+
|
|
1121
|
+
return plan_name, base_host, protocol, port, samplers
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
def main():
|
|
1125
|
+
parser = argparse.ArgumentParser(
|
|
1126
|
+
description="Generate Apache JMeter 5.x Test Plan XML (.jmx) with Pinnacle JMeter 360° Capabilities."
|
|
1127
|
+
)
|
|
1128
|
+
parser.add_argument("--spec", "-s", help="Path to OpenAPI / Swagger JSON/YAML specification file.")
|
|
1129
|
+
parser.add_argument("--postman", "-p", help="Path to Postman Collection JSON file (v2.1.0).")
|
|
1130
|
+
parser.add_argument("--har", help="Path to HTTP Archive (.har) recording file.")
|
|
1131
|
+
parser.add_argument("--base-url", "-b", help="Target base host URL (e.g. https://api.staging.enterprise.local).")
|
|
1132
|
+
parser.add_argument("--vus", type=int, default=50, help="Number of concurrent Virtual Users (threads). Default: 50.")
|
|
1133
|
+
parser.add_argument("--ramp-up", type=int, default=30, help="Ramp-up duration in seconds. Default: 30.")
|
|
1134
|
+
parser.add_argument("--duration", type=int, default=300, help="Sustained test duration in seconds. Default: 300.")
|
|
1135
|
+
parser.add_argument("--loop-count", type=int, default=-1, help="Loop iterations count (-1 for infinite). Default: -1.")
|
|
1136
|
+
parser.add_argument("--sla-p95", type=int, default=500, help="P95 Latency SLA assertion threshold in ms. Default: 500.")
|
|
1137
|
+
parser.add_argument("--output", "-o", help="Target output JMeter test plan file path (.jmx).")
|
|
1138
|
+
parser.add_argument("--emit-locust", dest="emit_locust", help="Also/instead emit a runnable Locust locustfile.py (code-as-code load model).")
|
|
1139
|
+
parser.add_argument("--sample", action="store_true", help="Generate a sample load test plan using built-in enterprise schema.")
|
|
1140
|
+
|
|
1141
|
+
# Advanced JMeter 360° Extensions
|
|
1142
|
+
parser.add_argument("--no-cookies", action="store_true", help="Disable automatic HTTP Cookie Manager.")
|
|
1143
|
+
parser.add_argument("--no-cache", action="store_true", help="Disable automatic HTTP Cache Manager.")
|
|
1144
|
+
parser.add_argument("--no-deep-correlation", action="store_true", help="Disable CSRF Regex and Random Item Selector.")
|
|
1145
|
+
parser.add_argument("--csv-data", help="Path to CSV file for dynamic multi-user test data parameterization.")
|
|
1146
|
+
parser.add_argument("--csv-vars", default="username,password,entity_id", help="Comma-separated variable names for CSV Data Set.")
|
|
1147
|
+
parser.add_argument("--group-transactions", action="store_true", help="Wrap endpoints in Transaction Controllers to measure end-to-end flow SLA.")
|
|
1148
|
+
parser.add_argument("--weighted-mix", help="Traffic shaping weight mix, e.g. '70,20,10' or '70:Browse,20:Cart,10:Checkout'.")
|
|
1149
|
+
parser.add_argument("--workload", choices=["linear", "step", "spike", "soak"], default="linear", help="Workload profile shape.")
|
|
1150
|
+
parser.add_argument("--jsr223-hmac", action="store_true", help="Inject JSR223 Groovy PreProcessor for HMAC-SHA256 payload signatures.")
|
|
1151
|
+
parser.add_argument("--influxdb-url", help="InfluxDB HTTP metrics endpoint for live Grafana APM dashboard streaming.")
|
|
1152
|
+
parser.add_argument("--perfmon-server", help="PerfMon Server Agent host:port (e.g. 192.168.1.100:4444) for hardware telemetry.")
|
|
1153
|
+
parser.add_argument("--think-time-min", type=int, default=0, help="Minimum simulated user think time in ms.")
|
|
1154
|
+
parser.add_argument("--think-time-max", type=int, default=0, help="Maximum simulated user think time in ms.")
|
|
1155
|
+
parser.add_argument("--abort-on-fail", action="store_true", default=True, help="Inject AutoStop circuit breaker (JSR223 Assertion) halting test on SLA breach (default: True).")
|
|
1156
|
+
parser.add_argument("--no-abort-on-fail", action="store_false", dest="abort_on_fail", help="Disable automatic AutoStop circuit breaker.")
|
|
1157
|
+
parser.add_argument("--abort-error-threshold", type=float, default=0.10, help="Error rate threshold (0.0 - 1.0) to trigger AutoStop circuit breaker. Default: 0.10 (10%%).")
|
|
1158
|
+
|
|
1159
|
+
# Multi-Protocol Samples
|
|
1160
|
+
parser.add_argument("--jdbc-sample", action="store_true", help="Generate a sample JDBC database benchmark test plan.")
|
|
1161
|
+
parser.add_argument("--ws-sample", action="store_true", help="Generate a sample WebSocket real-time lifecycle test plan.")
|
|
1162
|
+
parser.add_argument("--grpc-sample", action="store_true", help="Generate a sample gRPC microservice unary RPC test plan.")
|
|
1163
|
+
parser.add_argument("--kafka-sample", action="store_true", help="Generate a sample Kafka stream message producer test plan.")
|
|
1164
|
+
|
|
1165
|
+
args = parser.parse_args()
|
|
1166
|
+
|
|
1167
|
+
jdbc_config = None
|
|
1168
|
+
ws_config = None
|
|
1169
|
+
grpc_config = None
|
|
1170
|
+
kafka_config = None
|
|
1171
|
+
|
|
1172
|
+
if args.ws_sample:
|
|
1173
|
+
plan_name = "Enterprise WebSocket Real-Time Stream Benchmark"
|
|
1174
|
+
base_host = "localhost"
|
|
1175
|
+
protocol = "ws"
|
|
1176
|
+
port = "8080"
|
|
1177
|
+
samplers = []
|
|
1178
|
+
ws_config = {
|
|
1179
|
+
"server": "localhost",
|
|
1180
|
+
"port": 8080,
|
|
1181
|
+
"path": "/ws/feed"
|
|
1182
|
+
}
|
|
1183
|
+
elif args.grpc_sample:
|
|
1184
|
+
plan_name = "Enterprise gRPC Microservices Benchmark"
|
|
1185
|
+
base_host = "localhost"
|
|
1186
|
+
protocol = "grpc"
|
|
1187
|
+
port = "50051"
|
|
1188
|
+
samplers = []
|
|
1189
|
+
grpc_config = {
|
|
1190
|
+
"host": "localhost",
|
|
1191
|
+
"port": 50051,
|
|
1192
|
+
"service": "enterprise.OrderService/ProcessOrder"
|
|
1193
|
+
}
|
|
1194
|
+
elif args.kafka_sample:
|
|
1195
|
+
plan_name = "Enterprise Kafka Event Stream Benchmark"
|
|
1196
|
+
base_host = "localhost"
|
|
1197
|
+
protocol = "kafka"
|
|
1198
|
+
port = "9092"
|
|
1199
|
+
samplers = []
|
|
1200
|
+
kafka_config = {
|
|
1201
|
+
"brokers": "localhost:9092",
|
|
1202
|
+
"topic": "enterprise.orders.stream"
|
|
1203
|
+
}
|
|
1204
|
+
elif args.jdbc_sample:
|
|
1205
|
+
plan_name = "Enterprise Database Performance Benchmark (JDBC)"
|
|
1206
|
+
base_host = "localhost"
|
|
1207
|
+
protocol = "http"
|
|
1208
|
+
port = "80"
|
|
1209
|
+
samplers = []
|
|
1210
|
+
jdbc_config = {
|
|
1211
|
+
"pool_name": "PostgresEnterprisePool",
|
|
1212
|
+
"url": "jdbc:postgresql://localhost:5432/enterprise_db",
|
|
1213
|
+
"driver": "org.postgresql.Driver",
|
|
1214
|
+
"user": "postgres",
|
|
1215
|
+
"password": "SecretDBPassword#2026",
|
|
1216
|
+
"queries": [
|
|
1217
|
+
{"name": "Query High-Frequency Catalogs", "sql": "SELECT id, code, name, price FROM catalogs WHERE active = true LIMIT 50;", "type": "Select Statement"},
|
|
1218
|
+
{"name": "Insert Synthetic Audit Log", "sql": "INSERT INTO audit_logs(event_name, created_at) VALUES ('PERF_LOAD_RUN', NOW());", "type": "Update Statement"}
|
|
1219
|
+
]
|
|
1220
|
+
}
|
|
1221
|
+
elif args.har and os.path.exists(args.har):
|
|
1222
|
+
with open(args.har, "r", encoding="utf-8") as f:
|
|
1223
|
+
har_data = json.load(f)
|
|
1224
|
+
plan_name, base_host, protocol, port, samplers = parse_har_for_jmeter(har_data)
|
|
1225
|
+
elif args.postman:
|
|
1226
|
+
if not os.path.exists(args.postman):
|
|
1227
|
+
print(f"❌ Error: Postman collection not found: {args.postman}", file=sys.stderr)
|
|
1228
|
+
sys.exit(1)
|
|
1229
|
+
with open(args.postman, "r", encoding="utf-8") as f:
|
|
1230
|
+
postman_data = json.load(f)
|
|
1231
|
+
plan_name, base_host, protocol, port, samplers = parse_postman_for_jmeter(postman_data)
|
|
1232
|
+
elif args.spec and os.path.exists(args.spec):
|
|
1233
|
+
with open(args.spec, "r", encoding="utf-8") as f:
|
|
1234
|
+
spec_data = json.load(f)
|
|
1235
|
+
plan_name, base_host, protocol, port, samplers = parse_openapi_for_jmeter(spec_data)
|
|
1236
|
+
else:
|
|
1237
|
+
# Fallback to built-in sample spec
|
|
1238
|
+
from export_postman_collection import get_domain_spec
|
|
1239
|
+
spec_data = get_domain_spec("ecommerce")
|
|
1240
|
+
plan_name, base_host, protocol, port, samplers = parse_openapi_for_jmeter(spec_data)
|
|
1241
|
+
|
|
1242
|
+
# Base URL override if provided
|
|
1243
|
+
if args.base_url:
|
|
1244
|
+
p = urlparse(args.base_url)
|
|
1245
|
+
if p.netloc:
|
|
1246
|
+
base_host = p.hostname or base_host
|
|
1247
|
+
protocol = p.scheme or protocol
|
|
1248
|
+
port = str(p.port) if p.port else ("443" if protocol == "https" else "80")
|
|
1249
|
+
else:
|
|
1250
|
+
base_host = args.base_url
|
|
1251
|
+
|
|
1252
|
+
# Code-as-code Locust export (concept borrowed from Locust, MIT)
|
|
1253
|
+
if args.emit_locust:
|
|
1254
|
+
locust_source = generate_locustfile(
|
|
1255
|
+
plan_name=plan_name,
|
|
1256
|
+
base_host=base_host,
|
|
1257
|
+
protocol=protocol,
|
|
1258
|
+
port=port,
|
|
1259
|
+
samplers=samplers,
|
|
1260
|
+
weighted_mix=args.weighted_mix,
|
|
1261
|
+
think_time_min_ms=args.think_time_min,
|
|
1262
|
+
think_time_max_ms=args.think_time_max,
|
|
1263
|
+
)
|
|
1264
|
+
out_dir = os.path.dirname(os.path.abspath(args.emit_locust))
|
|
1265
|
+
if out_dir and not os.path.exists(out_dir):
|
|
1266
|
+
os.makedirs(out_dir, exist_ok=True)
|
|
1267
|
+
with open(args.emit_locust, "w", encoding="utf-8") as f:
|
|
1268
|
+
f.write(locust_source)
|
|
1269
|
+
print(f"🐍 [LOCUST EXPORT] Runnable locustfile written: {args.emit_locust}")
|
|
1270
|
+
print(f" Run: locust -f \"{args.emit_locust}\" --host={protocol}://{base_host}:{port}")
|
|
1271
|
+
if not args.output:
|
|
1272
|
+
return
|
|
1273
|
+
|
|
1274
|
+
jmx_content = build_jmx_xml(
|
|
1275
|
+
plan_name=plan_name,
|
|
1276
|
+
base_host=base_host,
|
|
1277
|
+
protocol=protocol,
|
|
1278
|
+
port=port,
|
|
1279
|
+
vus=args.vus,
|
|
1280
|
+
ramp_up=args.ramp_up,
|
|
1281
|
+
duration=args.duration,
|
|
1282
|
+
loop_count=args.loop_count,
|
|
1283
|
+
sla_p95=args.sla_p95,
|
|
1284
|
+
samplers=samplers,
|
|
1285
|
+
enable_cookies=not args.no_cookies,
|
|
1286
|
+
enable_cache=not args.no_cache,
|
|
1287
|
+
csv_file=args.csv_data,
|
|
1288
|
+
csv_variables=args.csv_vars,
|
|
1289
|
+
group_transactions=args.group_transactions,
|
|
1290
|
+
weighted_mix=args.weighted_mix,
|
|
1291
|
+
deep_correlation=not args.no_deep_correlation,
|
|
1292
|
+
workload_profile=args.workload,
|
|
1293
|
+
jsr223_hmac=args.jsr223_hmac,
|
|
1294
|
+
influxdb_url=args.influxdb_url,
|
|
1295
|
+
perfmon_server=args.perfmon_server,
|
|
1296
|
+
think_time_min=args.think_time_min,
|
|
1297
|
+
think_time_max=args.think_time_max,
|
|
1298
|
+
abort_on_fail=args.abort_on_fail,
|
|
1299
|
+
abort_error_threshold=args.abort_error_threshold,
|
|
1300
|
+
jdbc_config=jdbc_config,
|
|
1301
|
+
ws_config=ws_config,
|
|
1302
|
+
grpc_config=grpc_config,
|
|
1303
|
+
kafka_config=kafka_config
|
|
1304
|
+
)
|
|
1305
|
+
|
|
1306
|
+
if args.output:
|
|
1307
|
+
out_dir = os.path.dirname(os.path.abspath(args.output))
|
|
1308
|
+
if out_dir and not os.path.exists(out_dir):
|
|
1309
|
+
os.makedirs(out_dir, exist_ok=True)
|
|
1310
|
+
with open(args.output, "w", encoding="utf-8") as f:
|
|
1311
|
+
f.write(jmx_content)
|
|
1312
|
+
print(f"✅ [JMETER PLAN EXPORT] Successfully created Apache JMeter 5.x Plan: {args.output}")
|
|
1313
|
+
print(f"📊 Profile: {args.workload.upper()} | {args.vus} VUs | {args.ramp_up}s Ramp-up | {args.duration}s Duration | SLA < {args.sla_p95}ms")
|
|
1314
|
+
print(f"🛡️ Capabilities: Cookies={'ON' if not args.no_cookies else 'OFF'} | Cache={'ON' if not args.no_cache else 'OFF'} | DeepCorrelation={'ON' if not args.no_deep_correlation else 'OFF'} | WeightedMix={args.weighted_mix or 'None'}")
|
|
1315
|
+
print(f"🚀 Headless Execution: jmeter -n -t \"{args.output}\" -l results.jtl -e -o ./html_report")
|
|
1316
|
+
print(f"🎯 CI/CD SLA Gatekeeper: agent-qa analyze-jtl results.jtl --sla-p95 {args.sla_p95} --max-error-rate 1.0")
|
|
1317
|
+
else:
|
|
1318
|
+
print(jmx_content)
|
|
1319
|
+
|
|
1320
|
+
|
|
1321
|
+
if __name__ == "__main__":
|
|
1322
|
+
main()
|