From a80109cdcfa9ed10dbdb4c2f54806108524c9238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=AF=BC=ED=97=8C?= Date: Thu, 9 Jul 2026 15:34:57 +0900 Subject: [PATCH] =?UTF-8?q?chore(lps):=20FE=20=EC=9B=90=EA=B0=80=20?= =?UTF-8?q?=ED=83=80=EC=9D=BC=20AI/DECODO=20=EB=B9=84=EC=9A=A9=20=EB=B6=84?= =?UTF-8?q?=ED=95=B4=20+=20config=20example=20cost=5Fper=5Fgb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 임시 FE: 총 비용 타일에 AI·DECODO 분해, 크롤 트래픽에 프록시 경유 바이트(과금분) - config.local.toml.example: DecodoConfig.cost_per_gb 안내 Co-Authored-By: Claude Fable 5 --- lps-temp-fe/index.html | 13 +++++++------ lps/config/config.local.toml.example | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lps-temp-fe/index.html b/lps-temp-fe/index.html index 8edb040..fb07459 100644 --- a/lps-temp-fe/index.html +++ b/lps-temp-fe/index.html @@ -511,17 +511,18 @@ function renderJob(d, submitted){ // 검색 원가 계측(리소스/비용/시간) const mt=o.metrics; if(mt){ - const kb=(mt.crawl?.html_bytes||0)/1024; - const kbTxt = kb>=1024 ? (kb/1024).toFixed(1)+" MB" : Math.round(kb)+" KB"; - const cost=mt.ai?.est_cost_usd||0; + const fmtBytes=b=>{const kb=(b||0)/1024; return kb>=1024?(kb/1024).toFixed(1)+" MB":Math.round(kb)+" KB";}; + const c=mt.cost||{}; const total=c.total_usd??(mt.ai?.est_cost_usd||0); + const fc=v=>"$"+(v||0).toFixed((v||0)<0.01?6:4); const srcMs=mt.source_ms||{}; const srcTxt=Object.entries(srcMs).map(([s,ms])=>`${(SRC[s]||{}).label||s} ${(ms/1000).toFixed(1)}s`).join(" · "); + const crawledTxt=(mt.crawl?.malls_crawled||[]).length?' · 크롤 '+mt.crawl.malls_crawled.map(s=>(SRC[s]||{}).label||s).join(','):''; html += `
검색 원가 이 검색 1건이 쓴 리소스·비용·시간
소요 시간
${(mt.duration_ms/1000).toFixed(1)}s
${srcTxt?`
${esc(srcTxt.length>34?srcTxt.slice(0,34)+'…':srcTxt)}
`:``}
-
AI 비용
$${cost.toFixed(cost<0.01?6:4)}
${mt.ai?.calls||0}회 호출
-
AI 토큰
${won((mt.ai?.prompt_tokens||0)+(mt.ai?.completion_tokens||0))}
in ${won(mt.ai?.prompt_tokens||0)} / out ${won(mt.ai?.completion_tokens||0)}
-
크롤 트래픽
${kbTxt}
${mt.crawl?.fetches||0} fetch${(mt.crawl?.malls_crawled||[]).length?' · 크롤 '+mt.crawl.malls_crawled.map(s=>(SRC[s]||{}).label||s).join(','):''}
+
총 비용
${fc(total)}
AI ${fc(c.ai_usd)} · DECODO ${fc(c.proxy_usd)}
+
AI 토큰
${won((mt.ai?.prompt_tokens||0)+(mt.ai?.completion_tokens||0))}
${mt.ai?.calls||0}회 · in ${won(mt.ai?.prompt_tokens||0)}/out ${won(mt.ai?.completion_tokens||0)}
+
크롤 트래픽
${fmtBytes(mt.crawl?.html_bytes)}
${mt.crawl?.fetches||0} fetch · 프록시 ${fmtBytes(mt.crawl?.proxy_bytes)}${crawledTxt}
`; } diff --git a/lps/config/config.local.toml.example b/lps/config/config.local.toml.example index 4be22df..de6f428 100644 --- a/lps/config/config.local.toml.example +++ b/lps/config/config.local.toml.example @@ -58,3 +58,4 @@ password = "" # 대시보드 PASSWORD port_start = 0 # 예: 10001 port_end = 0 # 예: 10010 session_minutes = 10 # 대시보드 Sticky 지속시간(분)과 일치 +cost_per_gb = 0.0 # DECODO 요금($/GB) — 검색 원가의 대역폭 비용 산정용(플랜에 맞게, 예 3.0)