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

   ### What changes were proposed in this PR?
   
   Foundation for the workflow runtime performance heat-map (umbrella #5772).
   This PR captures all per-operator execution metrics as ground truth, with 
**no UI change**.
   
   The backend streams 11 statistics per operator, but the frontend 
`OperatorStatistics` type only declared 6, the timing and byte-size fields 
arrived over the websocket andwere silently dropped. This PR:
   
   - Extends `OperatorStatistics` with the 5 missing optional fields 
(input/output size, data/control processing time, idle time); they deserialize 
straight from the existing websocket payload, so no backend or websocket change 
is needed.
   - Adds a pure helper `performance-metrics.ts`: an 
`OperatorPerformanceMetrics` model, a `HeatmapView` enum, 
`toPerformanceMetrics`, `rawMetricForView` (bottleneck-oriented per-view cost), 
and `normalizeScores` (log1p + min-max into `[0,1]`).
   - Extends `WorkflowStatusService` with a derived, `BehaviorSubject`-backed 
performance-metrics stream (`getPerformanceMetricsStream` / 
`getCurrentPerformanceMetrics`) and a `setExternalStatus` ingestion point for 
later restoring historical stats. The existing status pass-through API is 
unchanged.
   
   All values arriving over the wire are coerced to finite, non-negative 
numbers, so missing / `NaN` / `Infinity` / negative inputs cannot leak into the 
scoring math.
   
   ### Any related issues, documentation, discussions?
   
   Closes #5773. Part of umbrella #5772. Follows RFC discussion #5216.
   
   ### How was this PR tested?
   
   New Vitest specs, run with:
   cd frontend && ng test --watch=false --include 
"/performance-metrics.spec.ts" --include "/workflow-status.service.spec.ts"
   
   - `performance-metrics.spec.ts` (19 tests): field mapping, 
missing/zero/`NaN`/`Infinity` defaults, per-view formulas, and 
`normalizeScores` edge cases (empty, single, all-equal, heavy-tail, unicode 
ids).
   - `workflow-status.service.spec.ts` (8 tests, new, the service had none): 
event forwarding, ignoring other event types, derived-metrics emission, 
`setExternalStatus`, reset/clear.
   
   Also verified: `tsc --noEmit` (strict) clean, `eslint ./src` clean, Prettier 
clean, and the existing `WorkflowStatusService` consumer specs still pass (67 
tests).
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   This PR was co-authored by Claude Opus 4.7, in compliance with ASF.


-- 
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