diff --git a/apps/coordinator/src/index.ts b/apps/coordinator/src/index.ts index 91d670889..2bcb86163 100644 --- a/apps/coordinator/src/index.ts +++ b/apps/coordinator/src/index.ts @@ -41,13 +41,10 @@ type CheckpointAndPushOptions = { deploymentVersion: string; }; -type CheckpointAndPushReturn = Promise< - | { - location: string; - docker: boolean; - } - | undefined ->; +type CheckpointData = { + location: string; + docker: boolean; +}; class Checkpointer { #initialized = false; @@ -134,7 +131,26 @@ class Checkpointer { } } - async checkpointAndPush(opts: CheckpointAndPushOptions): CheckpointAndPushReturn { + async checkpointAndPush(opts: CheckpointAndPushOptions): Promise { + const start = performance.now(); + logger.log(`checkpointAndPush() start`, { start, opts }); + + const result = await this.#checkpointAndPush(opts); + + const end = performance.now(); + + logger.log(`checkpointAndPush() end`, { + start, + end, + diff: end - start, + opts, + success: !!result, + }); + + return result; + } + + async #checkpointAndPush(opts: CheckpointAndPushOptions): Promise { await this.initialize(); if (!this.#dockerMode && !this.#canCheckpoint) {