socket-function 0.50.0 → 0.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socket-function",
3
- "version": "0.50.0",
3
+ "version": "0.51.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
@@ -144,7 +144,12 @@ export const runClientHooks = measureWrap(async function runClientHooks(
144
144
  }
145
145
  }
146
146
  for (let hook of clientHooks) {
147
+ let time = Date.now();
147
148
  await hook(context);
149
+ time = Date.now() - time;
150
+ if (time > 100) {
151
+ console.warn(`Slow client hook: ${JSON.stringify(hook.name || hook.toString().slice(0, 100))} took ${time}ms`);
152
+ }
148
153
  // NOTE: See ClientHookContext.overrideResult for why we break here
149
154
  if ("overrideResult" in context) {
150
155
  break;