You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some operations such as hooks and search indexing that have a heavy performance impact on API. We purposefully allow asynchronous methods inside hooks, such as model updates that don't effect the resulting payload, or third party endpoint requests that are again not crucial to the resulting payload.
Search indexing is always asynchronous which has shown to have a heavy impact when updating a large number of documents at once. The measurement of this operation is unfortunately not particularly transparent, but there may be a resolution for both hooks and search that is flexible enough not to impact performance when in production.
Stats handler
One potential is to introduce /workspace/handlers to house lightweight stats methods for logging and alerting, like an extension of consul.time/timeEnd.
module.exports.settings={maxExecTime: 100}module.exports.onExceedLimit=async(stats)=>{console.log(`Time to execute ${stats.key} exceeded ${this.settings.maxExecTime}`)}module.exports.onEnd=async(stats)=>{console.log(`Time to execute ${stats.key} was ${stats.duration}`)}
The text was updated successfully, but these errors were encountered:
There are some operations such as hooks and search indexing that have a heavy performance impact on API. We purposefully allow asynchronous methods inside hooks, such as model updates that don't effect the resulting payload, or third party endpoint requests that are again not crucial to the resulting payload.
Search indexing is always asynchronous which has shown to have a heavy impact when updating a large number of documents at once. The measurement of this operation is unfortunately not particularly transparent, but there may be a resolution for both hooks and search that is flexible enough not to impact performance when in production.
Stats handler
One potential is to introduce
/workspace/handlers
to house lightweight stats methods for logging and alerting, like an extension of consul.time/timeEnd.Search usage
Hook usage
Example handler
The text was updated successfully, but these errors were encountered: