vegaload

command
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

eval.go implements `vegaload mcp eval`: FR-MCP-04's versioned MCP tool-calling evaluation suite, run against this same compiled binary.

It resolves this binary's own path and builds the real internal/mcp.Tool set from it (exactly what `vegaload mcp serve` would register), writes two fixture files into a temp working directory (a report.Result and a one-endpoint OpenAPI spec, with values the embedded v1 suite's expectations are written against — see internal/eval/v1/cases.json), substitutes "${WORKDIR}" in the embedded suite for that directory, and runs every case through internal/eval.Run.

init.go implements `vegaload init`: FR-MCP-04's one-command setup for an agent-native project. It writes four things, each independently skippable if already present (so a second `vegaload init` is a no-op unless -force is given):

  • .claude/skills/vegaload/SKILL.md — the Claude Code skill bundle
  • .cursor/rules/vegaload.mdc — the Cursor rules bundle
  • .mcp.json — Claude Code's MCP server config
  • .cursor/mcp.json — Cursor's MCP server config

Both MCP config files point at this same compiled binary (via os.Executable()) running `mcp serve`, merged into whatever config already exists there rather than overwriting it — see internal/skills.MergeMCPServerConfig.

Command vegaload is the VegaLoad CLI.

Phase 0 wires together the engine, the four protocol drivers, and the two scripting runtimes behind commands including run, new, diagnose, and compare. See AGENTS.md for the module boundaries this command is built on top of, and run.go's doc comment for how a scenario file and a protocol-direct target relate to each other.

mcp.go implements `vegaload mcp serve`, FR-MCP-02's stdio-transport MCP server. It is intentionally thin: internal/mcp holds the actual JSON-RPC engine and tool implementations, every one of which shells out back to this same compiled binary (see internal/mcp.RunCLI) — this file's only real job is resolving that binary's own path once and handing it to internal/mcp.NewTools, then running the server on stdin/stdout until the client disconnects.

run.go implements `vegaload run`, the command that actually drives a load test. It wires together three things built in earlier Phase 0 deliverables without any of them knowing about each other:

  • internal/engine picks the load shape (fixed-vus, ramp, step, constant-arrival-rate) and schedules VUs against it.
  • internal/protocol/* send requests, when run is given a protocol-direct target (-target and -protocol, no scenario file).
  • internal/scripting/* run a scenario file's exported function, when run is given one instead.

A run is exactly one of those two modes, never both: either

vegaload run -target https://example.com -protocol http1 -vus 10 -duration 30s

or

vegaload run scenario.vl.js -vus 10 -duration 30s

The two modes stay separate rather than "a script that also hits -target": protocol-direct mode repeats one fixed target as fast and simply as possible, while a scenario file (per FR-CLI-08) can make any number of its own real HTTP/WebSocket calls via the `http`/`ws` globals internal/scripting/js and /python inject into every VU, carrying a value from one call into the next — see those packages' doc comments for a worked example (LaunchPad's create-then-ignite flow). Every one of those calls still goes through the same allowlist FR-CLI-06 built for -target, just enforced per call instead of once up front — see buildSafetyCheck below for why that has to differ from enforceSafety's own one-time, promptable check.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL