Note
The Diameter Credit-Control Application serves as a foundational framework for real-time charging, facilitating communication between gateways/control-points and the back-end account/balance systems. This is particularly crucial for the integration with an Online Charging System (e.g. Cgrates), enabling seamless and efficient management of end-user services.
This project provides a K6 script tailored for load testing Diameter Credit-Control Applications, as specified in IETF standards RFC 4006 and RFC 8506.
The script is designed to emulate real-world credit-control scenarios for a variety of end-user services, ensuring the resilience and scalability of Diameter-based systems under significant loads.
Specifically, it simulates the interactions within a LTE core network (e.g. Open5gs) and a IP multimedia subsystem (e.g. Kamailio) packets, closely mimicking the behavior of real-world ISP providers charging systems.
This simulation is crucial for validating the performance and reliability of Diameter Credit-Control Applications under various load conditions, providing insights into potential bottlenecks and areas for optimization.
Important
- Custom K6 binary with Diameter support: Grafana k6 lacks native support for the Diameter protocol. Enabling Diameter protocol functionality requires the creation of a custom k6 binary utilizing the xk6 extension, alongside integration with the xk6-diameter extension. This tailored approach empowers k6 to effectively simulate Diameter Credit-Control Applications.
To achieve this, simply follow the steps outlined in the Installation section.
-
Go installed: At least version 1.17 is needed.
-
Diameter Credit-Control Application Server: You'll need access to a Diameter Credit-Control Application server to perform the tests. This could be either an actual production server or a mock server set up specifically for testing purposes.
go install go.k6.io/xk6/cmd/xk6@latest
This will install the xk6
binary in your $GOPATH/bin
directory.
If you're getting a command not found
error when trying to run xk6
, make sure that you precisely follow the Go installation instructions for your platform.
Specifically, ensure that the $GOPATH/bin
directory is part of your $PATH
. For example, you might want to add this to your shell's initialization file: export PATH=$(go env GOPATH)/bin:$PATH
. See this article for more information.
Make sure you are in the root project directory and execute the following command:
xk6 build --with github.com/matrixxsoftware/xk6-diameter --output ./bin/k6
-
Configure the Script: Before executing the script, ensure to adjust the
const options
in the main.js andget object of cfg SharedArray
in the config.js to match your testing environment and requirements. This includes specifying the target URL of your Diameter Credit-Control Application server and any other relevant parameters for the load test. -
Run the Test: Make sure you are in the root project directory and execute the run.sh script.
./run.sh
Contributions are highly encouraged! If you have any suggestions for improvements or encounter any bugs, please feel free to open an issue or submit a pull request.
This project is licensed under the GNU General Public License v3.0. For more information, refer to the LICENSE
file.
The developers of @grafana/k6 and the @MATRIXXSoftware/xk6-diameter for their invaluable contributions to the open-source community.
For any inquiries or support, please contact [email protected]