Skip to content

Commit

Permalink
scalability framework: Jupyter fixes (#22537)
Browse files Browse the repository at this point in the history
  • Loading branch information
nrainer-materialize authored Oct 20, 2023
1 parent a6889c1 commit 41e031a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion misc/python/materialize/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def get_common_ancestor_commit(remote: str, branch: str, fetch_branch: bool) ->
def get_commit_message(commit_sha: str) -> str | None:
try:
command = ["git", "log", "-1", "--pretty=format:%s", commit_sha]
return spawn.capture(command).strip()
return spawn.capture(command, stderr=subprocess.DEVNULL).strip()
except subprocess.CalledProcessError:
# Sometimes mz_version() will report a Git SHA that is not available
# in the current repository
Expand Down
2 changes: 1 addition & 1 deletion misc/python/materialize/scalability/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,5 +164,5 @@ def endpoint_name_to_description(endpoint_name: str) -> str:
commit_sha = endpoint_name.split(" ")[1].strip("()")

# empty when mz_version() reports a Git SHA that is not available in the current repository
commit_message = git.get_commit_message(commit_sha)
commit_message = git.get_commit_message(commit_sha) or "unknown"
return f"{endpoint_name} - {commit_message}"
8 changes: 7 additions & 1 deletion test/scalability/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


def plotit(csv_file_name: str) -> None:
endpoints = next(os.walk(RESULTS_DIR))[1]
endpoints = get_endpoints_from_results_dir()
legend = []
plt.rcParams["figure.figsize"] = (16, 10)
fig, (summary_subplot, details_subplot) = plt.subplots(2, 1)
Expand All @@ -43,3 +43,9 @@ def plotit(csv_file_name: str) -> None:
details_subplot.set_ylabel("Latency in Seconds")
details_subplot.set_xlabel("Concurrent SQL Connections")
details_subplot.legend(legend)


def get_endpoints_from_results_dir() -> list[str]:
directories = next(os.walk(RESULTS_DIR))[1]
endpoints = [entry for entry in directories if not entry.startswith(".")]
return endpoints

0 comments on commit 41e031a

Please sign in to comment.