Merge pull request #19455 from overleaf/jpa-metrics

[misc] add metrics for document processing/broadcasting

GitOrigin-RevId: d81de0dfb7a91863547631580f3c85f569718130
This commit is contained in:
Jakob Ackermann
2024-07-19 08:04:34 +00:00
committed by Copybot
parent 6afb067737
commit 0f0d562786
23 changed files with 280 additions and 71 deletions
@@ -459,7 +459,7 @@ export class DocumentContainer extends EventEmitter {
'joinDoc',
this.doc_id,
this.doc.getVersion(),
{ encodeRanges: true },
{ encodeRanges: true, age: this.doc.getTimeSinceLastServerActivity() },
(error, docLines, version, updates, ranges) => {
if (error) {
callback?.(error)
@@ -257,6 +257,10 @@ export class ShareJsDoc extends EventEmitter {
return this._doc.version
}
getTimeSinceLastServerActivity() {
return Math.floor(performance.now() - this._doc.lastServerActivity)
}
getType() {
return this.type
}