ODS V3 Pre-Release: Public testing and refinement ahead of the official V3 launch. Turn your PC, Mac, or Linux box into a private AI server.
Python ai-agentsamdcomfyuidockerllama-cppllmlocal-ain8nnvidiaopen-webuiragself-hostedspeech-to-textstrix-halotext-to-speechworkflow-automation
fix(dashboard): leave out the throughput tile until a rate exists (#8194)
Mike Bradley4bdf3190348b
diff --git a/ods/extensions/services/dashboard/src/pages/Dashboard.jsx b/ods/extensions/services/dashboard/src/pages/Dashboard.jsxindex 789441ccb..f0b997528 100644--- a/ods/extensions/services/dashboard/src/pages/Dashboard.jsx+++ b/ods/extensions/services/dashboard/src/pages/Dashboard.jsx@@ -646,7 +646,7 @@ function buildChartPoints(values, maxValue) {}function throughputLabel(inference, stale = false) {- if (!Number.isFinite(inference?.tokensPerSecond)) return 'Telemetry unavailable'+ if (!Number.isFinite(inference?.tokensPerSecond)) return 'Not reported'if (stale || inference?.throughputState === 'unavailable') return 'Last known rate · telemetry unavailable'if (inference?.throughputMode === 'cloud_request_average') return 'Last cloud request · includes latency'if (inference?.throughputState === 'retained') return 'Last run'@@ -906,13 +906,18 @@ export default function Dashboard({ status, loading, compact = false }) {})}- systemMetrics.push(- {+ // The API keeps a model's last measured rate. Until it has one (some native+ // engines never report it), the tile is left out rather than "unavailable".+ if (Number.isFinite(status?.inference?.tokensPerSecond)) {+ systemMetrics.push({icon: Zap,label: 'Tokens / second',- value: Number.isFinite(status?.inference?.tokensPerSecond) ? `${status.inference.tokensPerSecond.toFixed(1)} tok/s` : '—',- subvalue: throughputLabel(status?.inference,status?.clientTelemetry?.stale),- },+ value: `${status.inference.tokensPerSecond.toFixed(1)} tok/s`,+ subvalue: throughputLabel(status.inference,status?.clientTelemetry?.stale),+ })+ }++ systemMetrics.push({icon: Brackets,label: 'Context',@@ -1189,7 +1194,7 @@ const SystemOverviewPanel = memo(function SystemOverviewPanel({ tokensPerSecond,? 'Latest Completion': tokenCountMode === 'cumulative'? 'Accumulated Output'- : 'Waiting for telemetry'}+ : 'Not reported'}values={generated.values}timestamps={generated.timestamps}range={range}@@ -1263,9 +1268,9 @@ const OverviewChart = memo(function OverviewChart({</div></div>- {delta == null ? (+ {delta == null ? currentDisplay !== '—' && (<div className="mb-2 whitespace-nowrap text-xs font-medium text-theme-text-muted">- {currentDisplay === '—' ? 'telemetry unavailable' : 'collecting samples'}+ collecting samples</div>) : (<div className={`mb-2 whitespace-nowrap text-xs font-semibold ${deltaTone}`}>@@ -1344,7 +1349,7 @@ const OverviewChart = memo(function OverviewChart({fontSize="11"fontWeight="600">- {currentDisplay === '—' ? 'telemetry unavailable' : 'collecting telemetry'}+ {currentDisplay === '—' ? 'No data' : 'collecting telemetry'}</text>)}diff --git a/ods/extensions/services/dashboard/src/pages/Dashboard.test.jsx b/ods/extensions/services/dashboard/src/pages/Dashboard.test.jsxindex b891e1d46..fc7a64401 100644--- a/ods/extensions/services/dashboard/src/pages/Dashboard.test.jsx+++ b/ods/extensions/services/dashboard/src/pages/Dashboard.test.jsx@@ -134,14 +134,39 @@ describe('Dashboard system overview', () => {expect(screen.getByText('Accumulated Output')).toBeInTheDocument()})- it.each([[8.25, '8.3 tok/s'], [0, '0.0 tok/s'], [null, '—'], [undefined, '—']])('shows a real compact throughput reading for %s', async (tokensPerSecond, expected) => {+ it.each([[8.25, '8.3 tok/s'], [0, '0.0 tok/s']])('shows a real compact throughput reading for %s', async (tokensPerSecond, expected) => {render(<Dashboard compact status={{...baseStatus, inference:{...baseStatus.inference, tokensPerSecond}}} loading={false}/>)const row = screen.getByText('Tokens / second').closest('.dashboard-metric-row')expect(within(row).getByText(expected)).toBeVisible()- expect(within(row).getByText(tokensPerSecond == null ? 'Telemetry unavailable' : 'Runtime reading')).toBeVisible()+ expect(within(row).getByText('Runtime reading')).toBeVisible()await waitFor(() => expect(fetch).toHaveBeenCalledWith('/api/features'))})+ it.each([null, undefined])('leaves out Tokens / second while the runtime has reported no rate (%s)', async tokensPerSecond => {+ // A native engine that never reports throughput: nothing reads as a fault.+ render(<Dashboard compact status={{...baseStatus,+ inference:{...baseStatus.inference, tokensPerSecond, throughputState:'unavailable', throughputMode:'unavailable', throughputSampledAt:null},+ cpu:{percent:12,scope:'host'},+ gpu:{name:'NVIDIA GeForce RTX 4090',memoryType:'discrete',utilization:3,vramUsed:10,vramTotal:24,temperature:41,powerDraw:4}}} loading={false}/>)+ expect(screen.queryByText('Tokens / second')).toBeNull()+ expect(screen.queryByText(/telemetry unavailable/i)).toBeNull()+ expect(within(screen.getByText('Context').closest('.dashboard-metric-row')).getByText('32k')).toBeVisible()+ expect(within(screen.getByText('Model').closest('.dashboard-metric-row')).getByText('qwen')).toBeVisible()+ await waitFor(() => expect(fetch).toHaveBeenCalledWith('/api/features'))+ })++ it('names a missing reading neutrally in the full overview charts', async () => {+ await renderDashboard({...baseStatus,+ inference:{...baseStatus.inference, tokensPerSecond:null, lifetimeTokens:null, tokenCountMode:'unavailable', throughputState:'unavailable'}})+ const overview = screen.getByText('System Overview').closest('section')+ const throughput = screen.getByRole('img', {name:'TOKENS PER SECOND chart'}).parentElement+ expect(within(throughput).getByText('Not reported')).toBeVisible()+ expect(within(throughput).getByText('—')).toBeVisible()+ expect(within(overview).getAllByText('No data')).toHaveLength(2)+ expect(within(overview).queryByText(/telemetry/i)).toBeNull()+ expect(screen.queryByText('Tokens / second')).toBeNull()+ })+it.each([[0, '0.0'], [null, '—'], [undefined, '—']])('keeps full throughput reading %s distinct from unavailable history', async (tokensPerSecond, expected) => {await renderDashboard({...baseStatus, inference:{...baseStatus.inference, tokensPerSecond, lifetimeTokens:null}})const throughput = screen.getByRole('img', {name:'TOKENS PER SECOND chart'}).parentElement