mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
Time taken column logs (#11723)
* Time taken column logs * Reanme and details * Add detail row
This commit is contained in:
parent
16a5f36441
commit
22460a73f9
2 changed files with 15 additions and 0 deletions
|
|
@ -46,6 +46,7 @@ export type LogEntry = {
|
|||
proxy_server_request?: string | any[] | Record<string, any>;
|
||||
session_id?: string;
|
||||
status?: string;
|
||||
duration?: number;
|
||||
onKeyHashClick?: (keyHash: string) => void;
|
||||
onSessionClick?: (sessionId: string) => void;
|
||||
};
|
||||
|
|
@ -160,6 +161,15 @@ export const columns: ColumnDef<LogEntry>[] = [
|
|||
<span>${Number(info.getValue() || 0).toFixed(6)}</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
header: "Duration",
|
||||
accessorKey: "duration",
|
||||
cell: (info: any) => (
|
||||
<Tooltip title={String(info.getValue() || "-")}>
|
||||
<span className="max-w-[15ch] truncate block">{String(info.getValue() || "-")}</span>
|
||||
</Tooltip>
|
||||
),
|
||||
},
|
||||
{
|
||||
header: "Team Name",
|
||||
accessorKey: "metadata.user_api_key_team_alias",
|
||||
|
|
|
|||
|
|
@ -369,6 +369,7 @@ export default function SpendLogsTable({
|
|||
|
||||
}).map(log => ({
|
||||
...log,
|
||||
duration: (Date.parse(log.endTime) - Date.parse(log.startTime)) / 1000,
|
||||
onKeyHashClick: (keyHash: string) => setSelectedKeyIdInfoView(keyHash),
|
||||
onSessionClick: (sessionId: string) => {
|
||||
if (sessionId) setSelectedSessionId(sessionId);
|
||||
|
|
@ -931,6 +932,10 @@ export function RequestViewer({ row }: { row: Row<LogEntry> }) {
|
|||
<span className="font-medium w-1/3">End Time:</span>
|
||||
<span>{row.original.endTime}</span>
|
||||
</div>
|
||||
<div className="flex">
|
||||
<span className="font-medium w-1/3">Duration:</span>
|
||||
<span>{row.original.duration} s.</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue