From 74e8fdb46465626117236cc877eee8d35645134b Mon Sep 17 00:00:00 2001 From: Nicolas Ruflin Date: Mon, 22 Jan 2024 09:50:53 +0100 Subject: [PATCH] List packages with benchmarks For someone to run benchmarks or ingest sample data it is currently not easy to find the packages that have templates for benchmarks available. This is a quick POC on how the list of integrations with benchmarks can be generated. Some ideas on how this could be used: * Add the list to the docs page around streaming data. Downside is that it needs to be manually (or automatically) updated from time to time * Add some command to elastic-package to list the packages with templates * Other ideas? The current output of the script looks as following: ``` python list_benchmark_packages.py Package: nginx * stubstatus-benchmark * error-benchmark Package: mysql * performance-benchmark Package: aws * sqs-benchmark * ec2metrics-benchmark * billing-benchmark * ec2logs-benchmark Package: kubernetes * container-benchmark * pod-benchmark --- scripts/list_benchmark_packages.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 scripts/list_benchmark_packages.py diff --git a/scripts/list_benchmark_packages.py b/scripts/list_benchmark_packages.py new file mode 100644 index 0000000000..5f4ced6c46 --- /dev/null +++ b/scripts/list_benchmark_packages.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +import os + +integrations_repo_path = "../../integrations" +packages_path = os.path.join(integrations_repo_path, "packages") + +# Iterate through all packages +for package_path in os.listdir(packages_path): + + rally_path = os.path.join(packages_path, package_path, "_dev", "benchmark", "rally") + + # Find packages with a rally directory + if os.path.isdir(rally_path): + print("Package: " + package_path) + + benchmarks = os.listdir(rally_path) + # List benchmarks + for b in benchmarks: + if not os.path.isdir(os.path.join(rally_path, b)): + continue + print("* " + b + "") + + print("")