From baf44e390e937f59157d102941ecce0e99c14090 Mon Sep 17 00:00:00 2001 From: sebastianburckhardt Date: Wed, 5 Feb 2025 10:16:47 -0800 Subject: [PATCH 1/2] add rpc for workers to report metrics back to sidecar/backend. --- protos/orchestrator_service.proto | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/protos/orchestrator_service.proto b/protos/orchestrator_service.proto index f566163..078f88e 100644 --- a/protos/orchestrator_service.proto +++ b/protos/orchestrator_service.proto @@ -664,6 +664,9 @@ service TaskHubSidecarService { // clean entity storage rpc CleanEntityStorage(CleanEntityStorageRequest) returns (CleanEntityStorageResponse); + + // send worker metrics to the backend, where they can be aggregated, and used for dynamic adaptations + rpc ReportWorkerMetrics(WorkerMetrics) returns (google.protobuf.Empty); } message GetWorkItemsRequest { @@ -713,4 +716,17 @@ message StreamInstanceHistoryRequest { message HistoryChunk { repeated HistoryEvent events = 1; -} \ No newline at end of file +} + +message WorkerMetrics +{ + google.protobuf.Duration interval = 1; + WorkerWorkItemMetrics orchestrationMetrics = 2; + WorkerWorkItemMetrics activityMetrics = 3; + WorkerWorkItemMetrics entityMetrics = 4; +} + +message WorkerWorkItemMetrics +{ + double averageConcurrency = 1; +} From e08371fd22c98f85746f84a161d727f5b2bb2a69 Mon Sep 17 00:00:00 2001 From: sebastianburckhardt Date: Wed, 5 Feb 2025 13:47:39 -0800 Subject: [PATCH 2/2] simplify --- protos/orchestrator_service.proto | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/protos/orchestrator_service.proto b/protos/orchestrator_service.proto index 078f88e..c4939ad 100644 --- a/protos/orchestrator_service.proto +++ b/protos/orchestrator_service.proto @@ -720,13 +720,9 @@ message HistoryChunk { message WorkerMetrics { - google.protobuf.Duration interval = 1; - WorkerWorkItemMetrics orchestrationMetrics = 2; - WorkerWorkItemMetrics activityMetrics = 3; - WorkerWorkItemMetrics entityMetrics = 4; -} - -message WorkerWorkItemMetrics -{ - double averageConcurrency = 1; + google.protobuf.Timestamp timestamp = 1; + google.protobuf.Duration interval = 2; + double averageOrchestrationConcurrency = 3; + double averageActivityConcurrency = 4; + double averageEntityConcurrency = 5; }