usageAnalytics
modelMetrics
realtimeMetrics
realtimeMetrics: {
currentRequests: number;
requestsPerMinute: number;
averageResponseTime: number;
errorRate: number;
costPerHour: number;
}
getHistoricalData
getHistoricalData: (period: "hour" | "day" | "week" | "month") => Promise<any>
getTrendAnalysis
getTrendAnalysis: (metric: string, period: string) => Promise<any>
getComparativeAnalysis
getComparativeAnalysis: (modelIds: string[], period: string) => Promise<any>
getCostBreakdown
getCostBreakdown: () => {
total: number;
byModel: Record<string, number>;
byHour: { hour: string; cost: number }[];
projectedMonthly: number;
}
getCostOptimizationReport
getCostOptimizationReport: () => Promise<
{
currentSpend: number;
optimizedSpend: number;
savings: number;
recommendations: { action: string; impact: number; effort: string }[];
},
>
getPerformanceReport: () => {
modelRankings: { modelId: string; score: number; metrics: any }[];
bottlenecks: string[];
recommendations: string[];
}
exportMetrics
exportMetrics: (
format: "json" | "csv" | "xlsx",
filters?: any,
) => Promise<string | Blob>
generateDashboard
generateDashboard: () => Promise<
{ chartData: any[]; summary: any; alerts: any[] },
>
startRealTimeMonitoring
startRealTimeMonitoring: () => void
stopRealTimeMonitoring
stopRealTimeMonitoring: () => void
isMonitoring
isMonitoring: boolean
setAlert
setAlert: (
type: string,
threshold: number,
callback: (data: any) => void,
) => string
removeAlert
removeAlert: (alertId: string) => void
activeAlerts
activeAlerts: {
id: string;
type: string;
message: string;
timestamp: Date;
severity: "error" | "warning" | "info";
}[]
config
updateConfig
clearMetrics
clearMetrics: (olderThan?: Date) => void
refreshMetrics
refreshMetrics: () => Promise<void>