fix(metrics): standardize numeric parsing to Number.parseFloat/parseInt and fix unique_models mapping

Co-authored-by: Genie <genie@cosine.sh>
This commit is contained in:
Praveen Thirumurugan
2025-12-27 20:29:45 +00:00
committed by Genie
parent eeebf1c6e9
commit 946a5a6425
4 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -42,8 +42,8 @@ export default function ModelBreakdown({ models }: ModelBreakdownProps) {
</td>
<td style={styles.td}>{Number.parseInt(model.request_count).toLocaleString()}</td>
<td style={styles.td}>{Number.parseInt(model.total_tokens).toLocaleString()}</td>
<td style={styles.td}>${parseFloat(model.total_cost).toFixed(4)}</td>
<td style={styles.td}>{Math.round(parseFloat(model.avg_response_time))}ms</td>
<td style={styles.td}>${Number.parseFloat(model.total_cost).toFixed(4)}</td>
<td style={styles.td}>{Math.round(Number.parseFloat(model.avg_response_time))}ms</td>
</tr>
))}
</tbody>
+1 -1
View File
@@ -60,7 +60,7 @@ export default function RecentRequests({ requests }: RecentRequestsProps) {
</small>
</div>
</td>
<td style={styles.td}>${parseFloat(req.total_cost).toFixed(4)}</td>
<td style={styles.td}>${Number.parseFloat(req.total_cost).toFixed(4)}</td>
<td style={styles.td}>{req.response_time}ms</td>
<td style={styles.td}>
<span
+2 -2
View File
@@ -41,8 +41,8 @@ export default function TrendsChart({ trends }: TrendsChartProps) {
}),
requests: Number.parseInt(trend.requests),
tokens: Number.parseInt(trend.tokens),
cost: parseFloat(trend.cost),
responseTime: Math.round(parseFloat(trend.avg_response_time)),
cost: Number.parseFloat(trend.cost),
responseTime: Math.round(Number.parseFloat(trend.avg_response_time)),
}));
return (