paths.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. import os
  10. from pathlib import Path
  11. from materialize import MZ_ROOT
  12. RESULTS_DIR = MZ_ROOT / "test" / "scalability" / "results"
  13. def endpoint_dir(endpoint_name: str) -> Path:
  14. return RESULTS_DIR / endpoint_name
  15. def df_totals_csv(endpoint_name: str, workload_name: str) -> Path:
  16. return RESULTS_DIR / endpoint_name / f"{workload_name}.csv"
  17. def workloads_csv() -> Path:
  18. return RESULTS_DIR / "workloads.csv"
  19. def df_details_csv(endpoint_name: str, workload_name: str) -> Path:
  20. return RESULTS_DIR / endpoint_name / f"{workload_name}_details.csv"
  21. def regressions_csv() -> Path:
  22. return RESULTS_DIR / "regressions.csv"
  23. def significant_improvements_csv() -> Path:
  24. return RESULTS_DIR / "improvements.csv"
  25. def results_csv(endpoint_name: str) -> Path:
  26. return RESULTS_DIR / Path(endpoint_name) / "results.csv"
  27. def plot_dir() -> Path:
  28. return RESULTS_DIR / "plots"
  29. def plot_png(plot_type: str, workload_name: str) -> Path:
  30. return plot_dir() / f"{plot_type}_{workload_name}.png"
  31. def get_endpoint_names_from_results_dir() -> list[str]:
  32. directories = next(os.walk(RESULTS_DIR))[1]
  33. endpoints = [entry for entry in directories if not entry.startswith(".")]
  34. return endpoints