Skip to content

Latest commit

 

History

History
75 lines (62 loc) · 3.26 KB

File metadata and controls

75 lines (62 loc) · 3.26 KB

Zabbix Load Testing Tool: Development Plan

This document outlines the development steps for the zbx-load-testing tool, based on the technical design document.

Phase 1: Core Application & Configuration

  • 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.
  • 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.

Phase 2: setup Command

  • Entity Creation:
    • Implement hostgroup.create.
    • Implement host.create to create hosts and link specified templates.
  • Template & LLD Processing:
    • Implement template.get to fetch template details.
    • Parse templates to identify regular items and LLD rules.
    • Implement initial LLD data submission for all hosts.
  • Discovery Verification:
    • Implement polling logic using item.get to wait until Zabbix creates items from LLD prototypes.

Phase 3: cleanup Command

  • Entity Deletion:
    • Implement host.delete to remove the test hosts.
    • Implement hostgroup.delete to remove the test host group.

Phase 4: run Command - Metric & LLD Generation

  • Core Runner Logic:
    • Implement the main loop for the run command.
    • Implement the per-host goroutine structure.
    • Implement the startup staggering logic (staggering_window_sec).
  • Data Submission:
    • Integrate the go-zabbix sender library.
    • Implement scheduled metric sending for regular items based on their update interval.
    • Implement scheduled LLD data submission for trapper discovery rules.
  • Data Generation:
    • Implement basic data generation for different item types.
    • Implement logic to make a percentage of triggers enter a "PROBLEM" state (firing_percentage).

Phase 5: Terminal User Interface (TUI)

  • TUI Integration:
    • Integrate the tcell library or a higher-level TUI framework.
    • Design and implement the static layout.
  • 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.
    • Logs & Events:
      • Implement a logging pane to show key events during the test run.

Phase 6: Advanced Features & Reporting

  • Graceful Shutdown:
    • Implement signal handling (Ctrl+C) to trigger a clean shutdown.
  • Reporting:
    • On shutdown, gather summary statistics.
    • Generate and save a report.json file.
  • Self-Throttling:
    • Implement the logic to check Zabbix health metrics against thresholds from config.yaml.
    • If throttling.enabled is true, pause or reduce metric sending rate when thresholds are breached.