Skip to content

Feature Request: Total Execution time for a function run #72

@ShelbyZ

Description

@ShelbyZ

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:

image

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions