Yicong-Huang commented on code in PR #5834:
URL: https://github.com/apache/texera/pull/5834#discussion_r3502286357
##########
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:
thanks
--
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]