cli

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatOutput

func FormatOutput(stats *http.LoadTestStats, config *BenchConfig) error

FormatOutput writes results in requested format

func PrintHelp

func PrintHelp()

PrintHelp displays usage information

func RunBench

func RunBench(config *BenchConfig) error

RunBench executes the load test with given configuration

Types

type BenchConfig

type BenchConfig struct {
	// Target configuration
	URL    string
	Method string
	Body   string

	// Headers (parsed from repeated -H flags)
	Headers map[string]string

	// Load parameters
	Concurrency   int
	Duration      time.Duration
	TotalRequests int

	// Performance tuning
	Timeout   time.Duration
	RateLimit int // requests per second, 0 = unlimited
	KeepAlive bool

	// Output options
	Quiet  bool
	JSON   bool
	Output string // file path for output
}

BenchConfig holds parsed CLI flags for benchmarking

func ParseBenchFlags

func ParseBenchFlags(args []string) (*BenchConfig, error)

ParseBenchFlags parses command-line flags for bench subcommand

func (*BenchConfig) Validate

func (c *BenchConfig) Validate() error

Validate checks BenchConfig for errors

Jump to

Keyboard shortcuts

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