Skip to content

Commit

Permalink
feat(sessions): add trace latency percentiles to ui table (#5482)
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerHYang committed Nov 25, 2024
1 parent 8b5591e commit f180329
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 9 deletions.
27 changes: 27 additions & 0 deletions app/src/pages/project/SessionsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { Icon, Icons, View } from "@arizeai/components";

import { selectableTableCSS } from "@phoenix/components/table/styles";
import { TimestampCell } from "@phoenix/components/table/TimestampCell";
import { LatencyText } from "@phoenix/components/trace/LatencyText";
import { useStreamState } from "@phoenix/contexts/StreamStateContext";
import { useTracingContext } from "@phoenix/contexts/TracingContext";

Expand Down Expand Up @@ -93,6 +94,8 @@ export function SessionsTable(props: SessionsTableProps) {
completion
total
}
traceLatencyMsP50: traceLatencyMsQuantile(probability: 0.5)
traceLatencyMsP99: traceLatencyMsQuantile(probability: 0.99)
}
}
}
Expand Down Expand Up @@ -138,6 +141,30 @@ export function SessionsTable(props: SessionsTableProps) {
enableSorting: true,
cell: TimestampCell,
},
{
header: "p50 latency",
accessorKey: "traceLatencyMsP50",
enableSorting: false,
cell: ({ getValue }) => {
const value = getValue();
if (value === null || typeof value !== "number") {
return null;
}
return <LatencyText latencyMs={value} />;
},
},
{
header: "p99 latency",
accessorKey: "traceLatencyMsP99",
enableSorting: false,
cell: ({ getValue }) => {
const value = getValue();
if (value === null || typeof value !== "number") {
return null;
}
return <LatencyText latencyMs={value} />;
},
},
{
header: "total tokens",
accessorKey: "tokenCountTotal",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 30 additions & 4 deletions app/src/pages/project/__generated__/SessionsTableQuery.graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f180329

Please sign in to comment.