mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) change ActiveDoc load and Sandbox call log messages to be aggregation-friendly
Summary: Takes some numbers embedded in strings and moves them to the context, so they can be aggregated and trends inspected more easily. Test Plan: tested manually by looking at logs Reviewers: dsagal Reviewed By: dsagal Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D4175
This commit is contained in:
parent
ae6a46dd59
commit
457b9714d1
@ -2380,7 +2380,11 @@ export class ActiveDoc extends EventEmitter {
|
|||||||
// took longer, scale it up proportionately.
|
// took longer, scale it up proportionately.
|
||||||
const closeTimeout = Math.max(loadMs, 1000) * Deps.ACTIVEDOC_TIMEOUT;
|
const closeTimeout = Math.max(loadMs, 1000) * Deps.ACTIVEDOC_TIMEOUT;
|
||||||
this._inactivityTimer.setDelay(closeTimeout);
|
this._inactivityTimer.setDelay(closeTimeout);
|
||||||
this._log.debug(docSession, `loaded in ${loadMs} ms, InactivityTimer set to ${closeTimeout} ms`);
|
log.rawDebug('ActiveDoc load timing', {
|
||||||
|
...this.getLogMeta(docSession),
|
||||||
|
loadMs,
|
||||||
|
closeTimeout,
|
||||||
|
});
|
||||||
const docUsage = getDocSessionUsage(docSession);
|
const docUsage = getDocSessionUsage(docSession);
|
||||||
if (!docUsage) {
|
if (!docUsage) {
|
||||||
// This looks be the first time this installation of Grist is touching
|
// This looks be the first time this installation of Grist is touching
|
||||||
|
@ -312,7 +312,11 @@ export class NSandbox implements ISandbox {
|
|||||||
throw new sandboxUtil.SandboxError(e.message);
|
throw new sandboxUtil.SandboxError(e.message);
|
||||||
} finally {
|
} finally {
|
||||||
if (this._logTimes) {
|
if (this._logTimes) {
|
||||||
log.rawDebug(`Sandbox pyCall[${funcName}] took ${Date.now() - startTime} ms`, this._logMeta);
|
log.rawDebug('NSandbox pyCall', {
|
||||||
|
...this._logMeta,
|
||||||
|
funcName,
|
||||||
|
loadMs: Date.now() - startTime,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user