Skip to content

Multiple URL paths with weights #22

Description

@FumingPower3925

Problem

The load generator benchmarks a single URL path. Real-world traffic hits multiple endpoints with different frequencies.

Solution

Add support for multiple paths with weighted distribution:

type PathConfig struct {
    Path   string  // URL path (e.g., "/api/users")
    Weight float64 // Relative weight (e.g., 0.7 for 70% of requests)
    Method string  // HTTP method (default: GET)
    Body   []byte  // Request body (for POST/PUT)
}

type Config struct {
    // Paths defines multiple URL paths with weighted distribution.
    // If empty, uses URL path (default: "/").
    // Weights are relative and normalized internally.
    Paths []PathConfig
}

Distribution: weighted round-robin or random selection based on weights.

Acceptance Criteria

  • Multiple paths supported
  • Weights control distribution
  • Per-path results in output
  • CLI flag: -path "/api:70,/health:30"

Future

This is a post-v1.0.0 feature.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew functionality

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions