Skip to content

Commit af8084c

Browse files
committed
remove dummy metrics from heartbeat
1 parent a5b9151 commit af8084c

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

packages/cli-v3/src/entryPoints/managed-run-controller.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,7 @@ class ManagedRunController {
220220

221221
const response = await this.httpClient.heartbeatRun(
222222
this.runFriendlyId,
223-
this.snapshotFriendlyId,
224-
{
225-
cpu: 0,
226-
memory: 0,
227-
}
223+
this.snapshotFriendlyId
228224
);
229225

230226
if (!response.success) {

packages/core/src/v3/runEngineWorker/supervisor/schemas.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ export const WorkerApiDequeueResponseBody = DequeuedMessage.array();
7373
export type WorkerApiDequeueResponseBody = z.infer<typeof WorkerApiDequeueResponseBody>;
7474

7575
export const WorkerApiRunHeartbeatRequestBody = z.object({
76-
cpu: z.number(),
77-
memory: z.number(),
76+
cpu: z.number().optional(),
77+
memory: z.number().optional(),
7878
});
7979
export type WorkerApiRunHeartbeatRequestBody = z.infer<typeof WorkerApiRunHeartbeatRequestBody>;
8080

packages/core/src/v3/runEngineWorker/workload/http.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class WorkloadHttpClient {
4141
this.apiUrl = apiUrl.replace(/\/$/, "");
4242
}
4343

44-
async heartbeatRun(runId: string, snapshotId: string, body: WorkloadHeartbeatRequestBody) {
44+
async heartbeatRun(runId: string, snapshotId: string, body?: WorkloadHeartbeatRequestBody) {
4545
return wrapZodFetch(
4646
WorkloadHeartbeatResponseBody,
4747
`${this.apiUrl}/api/v1/workload-actions/runs/${runId}/snapshots/${snapshotId}/heartbeat`,
@@ -51,7 +51,7 @@ export class WorkloadHttpClient {
5151
...this.defaultHeaders,
5252
"Content-Type": "application/json",
5353
},
54-
body: JSON.stringify(body),
54+
body: JSON.stringify(body ?? {}),
5555
}
5656
);
5757
}

0 commit comments

Comments
 (0)