Skip to content

Commit 8727d37

Browse files
authored
Rethinking metrics for functions deployment (#3162)
1 parent 2ca6d04 commit 8727d37

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/functionsDeployHelper.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,19 @@ export function logAndTrackDeployStats(queue: Queue<any, any>, errorHandler: Err
184184
logger.debug(`${errorHandler.errors.length} Functions Errored`);
185185
logger.debug(`Average Function Deployment time: ${stats.avg}`);
186186
if (stats.total > 0) {
187-
track("Functions Deploy (Result)", "failure", errorHandler.errors.length);
188-
track("Functions Deploy (Result)", "success", stats.total - errorHandler.errors.length);
187+
if (errorHandler.errors.length === 0) {
188+
track("functions_deploy_result", "success", stats.total);
189+
} else if (errorHandler.errors.length < stats.total) {
190+
track("functions_deploy_result", "partial_success", stats.total - errorHandler.errors.length);
191+
track("functions_deploy_result", "partial_failure", errorHandler.errors.length);
192+
track(
193+
"functions_deploy_result",
194+
"partial_error_ratio",
195+
errorHandler.errors.length / stats.total
196+
);
197+
} else {
198+
track("functions_deploy_result", "failure", stats.total);
199+
}
189200
}
190201
// TODO: Track other stats here - maybe time of full deployment?
191202
}

0 commit comments

Comments
 (0)