mirror of
https://github.com/codeflash-ai/codeflash-agent.git
synced 2026-05-04 18:25:19 +00:00
Update engagement_report.py
This commit is contained in:
parent
87a906e704
commit
49a7d586d4
1 changed files with 317 additions and 0 deletions
|
|
@ -706,6 +706,323 @@ def build_exec_view():
|
|||
],
|
||||
marginTop="20px",
|
||||
),
|
||||
# ── Infrastructure Cost Impact ──
|
||||
section(
|
||||
"Infrastructure Cost Impact",
|
||||
"AKS node packing analysis based on current production topology.",
|
||||
),
|
||||
card(
|
||||
[
|
||||
html.P(
|
||||
[
|
||||
"Production runs on ",
|
||||
html.Span(
|
||||
"Standard_D48s_v5",
|
||||
style={"fontWeight": "700", "color": SLATE},
|
||||
),
|
||||
" nodes (48 vCPU, 192 GB RAM) at ",
|
||||
html.Span(
|
||||
"$2.304/hr ($1,682/mo)",
|
||||
style={
|
||||
"fontWeight": "700",
|
||||
"color": ACCENT,
|
||||
"fontFamily": MONO,
|
||||
},
|
||||
),
|
||||
" per node. Each core-product pod requests ",
|
||||
html.Span(
|
||||
"1 CPU / 32 GB RAM",
|
||||
style={"fontWeight": "700", "color": SLATE},
|
||||
),
|
||||
" behind Knative.",
|
||||
],
|
||||
style={
|
||||
"color": GRAY,
|
||||
"fontSize": "15px",
|
||||
"lineHeight": "1.7",
|
||||
"margin": "0 0 20px",
|
||||
},
|
||||
),
|
||||
html.Div(
|
||||
style={
|
||||
"display": "flex",
|
||||
"gap": "20px",
|
||||
"flexWrap": "wrap",
|
||||
"marginBottom": "20px",
|
||||
},
|
||||
children=[
|
||||
html.Div(
|
||||
[
|
||||
html.Div(
|
||||
"BEFORE",
|
||||
style={
|
||||
"fontSize": "11px",
|
||||
"fontWeight": "700",
|
||||
"color": RED,
|
||||
"letterSpacing": "0.1em",
|
||||
"marginBottom": "12px",
|
||||
},
|
||||
),
|
||||
html.Div(
|
||||
"5 pods / node",
|
||||
style={
|
||||
"fontSize": "28px",
|
||||
"fontWeight": "800",
|
||||
"color": SLATE,
|
||||
"lineHeight": "1",
|
||||
},
|
||||
),
|
||||
html.Div(
|
||||
"RAM is the bottleneck",
|
||||
style={
|
||||
"fontSize": "13px",
|
||||
"color": GRAY,
|
||||
"marginTop": "8px",
|
||||
},
|
||||
),
|
||||
html.Div(
|
||||
[
|
||||
html.Div(
|
||||
"11% CPU utilization — 41 vCPU idle",
|
||||
style={
|
||||
"color": RED,
|
||||
"fontSize": "13px",
|
||||
"marginBottom": "2px",
|
||||
},
|
||||
),
|
||||
html.Div(
|
||||
"$336/mo effective cost per pod",
|
||||
style={
|
||||
"color": GRAY,
|
||||
"fontSize": "13px",
|
||||
"fontFamily": MONO,
|
||||
},
|
||||
),
|
||||
],
|
||||
style={
|
||||
"marginTop": "12px",
|
||||
"paddingTop": "12px",
|
||||
"borderTop": f"1px solid {CARD_BORDER}",
|
||||
},
|
||||
),
|
||||
],
|
||||
style={
|
||||
"background": CARD_BG,
|
||||
"borderRadius": "12px",
|
||||
"padding": "20px 24px",
|
||||
"border": f"1px solid {CARD_BORDER}",
|
||||
"borderTop": f"3px solid {RED}",
|
||||
"flex": "1",
|
||||
"minWidth": "240px",
|
||||
},
|
||||
),
|
||||
html.Div(
|
||||
"\u2192",
|
||||
style={
|
||||
"fontSize": "32px",
|
||||
"color": GRAY,
|
||||
"alignSelf": "center",
|
||||
"padding": "0 4px",
|
||||
},
|
||||
),
|
||||
html.Div(
|
||||
[
|
||||
html.Div(
|
||||
"AFTER",
|
||||
style={
|
||||
"fontSize": "11px",
|
||||
"fontWeight": "700",
|
||||
"color": GREEN,
|
||||
"letterSpacing": "0.1em",
|
||||
"marginBottom": "12px",
|
||||
},
|
||||
),
|
||||
html.Div(
|
||||
"46 pods / node",
|
||||
style={
|
||||
"fontSize": "28px",
|
||||
"fontWeight": "800",
|
||||
"color": GREEN,
|
||||
"lineHeight": "1",
|
||||
},
|
||||
),
|
||||
html.Div(
|
||||
"CPU becomes the bottleneck",
|
||||
style={
|
||||
"fontSize": "13px",
|
||||
"color": GRAY,
|
||||
"marginTop": "8px",
|
||||
},
|
||||
),
|
||||
html.Div(
|
||||
[
|
||||
html.Div(
|
||||
"9.2x pod density improvement",
|
||||
style={
|
||||
"color": GREEN,
|
||||
"fontSize": "13px",
|
||||
"fontWeight": "600",
|
||||
"marginBottom": "2px",
|
||||
},
|
||||
),
|
||||
html.Div(
|
||||
"$37/mo effective cost per pod",
|
||||
style={
|
||||
"color": SLATE,
|
||||
"fontSize": "13px",
|
||||
"fontFamily": MONO,
|
||||
},
|
||||
),
|
||||
],
|
||||
style={
|
||||
"marginTop": "12px",
|
||||
"paddingTop": "12px",
|
||||
"borderTop": f"1px solid {CARD_BORDER}",
|
||||
},
|
||||
),
|
||||
],
|
||||
style={
|
||||
"background": CARD_BG,
|
||||
"borderRadius": "12px",
|
||||
"padding": "20px 24px",
|
||||
"border": f"1px solid {CARD_BORDER}",
|
||||
"borderTop": f"3px solid {GREEN}",
|
||||
"flex": "1",
|
||||
"minWidth": "240px",
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
html.P(
|
||||
"At 32 GB per pod, RAM fills the node after 5 pods — leaving 89% of the CPU idle. "
|
||||
"At 4 GB per pod, CPU becomes the constraint and the full node is utilized.",
|
||||
style={
|
||||
"color": GRAY,
|
||||
"fontSize": "14px",
|
||||
"lineHeight": "1.6",
|
||||
"margin": "0 0 16px",
|
||||
},
|
||||
),
|
||||
# Scale table
|
||||
html.Div(
|
||||
style={
|
||||
"borderRadius": "12px",
|
||||
"overflow": "hidden",
|
||||
"border": f"1px solid {CARD_BORDER}",
|
||||
},
|
||||
children=[
|
||||
html.Table(
|
||||
[
|
||||
html.Thead(
|
||||
html.Tr(
|
||||
[
|
||||
html.Th(
|
||||
h,
|
||||
style={
|
||||
"padding": "10px 16px",
|
||||
"fontSize": "12px",
|
||||
"fontWeight": "700",
|
||||
"color": ACCENT,
|
||||
"textTransform": "uppercase",
|
||||
"letterSpacing": "0.05em",
|
||||
"textAlign": "right"
|
||||
if i > 0
|
||||
else "left",
|
||||
"backgroundColor": "rgba(24,24,27,0.8)",
|
||||
"borderBottom": f"1px solid {CARD_BORDER}",
|
||||
},
|
||||
)
|
||||
for i, h in enumerate(
|
||||
[
|
||||
"Scale",
|
||||
"Before",
|
||||
"After",
|
||||
"Monthly Savings",
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
),
|
||||
html.Tbody(
|
||||
[
|
||||
html.Tr(
|
||||
[
|
||||
html.Td(
|
||||
f"{pods} pods",
|
||||
style={
|
||||
"padding": "10px 16px",
|
||||
"fontSize": "13px",
|
||||
"color": SLATE,
|
||||
"fontWeight": "600",
|
||||
},
|
||||
),
|
||||
html.Td(
|
||||
f"{nodes_b} nodes (${cost_b:,.0f}/mo)",
|
||||
style={
|
||||
"padding": "10px 16px",
|
||||
"fontSize": "13px",
|
||||
"color": GRAY,
|
||||
"fontFamily": MONO,
|
||||
"textAlign": "right",
|
||||
},
|
||||
),
|
||||
html.Td(
|
||||
f"{nodes_a} node{'s' if nodes_a > 1 else ''} (${cost_a:,.0f}/mo)",
|
||||
style={
|
||||
"padding": "10px 16px",
|
||||
"fontSize": "13px",
|
||||
"color": SLATE,
|
||||
"fontFamily": MONO,
|
||||
"textAlign": "right",
|
||||
},
|
||||
),
|
||||
html.Td(
|
||||
f"${saving:,.0f}/mo",
|
||||
style={
|
||||
"padding": "10px 16px",
|
||||
"fontSize": "13px",
|
||||
"fontWeight": "700",
|
||||
"color": GREEN,
|
||||
"fontFamily": MONO,
|
||||
"textAlign": "right",
|
||||
},
|
||||
),
|
||||
],
|
||||
style={
|
||||
"backgroundColor": "rgba(31,31,35,0.6)"
|
||||
if idx % 2
|
||||
else "rgba(24,24,27,0.5)",
|
||||
},
|
||||
)
|
||||
for idx, (pods, nodes_b, cost_b, nodes_a, cost_a, saving) in enumerate(
|
||||
[
|
||||
(10, 2, 3364, 1, 1682, 1682),
|
||||
(20, 4, 6728, 1, 1682, 5046),
|
||||
(50, 10, 16819, 2, 3364, 13455),
|
||||
(100, 20, 33638, 3, 5046, 28593),
|
||||
]
|
||||
)
|
||||
]
|
||||
),
|
||||
],
|
||||
style={
|
||||
"width": "100%",
|
||||
"borderCollapse": "collapse",
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
html.P(
|
||||
"Based on Azure retail pricing for Standard_D48s_v5 in US East ($2.304/hr). "
|
||||
"Assumes ~46 usable vCPU and ~186 GB usable RAM per node after AKS system reservations.",
|
||||
style={
|
||||
"color": LIGHT_GRAY,
|
||||
"fontSize": "12px",
|
||||
"marginTop": "12px",
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
section(
|
||||
"How This Was Tested",
|
||||
"Reproducible A/B benchmark on identical hardware with controlled conditions.",
|
||||
|
|
|
|||
Loading…
Reference in a new issue