Skip to content

SLOW_GET_HELPER renders bad time in the logs #22312

Closed
@gilmrjc

Description

@gilmrjc

The get helper has the following code:

            if (totalMs > threshold) {
                logging[logLevel](new errors.HelperWarning({
                    message: `{{#get}} helper took ${totalMs}ms to complete`,
                    code: 'SLOW_GET_HELPER',
                    errorDetails: {
                        api: `${controllerName}.${action}`,
                        apiOptions,
                        returnedRows: returnedRowsCount
                    }
                }), {
                    time: totalMs
                });
            }

This makes the time field to be the time used to query the database. When using this data in the logger, it's used as the logging time.

For example:

2025-03-03T06:50:58.612491147Z [1970-01-01 00:00:00] WARN {{#get}} helper took 231ms to complete

Because the query took 213ms, the field time is parsed as a few milliseconds after the epoc time.

Originally posted by @gilmrjc in #20427 (comment)

Metadata

Metadata

Assignees

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