Skip to content

Commit

Permalink
In case of connection error at end of benchmark. collect all logs and…
Browse files Browse the repository at this point in the history
… fail (#419)
  • Loading branch information
filipecosta90 authored Jul 20, 2023
1 parent 557109f commit 63cad39
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 60 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "redisbench-admin"
version = "0.10.15"
version = "0.10.16"
description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )."
authors = ["filipecosta90 <filipecosta.90@gmail.com>","Redis Performance Group <performance@redis.com>"]
readme = "README.md"
Expand Down
137 changes: 78 additions & 59 deletions redisbench_admin/run_remote/run_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,52 +768,30 @@ def run_remote_command_logic(args, project_name, project_version):
tf_github_branch, artifact_version
)
):
(
end_time_ms,
_,
overall_end_time_metrics,
) = collect_redis_metrics(
redis_conns,
["memory"],
{
"memory": [
"used_memory",
"used_memory_dataset",
]
},
)
if total_shards_cpu_usage is not None:
overall_end_time_metrics[
"total_shards_used_cpu_pct"
] = total_shards_cpu_usage
expire_ms = 7 * 24 * 60 * 60 * 1000
export_redis_metrics(
artifact_version,
end_time_ms,
overall_end_time_metrics,
rts,
setup_name,
setup_type,
test_name,
tf_github_branch,
tf_github_org,
tf_github_repo,
tf_triggering_env,
{"metric-type": "redis-metrics"},
expire_ms,
)
if collect_commandstats:
try:
(
end_time_ms,
_,
overall_commandstats_metrics,
overall_end_time_metrics,
) = collect_redis_metrics(
redis_conns, ["commandstats"]
redis_conns,
["memory"],
{
"memory": [
"used_memory",
"used_memory_dataset",
]
},
)
if total_shards_cpu_usage is not None:
overall_end_time_metrics[
"total_shards_used_cpu_pct"
] = total_shards_cpu_usage
expire_ms = 7 * 24 * 60 * 60 * 1000
export_redis_metrics(
artifact_version,
end_time_ms,
overall_commandstats_metrics,
overall_end_time_metrics,
rts,
setup_name,
setup_type,
Expand All @@ -822,30 +800,71 @@ def run_remote_command_logic(args, project_name, project_version):
tf_github_org,
tf_github_repo,
tf_triggering_env,
{"metric-type": "commandstats"},
{"metric-type": "redis-metrics"},
expire_ms,
)
(
end_time_ms,
_,
overall_commandstats_metrics,
) = collect_redis_metrics(
redis_conns, ["latencystats"]
if collect_commandstats:
(
end_time_ms,
_,
overall_commandstats_metrics,
) = collect_redis_metrics(
redis_conns, ["commandstats"]
)
export_redis_metrics(
artifact_version,
end_time_ms,
overall_commandstats_metrics,
rts,
setup_name,
setup_type,
test_name,
tf_github_branch,
tf_github_org,
tf_github_repo,
tf_triggering_env,
{"metric-type": "commandstats"},
expire_ms,
)
(
end_time_ms,
_,
overall_commandstats_metrics,
) = collect_redis_metrics(
redis_conns, ["latencystats"]
)
export_redis_metrics(
artifact_version,
end_time_ms,
overall_commandstats_metrics,
rts,
setup_name,
setup_type,
test_name,
tf_github_branch,
tf_github_org,
tf_github_repo,
tf_triggering_env,
{"metric-type": "latencystats"},
expire_ms,
)
except redis.exceptions.ConnectionError as e:
db_error_artifacts(
db_ssh_port,
dirname,
full_logfiles,
logname,
private_key,
s3_bucket_name,
s3_bucket_path,
server_public_ip,
temporary_dir,
args.upload_results_s3,
username,
)
export_redis_metrics(
artifact_version,
end_time_ms,
overall_commandstats_metrics,
rts,
setup_name,
setup_type,
test_name,
tf_github_branch,
tf_github_org,
tf_github_repo,
tf_triggering_env,
{"metric-type": "latencystats"},
expire_ms,
return_code |= 1
raise Exception(
"Failed to run remote benchmark."
)

if setup_details["env"] is None:
Expand Down

0 comments on commit 63cad39

Please sign in to comment.