df_pod = pd.read_parquet(p1)
df_ns = pd.read_parquet(p2)
df_daily_ns = pd.read_parquet(p3)
if 'cluster' not in df_pod.columns:
df_pod['cluster'] = infra_tag
if 'cluster' not in df_daily_ns.columns:
df_daily_ns['cluster'] = infra_tag
if "pv_used_p95" not in df_pod.columns:
if "pv_usage_p95" in df_pod.columns:
df_pod["pv_used_p95"] = df_pod["pv_usage_p95"]
else:
df_pod["pv_used_p95"] = 0.0
if "pv_capacity_max" not in df_pod.columns:
df_pod["pv_capacity_max"] = 0.0
if "minutes_running" not in df_pod.columns:
for alt_col in ["duration_minutes", "running_minutes", "duration"]:
if alt_col in df_pod.columns:
df_pod["minutes_running"] = df_pod[alt_col]
break
else:
df_pod["minutes_running"] = 0
if "mem_allocated_gb_hours" not in df_pod.columns:
for alt_col in ["mem_alloc_gb_hours", "mem_alloc_gh", "memory_allocated_gb_hours"]:
if alt_col in df_pod.columns:
df_pod["mem_allocated_gb_hours"] = df_pod[alt_col]
break
if "pv_allocated_gb_hours" not in df_pod.columns:
for alt_col in ["pv_alloc_gb_hours", "pv_alloc_gh", "pv_capacity_gb_hours", "pv_capacity_max"]:
if alt_col in df_pod.columns:
df_pod["pv_allocated_gb_hours"] = df_pod[alt_col]
break
excel_name = f"res_usage_report_{infra_tag.lower()}_{date_tag}.xlsx"