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)