PG1204 commented on code in PR #5834:
URL: https://github.com/apache/texera/pull/5834#discussion_r3502224173


##########
frontend/src/app/workspace/service/workflow-status/workflow-status.service.ts:
##########
@@ -49,6 +60,35 @@ export class WorkflowStatusService {
     return this.currentStatus;
   }
 
+  /** Stream of derived per-operator performance metrics, keyed by operator 
id. */
+  public getPerformanceMetricsStream(): Observable<Record<string, 
OperatorPerformanceMetrics>> {
+    return this.performanceMetricsSubject.asObservable();
+  }
+
+  /** Synchronous snapshot of the latest derived per-operator performance 
metrics. */
+  public getCurrentPerformanceMetrics(): Record<string, 
OperatorPerformanceMetrics> {
+    return this.performanceMetricsSubject.getValue();
+  }
+
+  /**
+   * Feed externally-sourced statistics (e.g. restored historical runtime 
stats)
+   * through the same pipeline as live websocket updates, so derived metrics 
and
+   * all subscribers update identically.
+   */
+  public setExternalStatus(status: Record<string, OperatorStatistics>): void {
+    this.statusSubject.next(status);
+  }

Review Comment:
   "External status" was a forward-looking hook for the persistence step (#5216 
step 3): on a page refresh there's no live run, so we'd fetch the last 
execution's persisted runtime stats (via the existing 
retrieveWorkflowRuntimeStatistics API) and feed them into WorkflowStatusService 
so the heat-map renders without re-running. Since nothing consumes it in this 
PR, I've removed it and will reintroduce it in the persistence PR where it has 
a real consumer and the context is clear.



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