[Fix][Zeta] Fix job detail metrics NaN with 2.3.13 backend#10637
[Fix][Zeta] Fix job detail metrics NaN with 2.3.13 backend#10637davidzollo wants to merge 2 commits into
Conversation
Issue 1: Missing test coverage for null values and edge casesLocation: Problem Description:
Potential Risks:
Impact Scope:
Severity: MINOR Improvement Suggestions: test('returns 0 when metricMap is undefined', () => {
expect(readVertexMetricValue(undefined, sourceVertex, 'fake.user_table')).toBe(0)
})
test('handles vertexName without identifier', () => {
const vertexWithoutIdentifier = {
vertexId: 1,
type: 'source',
vertexName: 'simple-source-name',
tablePaths: ['fake.user_table']
} as Vertex
const metricMap = { 'fake.user_table': '15' }
expect(readVertexMetricValue(metricMap, vertexWithoutIdentifier, 'fake.user_table')).toBe(15)
})
test('returns 0 when no matching key found', () => {
const metricMap = { 'other.table': '100' }
expect(readVertexMetricValue(metricMap, sourceVertex, 'fake.user_table')).toBe(0)
})
test('prefers prefixed key over raw key when both exist', () => {
const metricMap = {
'Source[0].fake.user_table': '10',
'fake.user_table': '999'
}
expect(readVertexMetricValue(metricMap, sourceVertex, 'fake.user_table')).toBe(10)
})
test('handles non-numeric metric values', () => {
const metricMap = { 'fake.user_table': 'invalid' }
expect(readVertexMetricValue(metricMap, sourceVertex, 'fake.user_table')).toBe(0)
})Issue 2: Key names returned by
|
|
Hi @davidzollo, I pulled this PR locally and reviewed the job-detail metrics path against the current Local branch: What this PR fixes:
Runtime path checked: Key local evidence:
Local checks performed:
Merge conclusionConclusion: can merge after fixesBlocking items:
Non-blocking suggestions:
Overall evaluation: This is a precise front-end compatibility fix for the prefixed table-metric keys produced by the current backend. I did not find a source-level blocker in the implementation itself; once CI is green, this looks mergeable from the code path reviewed here. |
DanielLeens
left a comment
There was a problem hiding this comment.
Thanks for the contribution. I reviewed the latest head against the real job-detail metrics path from the backend metric map to the UI rendering.
What This PR Fixes
- User pain: when the backend returns table metrics under vertex-prefixed keys like
Source[0].tableorSink[1].table, the old job detail page still reads only the raw table name key, which can turn intoNaNor mis-attribute values. - Fix approach: this PR introduces
detail-metrics.tsas a compatibility layer so the UI first tries the prefixed key for the current vertex, then falls back to the legacy raw table key, and only then to an unambiguous suffix match. - One-line summary: this is a focused UI compatibility fix for mixed old/new metric-key shapes.
Runtime Chain Rechecked
backend BaseService.processMetric()
-> may emit `${vertexIdentifier}.${tableName}` keys
job detail page
-> detail.tsx sourceCell()/sinkCell()
-> readVertexMetricValue(metricMap, row, tablePath)
-> resolveMetricKey()
-> prefixed key for this vertex
-> raw table key
-> unique suffix fallback
detail drawer
-> collectVertexMetrics()
-> keep only metrics belonging to the focused vertex
Findings
Issue 1: the PR is still blocked by a red Build
- Location:
- GitHub
Build - fork run
davidzollo/seatunnel#26333762529
- GitHub
- Current visible failure:
Run / Code style
- Why this matters:
- this PR only changes frontend TS files, so the code-style lane needs to be green before merge
- Severity: Medium
Test Stability Assessment
- Rating: Stable
- Basis:
detail-metrics.spec.tsis a pure-function test with no timing, network, or container dependency- I did not see any new flaky-test pattern in the diff
Merge Conclusion
Conclusion: can merge after fixes
- Blocking items
- Issue 1: please get
Run / Code stylegreen first.
- Non-blocking suggestion
- If more metric-key variants appear later, I would keep expanding the centralized helper instead of spreading string rules back into the page component.
Overall, I do not see a code-level blocker in the compatibility logic itself. The remaining gate is CI, not the direction of the implementation.
|
Happy to see #10965 , I will close my PR |
What does this PR do?
Fixes the job detail page metrics lookup so the SeaTunnel UI can read the prefixed table metric keys returned by the 2.3.13 backend and avoid rendering
NaN.This change only targets the 2.3.13 backend contract.
Closes #10636
Why is this needed?
The 2.3.13 backend returns table metrics keyed by
Source[n].<tablePath>/Sink[n].<tablePath>, while the UI detail page still looked up metrics by raw table path. That mismatch madeNumber(undefined)show up asNaNin the job detail metrics table.How was it tested?
cd seatunnel-engine/seatunnel-engine-ui && npm run type-checkcd seatunnel-engine/seatunnel-engine-ui && npm run test:unit -- --run src/tests/detail-metrics.spec.ts./mvnw spotless:apply./mvnw -q -DskipTests verify(running locally while opening this PR)