- 
                Notifications
    You must be signed in to change notification settings 
- Fork 64
Closed
Description
With a Twilio Function we have a limited resource time and need to try and work within a 5 second time window. Turning up logging via logLevel/detailedLogs does not give an 'at-a-glance' total execution time for a ran function:
Looking at the Function exuction line we can get an estimate of the execution time since the last log statement.
We could make use of console.time(...) in routes.ts like:
const FUNCTION_LABEL = 'Function Execution';
try {
    console.time(FUNCTION_LABEL);
    fn(context, event, callback);
    console.timeEnd(FUNCTION_LABEL);
} catch (err) {
    console.timeEnd(FUNCTION_LABEL);
    callback(err);
}There might be an easier way to achieve this with the current logger, but I hadn't dived down into it.
Metadata
Metadata
Assignees
Labels
No labels
