Skip to content

Commit

Permalink
Merge pull request #2157 from Agenta-AI/AGE-1178/wrong-latency-shown-…
Browse files Browse the repository at this point in the history
…in-table-and-drawer

(frontend)[Age 1178]Wrong latency shown in table and drawer
  • Loading branch information
mmabrouk authored Nov 3, 2024
2 parents 8241e23 + 50eaa35 commit 3bc8152
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ const TraceContent = ({activeTrace}: TraceContentProps) => {
value1={
<>
<Timer size={14} />{" "}
{formatLatency(activeTrace?.metrics?.acc?.duration.total)}
{formatLatency(activeTrace?.metrics?.acc?.duration.total / 1000)}
</>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const TreeContent = ({value}: {value: _AgentaRootsResponse}) => {
<Space className={classes.treeContent}>
<div>
<Timer />
{formatLatency(metrics?.acc?.duration.total)}
{formatLatency(metrics?.acc?.duration.total / 1000)}
</div>

{metrics?.acc?.costs?.total && (
Expand Down
2 changes: 1 addition & 1 deletion agenta-web/src/lib/helpers/formatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const formatLatency = (value: number | undefined | null) => {
const MS_LIMIT = 1000
const S_LIMIT = MS_LIMIT * 1000
const S_TO_US = S_LIMIT
const DECIMAL_DIGITS = 1000 // 3 digits
const DECIMAL_DIGITS = 100 // 2 decimal places

let value = v * S_TO_US
let unit = "us"
Expand Down
4 changes: 3 additions & 1 deletion agenta-web/src/pages/apps/[app_id]/observability/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ const ObservabilityDashboard = ({}: Props) => {
onHeaderCell: () => ({
style: {minWidth: 80},
}),
render: (_, record) => <div>{formatLatency(record?.metrics?.acc?.duration.total)}</div>,
render: (_, record) => (
<div>{formatLatency(record?.metrics?.acc?.duration.total / 1000)}</div>
),
},
{
title: "Usage",
Expand Down

0 comments on commit 3bc8152

Please sign in to comment.