From 7e5ad22f7035b732785729644c60becd77d3730d Mon Sep 17 00:00:00 2001 From: Erica Windisch <73207+ewindisch@users.noreply.github.com> Date: Sat, 1 Sep 2018 19:50:36 -0400 Subject: [PATCH] Use process uptime for duration when coldstart detected Signed-off-by: Erica Windisch <73207+ewindisch@users.noreply.github.com> --- src/report.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/report.js b/src/report.js index 464fc0e..5825184 100644 --- a/src/report.js +++ b/src/report.js @@ -212,6 +212,7 @@ class Report { if (this.report.coldstart) { this.report.labels.add('@iopipe/coldstart'); + this.report.duration = Math.ceil(process.uptime() * 1e9); } // Convert labels from set to array