Skip to content

Commit

Permalink
adding more generic way of comparing with working ingress
Browse files Browse the repository at this point in the history
Signed-off-by: Paige Rubendall <[email protected]>
  • Loading branch information
paigerube14 committed Jan 30, 2024
1 parent 212c5f3 commit 8f7f270
Showing 1 changed file with 39 additions and 26 deletions.
65 changes: 39 additions & 26 deletions orion.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,47 +59,60 @@ def orion(config, debug, output):
if len(uuids) == 0:
print("No UUID present for given metadata")
sys.exit()

runs = match.match_kube_burner(uuids)
ids = match.filter_runs(runs, runs)

metrics = test["metrics"]
dataframe_list = []
if metadata["benchmark"] == "k8s-netperf" :
index = "k8s-netperf"
ids = uuids
elif metadata["benchmark"] == "ingress-perf" :
index = "ingress-performance"
ids = uuids
else:
index = "ripsaw-kube-burner"
runs = match.match_kube_burner(uuids)
ids = match.filter_runs(runs, runs)

for metric in metrics:
logger.info("Collecting %s", metric["metric"])
if metric["metricType"] == "latency":
if metric["metric"] == "podReadyLatency":
try:
podl = match.burner_results("", ids, "ripsaw-kube-burner*")
podl_df = match.convert_to_df(
podl, columns=["uuid", "timestamp", "P99"]
)
dataframe_list.append(podl_df)
logger.debug(podl_df)
except Exception as e: # pylint: disable=broad-exception-caught
logger.error(
"The namespace %s does not exist, exception %s",
metric["namespace"],
e,
)

elif metric["metricType"] == "cpu":
metric_of_interest = metric['metric_of_interest']
metric_name = metric['metric']
metric.pop("metric")
if "agg" in metric.keys():
try:
cpu = match.burner_cpu_results(
ids, metric["namespace"], "ripsaw-kube-burner*"
cpu = match.get_agg_metric_query(
ids, index, metric
)
cpu_df = match.convert_to_df(cpu, columns=["uuid", "cpu_avg"])
agg_value = metric['agg']['value']
agg_type = metric['agg']['agg_type']
agg_name = agg_value + "_" + agg_type
cpu_df = match.convert_to_df(cpu, columns=["uuid", agg_name])
cpu_df = cpu_df.rename(
columns={"cpu_avg": metric["metric"] + "_cpu_avg"}
columns={agg_name: metric_name+ "_" + agg_name}
)
dataframe_list.append(cpu_df)
logger.debug(cpu_df)

except Exception as e: # pylint: disable=broad-exception-caught
logger.error(
"The namespace %s does not exist, exception %s",
metric["namespace"],
"Couldn't get agg metrics %s, exception %s",
metric_name,
e,
)
else:
try:
podl = match.getResults("", ids, index, metric)
podl_df = match.convert_to_df(
podl, columns=["uuid", "timestamp", metric_of_interest]
)
dataframe_list.append(podl_df)
logger.debug(podl_df)
except Exception as e: # pylint: disable=broad-exception-caught
logger.error(
"Couldn't get metrics %s, exception %s",
metric_name,
e,
)

merged_df = reduce(
lambda left, right: pd.merge(left, right, on="uuid", how="inner"),
Expand Down

0 comments on commit 8f7f270

Please sign in to comment.