kunwp1 opened a new pull request, #9594:
URL: https://github.com/apache/texera/pull/9594

   ### What changes were proposed in this PR?
   
   Problem. The runtime stats endpoint returns `dataProcessingTime`, 
`controlProcessingTime`, `idleTime` and `numWorkers`, but the frontend 
`WorkflowRuntimeStatistics` type reads `totalDataProcessingTime`, 
`totalControlProcessingTime`, `totalIdleTime` and `numberOfWorkers`. Every one 
of those values is `undefined`, so the three time tabs and the Number of 
Workers tab in Runtime Statistics draw no lines, and the heat-map restore gives 
each operator no processing time and one worker.
   
   Fix. Renames the four fields in the frontend type, the Runtime Statistics 
chart component and `runtime-statistics-mapper.ts` to the names the backend 
sends. The backend names already match the Iceberg runtime statistics schema, 
so the REST response does not change.
   
   ```
   Before:  GET /stats -> { numWorkers: 32 } -> chart reads numberOfWorkers -> 
undefined -> empty chart
   After:   GET /stats -> { numWorkers: 32 } -> chart reads numWorkers      -> 
32
   ```
   
   The Number of Workers tab for the same completed execution, before and after:
   
   | Before | After |
   | --- | --- |
   | <img width="563" height="500" alt="runtime-stats-before" 
src="https://github.com/user-attachments/assets/2bbb010b-6409-47c5-a2f8-76e78d81f6b1";
 /> | <img width="563" height="500" alt="runtime-stats-after" 
src="https://github.com/user-attachments/assets/f7b8f688-5b62-429a-b67f-d3c02bcff58e";
 /> |
   
   Not included. The final stats snapshot of a run can race the writer close in 
`ExecutionStatsService` (persist runs on its own thread, close runs on the 
callback thread), which is a separate backend issue.
   
   ### Any related issues, documentation, discussions?
   
   Closes #9590. May also resolve #4152.
   
   ### How was this PR tested?
   
   Two tests were added that parse the endpoint's JSON exactly as 
`WorkflowExecutionsResource.WorkflowRuntimeStatistics` serializes it, one for 
the chart datasets and one for the heat-map mapper, so a rename on either side 
fails a test. The existing specs built rows with the frontend names, which is 
why they missed this. With the old production code and the new specs, both new 
tests fail along with 5 existing ones.
   
   ```
   cd frontend && npx ng test --watch=false 
--include='**/workflow-runtime-statistics.component.spec.ts' 
--include='**/runtime-statistics-mapper.spec.ts' 
--include='**/heatmap-stats-restore.service.spec.ts'
   cd frontend && npx ng test --watch=false
   ```
   
   The first command passes 38 tests. The second passes 6,874 tests; 9 
unrelated spec files (formly, code editor, versions list) did not load because 
`monaco-languageclient` cannot resolve a subpath on Node 23.7, and they fail 
the same way without this change. `ngc -p src/tsconfig.app.json --noEmit`, `ngc 
-p src/tsconfig.spec.json --noEmit`, `prettier-eslint` and `eslint` ran clean 
on the changed files.
   
   Checked in a browser against a local stack on a completed execution with 
1,730 stats rows: before the change every Number of Workers point is 
`undefined` and the chart is empty; after it the chart shows 32 workers for the 
Python UDF and 2 then 4 for the hash join, and Total Data Processing Time plots 
up to about 16,000 s. The heat-map restore after a page refresh was not clicked 
through and is covered by the mapper test only.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code, Claude Opus 5.5
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to