print("⏳ [Boxplot 엔지니어링] 워크로드별 CPU/MEM 활용 분포 및 Outlier 트래킹 중...")
plt.figure(figsize=(11, 5))
sns.boxplot(
data=df_pod,
x="workload_type",
y="cpu_util",
palette="Set3",
showmeans=True,
meanprops={"marker":"^", "markerfacecolor":"green", "markeredgecolor":"green"},
flierprops={"marker":"X", "markerfacecolor":"red", "markeredgecolor":"red", "markersize":6}
)
plt.xticks(rotation=30, ha="right")
plt.ylim(-5, 105)
plt.title("CPU Utilization P95 Boxplot & Outliers by Workload Type")
plt.xlabel("Workload Type")
plt.ylabel("P95 Actual Utilization (%)")
plt.tight_layout()
plt.savefig(PLOT_DIR / "chart9_boxplot_cpu_util_by_workload.png", dpi=100)
plt.close()
plt.figure(figsize=(11, 5))
sns.boxplot(
data=df_pod,
x="workload_type",
y="mem_util",
palette="Pastel1",
showmeans=True,
meanprops={"marker":"^", "markerfacecolor":"green", "markeredgecolor":"green"},
flierprops={"marker":"X", "markerfacecolor":"red", "markeredgecolor":"red", "markersize":6}
)
plt.xticks(rotation=30, ha="right")
plt.ylim(-5, 105)
plt.title("Memory Utilization P95 Boxplot & Outliers by Workload Type")
plt.xlabel("Workload Type")
plt.ylabel("P95 Actual Utilization (%)")
plt.tight_layout()
plt.savefig(PLOT_DIR / "chart10_boxplot_mem_util_by_workload.png", dpi=100)
plt.close()
===
def build_sheet_cpu(wb, df_pod, infra_tag):
end_row = apply_data_rows(ws, df_out[cols], start_row=3, num_formats={8:"0.00",9:"0.00",10:"0.00",11:"0.00",12:"0.0",13:"#,##0.0"}, status_col_idx=14)
set_col_widths(ws, {"A":12,"B":14,"C":16,"D":18,"E":16,"F":26,"G":14,"H":12,"I":12,"J":12,"K":14,"L":12,"M":14,"N":16})
freeze_and_filter(ws)
add_chart_image(ws, "chart1_cpu_req_vs_usage_by_workload.png", f"A{end_row+3}", w=800, h=380, label="[ Average CPU Request vs Peak Usage ]")
add_chart_image(ws, "chart9_boxplot_cpu_util_by_workload.png", f"A{end_row+24}", w=800, h=380, label="[ CPU Outliers & Distribution Boxplot ]")
def build_sheet_memory(wb, df_pod, infra_tag):
end_row = apply_data_rows(ws, df_out[cols], start_row=3, num_formats={8:"0.0",9:"0.0",10:"0.0",11:"0.0",12:"0.0",13:"#,##0",14:"0.0",15:"#,##0"}, status_col_idx=16)
set_col_widths(ws, {"A":12,"B":14,"C":16,"D":18,"E":16,"F":26,"G":14,"H":12,"I":12,"J":12,"K":12,"L":12,"M":14,"N":12,"O":12,"P":16})
freeze_and_filter(ws)
add_chart_image(ws, "chart2_mem_req_vs_usage_by_workload.png", f"A{end_row+3}", w=800, h=380, label="[ Average Memory Specs vs RSS Peak ]")
add_chart_image(ws, "chart10_boxplot_mem_util_by_workload.png", f"A{end_row+24}", w=800, h=380, label="[ Memory Outliers & Distribution Boxplot ]")