$ show kubernetes/perf-tests
This repository is the official Kubernetes performance testing suite, housing multiple tools for benchmarking, load testing, and monitoring Kubernetes clusters. The core tool is clusterloader2 (CL2), a powerful framework that deploys scalable workloads, measures key performance indicators (API responsiveness, pod startup latency, scheduling throughput), and validates SLOs. It uses a pluggable measurement system, tuning sets for load patterns, and a provider abstraction layer supporting various environments (GKE, EKS, AKS, Kind, Kubemark). Other tools include a metric comparison utility (benchmark), a historical performance dashboard (perfdash), a real-time SLO Prometheus exporter (slo-monitor), DNS and network performance benchmarks, and data ingestion pipelines (perflens). The codebase is predominantly Go with Python scripts for data processing and extensive Prometheus/Grafana configurations. While primarily an application, it incorporates data pipelines for metric ingestion and SLO analysis, making it a hybrid toolset for performance engineering.
The LLM identified 6 files worth highlighting for reuse:
Provides a generic measurement registration and creation mechanism. New measurements are registered via init() with a factory function. The factory is called by name, decoupling measurement implementation from the framework. This pattern is reusable for any extensible test or monitoring system.
Implements a factory for creating tuning sets that control load patterns (QPS load, stepped load, randomized load, Poisson load, time-limited, etc.). Each tuning set implements a common interface and can be mixed. This pattern is reusable for any load-testing tool needing flexible load profiles.
Defines an interface for cloud provider abstractions with methods for feature detection (SupportSSHToMaster, SupportImagePreload, etc.) and utility functions. Multiple implementations (GKE, EKS, AKS, Kind) exist. The clean interface design allows easy addition of new providers and is reusable for any multi-cloud tool.
Contains LatencyMetric struct and methods for computing percentiles (50th, 90th, 99th) from a slice of durations, as well as histogram conversion and threshold verification. This is a self-contained utility that can be extracted for any latency analysis need.
Wraps the Prometheus HTTP API client to provide high-level query functions (QuerySync, QueryRangeSync) with error handling and response parsing. It handles matrix, vector, scalar, and string result types. This is reusable for any Go application that needs to query Prometheus.
Implements a thread-safe error list that can aggregate multiple errors during test execution. Supports appending, retrieving, and checking for errors. This pattern is generally reusable for any concurrent error collection scenario.