✨ feat: Add model performance metrics to dashboard
Add a shared `performance-metrics` feature module for perf metric APIs, DTOs, and formatting, then surface global 24h model performance on the dashboard with cards and a top-model table. Reuse the shared metrics module from pricing model details, remove duplicated perf API/formatting code from pricing, and add localized labels for the new dashboard performance UI.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { api } from '@/lib/api'
|
||||
import type { PerformanceMetricsData, PerfSummaryAllData } from './types'
|
||||
|
||||
export async function getPerfMetricsSummary(
|
||||
hours = 24
|
||||
): Promise<PerfSummaryAllData> {
|
||||
const res = await api.get<PerfSummaryAllData>('/api/perf-metrics/summary', {
|
||||
params: { hours },
|
||||
})
|
||||
return res.data
|
||||
}
|
||||
|
||||
export async function getPerfMetrics(
|
||||
modelName: string,
|
||||
hours = 24
|
||||
): Promise<PerformanceMetricsData> {
|
||||
const res = await api.get<PerformanceMetricsData>('/api/perf-metrics', {
|
||||
params: {
|
||||
model: modelName,
|
||||
hours,
|
||||
},
|
||||
})
|
||||
return res.data
|
||||
}
|
||||
Reference in New Issue
Block a user