This document outlines the development steps for the zbx-load-testing tool, based on the technical design document.
- Project Setup: Initialize Go module and basic project structure (e.g.,
cmd/,internal/). - Configuration:
- Define Go structs to represent
config.yaml. - Implement YAML parsing to load configuration into structs.
- Define Go structs to represent
- CLI Framework:
- Integrate a CLI library (e.g., Cobra).
- Create stub commands:
setup,run,cleanup.
- Zabbix API Client:
- Create a wrapper/client for interacting with the Zabbix API.
- Implement authentication logic.
- Entity Creation:
- Implement
hostgroup.create. - Implement
host.createto create hosts and link specified templates.
- Implement
- Template & LLD Processing:
- Implement
template.getto fetch template details. - Parse templates to identify regular items and LLD rules.
- Implement initial LLD data submission for all hosts.
- Implement
- Discovery Verification:
- Implement polling logic using
item.getto wait until Zabbix creates items from LLD prototypes.
- Implement polling logic using
- Entity Deletion:
- Implement
host.deleteto remove the test hosts. - Implement
hostgroup.deleteto remove the test host group.
- Implement
- Core Runner Logic:
- Implement the main loop for the
runcommand. - Implement the per-host goroutine structure.
- Implement the startup staggering logic (
staggering_window_sec).
- Implement the main loop for the
- Data Submission:
- Integrate the
go-zabbixsender library. - Implement scheduled metric sending for regular items based on their update interval.
- Implement scheduled LLD data submission for trapper discovery rules.
- Integrate the
- Data Generation:
- Implement basic data generation for different item types.
- Implement logic to make a percentage of triggers enter a "PROBLEM" state (
firing_percentage).
- TUI Integration:
- Integrate the
tcelllibrary or a higher-level TUI framework. - Design and implement the static layout.
- Integrate the
- Dynamic Data Display:
- Load Generator Stats:
- Display number of simulated hosts and active items.
- Calculate and display theoretical and actual NVPS.
- Display LLDs / sec.
- Zabbix Server Health:
- Implement periodic polling of Zabbix internal metrics (
zabbix[queue,1m], etc.). - Display the fetched health metrics in the TUI.
- Implement periodic polling of Zabbix internal metrics (
- Logs & Events:
- Implement a logging pane to show key events during the test run.
- Load Generator Stats:
- Graceful Shutdown:
- Implement signal handling (Ctrl+C) to trigger a clean shutdown.
- Reporting:
- On shutdown, gather summary statistics.
- Generate and save a
report.jsonfile.
- Self-Throttling:
- Implement the logic to check Zabbix health metrics against thresholds from
config.yaml. - If
throttling.enabledis true, pause or reduce metric sending rate when thresholds are breached.
- Implement the logic to check Zabbix health metrics against thresholds from