Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
df013946
authored
Jun 18, 2026
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(performance): add compact formatting for latency and throughput metrics
parent
208d86e9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
web/default/src/features/pricing/components/model-perf-badge.tsx
+16
-7
No files found.
web/default/src/features/pricing/components/model-perf-badge.tsx
View file @
df013946
...
...
@@ -19,11 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
import
{
memo
}
from
'react'
import
{
useTranslation
}
from
'react-i18next'
import
{
cn
}
from
'@/lib/utils'
import
{
formatLatency
,
formatThroughput
,
getSuccessRateDotClass
,
}
from
'@/features/performance-metrics/lib/format'
import
{
getSuccessRateDotClass
}
from
'@/features/performance-metrics/lib/format'
export
type
ModelPerfBadgeData
=
{
avg_latency_ms
:
number
...
...
@@ -36,8 +32,21 @@ export interface ModelPerfBadgeProps extends React.HTMLAttributes<HTMLDivElement
perf
:
ModelPerfBadgeData
|
undefined
}
function
formatCompactNumber
(
value
:
number
):
string
{
if
(
!
Number
.
isFinite
(
value
)
||
value
<=
0
)
return
'—'
return
value
>
1
?
String
(
Math
.
round
(
value
))
:
value
.
toFixed
(
1
)
}
function
formatCompactLatency
(
ms
:
number
):
string
{
if
(
!
Number
.
isFinite
(
ms
)
||
ms
<=
0
)
return
'—'
if
(
ms
>=
1
_000
)
return
`
${
formatCompactNumber
(
ms
/
1
_000
)}
s`
return
`
${
formatCompactNumber
(
ms
)}
ms`
}
function
formatCompactThroughput
(
tps
:
number
):
string
{
return
formatThroughput
(
tps
).
replace
(
' t/s'
,
'tps'
)
if
(
!
Number
.
isFinite
(
tps
)
||
tps
<=
0
)
return
'—'
if
(
tps
>=
1
_000
)
return
`
${
formatCompactNumber
(
tps
/
1
_000
)}
Ktps`
return
`
${
formatCompactNumber
(
tps
)}
tps`
}
export
const
ModelPerfBadge
=
memo
(
function
ModelPerfBadge
(
...
...
@@ -73,7 +82,7 @@ export const ModelPerfBadge = memo(function ModelPerfBadge(
{
t
(
'Latency short'
)
}
</
div
>
<
div
className=
'text-muted-foreground/80 font-mono text-xs leading-4 whitespace-nowrap'
>
{
avg_latency_ms
>
0
?
formatLatency
(
avg_latency_ms
)
:
'—'
}
{
formatCompactLatency
(
avg_latency_ms
)
}
</
div
>
</
div
>
<
div
title=
{
t
(
'Throughput'
)
}
className=
'min-w-0'
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment