Skip to content

Add Custom Pacer for CSV-Based Traffic Patterns #740

@Rishygunjal

Description

@Rishygunjal

Proposal

Implementing a custom Pacer which is fired according to a CSV file which the user can attach. The Vegeta follows the trace of the CSV file which can be any random curve which we don't really care except the fact that the inter arrival time between two hits would be same in both.

Background

Vegeta's built-in pacers (Constant, Sine, Linear) don't support realistic load testing with actual transaction timestamps. Financial systems need to replay historical traffic patterns exactly as they occurred, which requires scheduling requests based on real timestamps from CSV data rather than mathematical functions.

Workarounds

Created a CustomPacer that:

  • Reads transaction timestamps from CSV files
  • Schedules requests at exact times matching historical data
  • Handles burst scenarios where multiple transactions occur simultaneously
  • Maintains compatibility with existing Vegeta interfaces

Key Changes

  1. Added CustomPacer struct implementing the Pacer interface
  2. Implemented Pace() method to calculate wait times based on CSV timestamps
  3. Added CSV parsing and sorting logic in main application
  4. Integrated with Vegeta's attack mechanism

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions