@fluidframework/container-runtime 2.5.0 → 2.10.0-305357

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.
Files changed (49) hide show
  1. package/api-report/container-runtime.legacy.alpha.api.md +1 -1
  2. package/container-runtime.test-files.tar +0 -0
  3. package/dist/connectionTelemetry.d.ts +2 -3
  4. package/dist/connectionTelemetry.d.ts.map +1 -1
  5. package/dist/connectionTelemetry.js.map +1 -1
  6. package/dist/containerRuntime.d.ts +2 -1
  7. package/dist/containerRuntime.d.ts.map +1 -1
  8. package/dist/containerRuntime.js +22 -15
  9. package/dist/containerRuntime.js.map +1 -1
  10. package/dist/deltaManagerProxies.d.ts +8 -8
  11. package/dist/deltaManagerProxies.d.ts.map +1 -1
  12. package/dist/deltaManagerProxies.js.map +1 -1
  13. package/dist/deltaScheduler.d.ts +3 -3
  14. package/dist/deltaScheduler.d.ts.map +1 -1
  15. package/dist/deltaScheduler.js.map +1 -1
  16. package/dist/packageVersion.d.ts +1 -1
  17. package/dist/packageVersion.d.ts.map +1 -1
  18. package/dist/packageVersion.js +1 -1
  19. package/dist/packageVersion.js.map +1 -1
  20. package/dist/scheduleManager.d.ts +3 -3
  21. package/dist/scheduleManager.d.ts.map +1 -1
  22. package/dist/scheduleManager.js.map +1 -1
  23. package/lib/connectionTelemetry.d.ts +2 -3
  24. package/lib/connectionTelemetry.d.ts.map +1 -1
  25. package/lib/connectionTelemetry.js.map +1 -1
  26. package/lib/containerRuntime.d.ts +2 -1
  27. package/lib/containerRuntime.d.ts.map +1 -1
  28. package/lib/containerRuntime.js +23 -16
  29. package/lib/containerRuntime.js.map +1 -1
  30. package/lib/deltaManagerProxies.d.ts +8 -8
  31. package/lib/deltaManagerProxies.d.ts.map +1 -1
  32. package/lib/deltaManagerProxies.js.map +1 -1
  33. package/lib/deltaScheduler.d.ts +3 -3
  34. package/lib/deltaScheduler.d.ts.map +1 -1
  35. package/lib/deltaScheduler.js.map +1 -1
  36. package/lib/packageVersion.d.ts +1 -1
  37. package/lib/packageVersion.d.ts.map +1 -1
  38. package/lib/packageVersion.js +1 -1
  39. package/lib/packageVersion.js.map +1 -1
  40. package/lib/scheduleManager.d.ts +3 -3
  41. package/lib/scheduleManager.d.ts.map +1 -1
  42. package/lib/scheduleManager.js.map +1 -1
  43. package/package.json +68 -20
  44. package/src/connectionTelemetry.ts +3 -3
  45. package/src/containerRuntime.ts +27 -23
  46. package/src/deltaManagerProxies.ts +5 -18
  47. package/src/deltaScheduler.ts +4 -7
  48. package/src/packageVersion.ts +1 -1
  49. package/src/scheduleManager.ts +3 -3
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { TypedEventEmitter } from "@fluid-internal/client-utils";
6
- import type { IDeltaManager, IDeltaManagerEvents, IDeltaQueue, IDeltaSender, ReadOnlyInfo } from "@fluidframework/container-definitions/internal";
6
+ import type { IDeltaManagerEvents, IDeltaManagerFull, IDeltaQueue, IDeltaSender, ReadOnlyInfo } from "@fluidframework/container-definitions/internal";
7
7
  import { IClientDetails } from "@fluidframework/driver-definitions";
8
8
  import { IClientConfiguration, IDocumentMessage, ISequencedDocumentMessage, ISignalMessage } from "@fluidframework/driver-definitions/internal";
9
9
  import type { PendingStateManager } from "./pendingStateManager.js";
@@ -13,8 +13,8 @@ import type { PendingStateManager } from "./pendingStateManager.js";
13
13
  * This class allows us to build proxy functionality without actually having to implement all the methods
14
14
  * of the DeltaManager.
15
15
  */
16
- export declare abstract class BaseDeltaManagerProxy extends TypedEventEmitter<IDeltaManagerEvents> implements IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> {
17
- protected readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
16
+ export declare abstract class BaseDeltaManagerProxy extends TypedEventEmitter<IDeltaManagerEvents> implements IDeltaManagerFull {
17
+ protected readonly deltaManager: IDeltaManagerFull;
18
18
  get IDeltaSender(): IDeltaSender;
19
19
  get inbound(): IDeltaQueue<ISequencedDocumentMessage>;
20
20
  get outbound(): IDeltaQueue<IDocumentMessage[]>;
@@ -31,7 +31,7 @@ export declare abstract class BaseDeltaManagerProxy extends TypedEventEmitter<ID
31
31
  get serviceConfiguration(): IClientConfiguration | undefined;
32
32
  get active(): boolean;
33
33
  get readOnlyInfo(): ReadOnlyInfo;
34
- constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>);
34
+ constructor(deltaManager: IDeltaManagerFull);
35
35
  dispose(): void;
36
36
  submitSignal(content: string, targetClientId?: string): void;
37
37
  flush(): void;
@@ -49,14 +49,14 @@ export declare abstract class BaseDeltaManagerProxy extends TypedEventEmitter<ID
49
49
  * - Summarizer client should not be active to layers below the container runtime to restrict local changes.
50
50
  */
51
51
  export declare class DeltaManagerSummarizerProxy extends BaseDeltaManagerProxy {
52
- protected readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
52
+ protected readonly deltaManager: IDeltaManagerFull;
53
53
  get active(): boolean;
54
54
  get readOnlyInfo(): ReadOnlyInfo;
55
55
  private readonly isSummarizerClient;
56
- constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>);
56
+ constructor(deltaManager: IDeltaManagerFull);
57
57
  }
58
58
  export declare class DeltaManagerPendingOpsProxy extends BaseDeltaManagerProxy {
59
- protected readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
59
+ protected readonly deltaManager: IDeltaManagerFull;
60
60
  private readonly pendingStateManager;
61
61
  get minimumSequenceNumber(): number;
62
62
  get lastMessage(): {
@@ -77,6 +77,6 @@ export declare class DeltaManagerPendingOpsProxy extends BaseDeltaManagerProxy {
77
77
  compression?: string | undefined;
78
78
  } | undefined;
79
79
  protected readonly onOp: (message: ISequencedDocumentMessage, processingTime: number) => void;
80
- constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>, pendingStateManager: Pick<PendingStateManager, "minimumPendingMessageSequenceNumber">);
80
+ constructor(deltaManager: IDeltaManagerFull, pendingStateManager: Pick<PendingStateManager, "minimumPendingMessageSequenceNumber">);
81
81
  }
82
82
  //# sourceMappingURL=deltaManagerProxies.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deltaManagerProxies.d.ts","sourceRoot":"","sources":["../src/deltaManagerProxies.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAEX,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,MAAM,gDAAgD,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,OAAO,EACN,oBAAoB,EACpB,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,EACd,MAAM,6CAA6C,CAAC;AAErD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGpE;;;;;GAKG;AACH,8BAAsB,qBACrB,SAAQ,iBAAiB,CAAC,mBAAmB,CAC7C,YAAW,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC;IAmEpE,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,aAAa,CAC7C,yBAAyB,EACzB,gBAAgB,CAChB;IApEF,IAAW,YAAY,IAAI,YAAY,CAEtC;IAED,IAAW,OAAO,IAAI,WAAW,CAAC,yBAAyB,CAAC,CAE3D;IAED,IAAW,QAAQ,IAAI,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAErD;IAED,IAAW,aAAa,IAAI,WAAW,CAAC,cAAc,CAAC,CAEtD;IAED,IAAW,qBAAqB,IAAI,MAAM,CAEzC;IAED,IAAW,kBAAkB,IAAI,MAAM,CAEtC;IAED,IAAW,WAAW,0CAErB;IAED,IAAW,kBAAkB,WAE5B;IAED,IAAW,qBAAqB,IAAI,MAAM,CAEzC;IAED,IAAW,2BAA2B,YAErC;IAED,IAAW,aAAa,IAAI,cAAc,C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,qBAAqB;IACrE,IAAW,qBAAqB;QAC/B,MAAM,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,CAAC,mCAAmC,CAAC;QACtF;;;;;;;;;;WAUG;QACH,IACC,gBAAgB,KAAK,SAAS;YAC9B,gBAAgB,GAAG,IAAI,CAAC,YAAY,CAAC,qBAAqB,EACzD,CAAC;YACF,OAAO,gBAAgB,CAAC;QACzB,CAAC;QACD,OAAO,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC;IAChD,CAAC;IAED,IAAW,WAAW;QACrB,IAAI,IAAI,CAAC,YAAY,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACjD,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC;QACtC,CAAC;QACD,OAAO;YACN,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW;YAChC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;SACjD,CAAC;IACH,CAAC;IAaD,YACoB,YAGlB,EACgB,mBAGhB;QAED,KAAK,CAAC,YAAY,CAAC,CAAC;QATD,iBAAY,GAAZ,YAAY,CAG9B;QACgB,wBAAmB,GAAnB,mBAAmB,CAGnC;QAnBiB,SAAI,GAAG,CACzB,OAAkC,EAClC,cAAsB,EACf,EAAE;YACT,MAAM,gBAAgB,GAAG;gBACxB,GAAG,OAAO;gBACV,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;aACjD,CAAC;YACF,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;QACnD,CAAC,CAAC;IAaF,CAAC;CACD;AAxDD,kEAwDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport type {\n\tIConnectionDetails,\n\tIDeltaManager,\n\tIDeltaManagerEvents,\n\tIDeltaQueue,\n\tIDeltaSender,\n\tReadOnlyInfo,\n} from \"@fluidframework/container-definitions/internal\";\nimport type { IErrorBase } from \"@fluidframework/core-interfaces\";\nimport { IClientDetails } from \"@fluidframework/driver-definitions\";\nimport type { IAnyDriverError } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tIClientConfiguration,\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tISignalMessage,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport type { PendingStateManager } from \"./pendingStateManager.js\";\nimport { summarizerClientType } from \"./summary/index.js\";\n\n/**\n * Base class for DeltaManager proxy that proxy's access to the real DeltaManager.\n *\n * This class allows us to build proxy functionality without actually having to implement all the methods\n * of the DeltaManager.\n */\nexport abstract class BaseDeltaManagerProxy\n\textends TypedEventEmitter<IDeltaManagerEvents>\n\timplements IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>\n{\n\tpublic get IDeltaSender(): IDeltaSender {\n\t\treturn this;\n\t}\n\n\tpublic get inbound(): IDeltaQueue<ISequencedDocumentMessage> {\n\t\treturn this.deltaManager.inbound;\n\t}\n\n\tpublic get outbound(): IDeltaQueue<IDocumentMessage[]> {\n\t\treturn this.deltaManager.outbound;\n\t}\n\n\tpublic get inboundSignal(): IDeltaQueue<ISignalMessage> {\n\t\treturn this.deltaManager.inboundSignal;\n\t}\n\n\tpublic get minimumSequenceNumber(): number {\n\t\treturn this.deltaManager.minimumSequenceNumber;\n\t}\n\n\tpublic get lastSequenceNumber(): number {\n\t\treturn this.deltaManager.lastSequenceNumber;\n\t}\n\n\tpublic get lastMessage() {\n\t\treturn this.deltaManager.lastMessage;\n\t}\n\n\tpublic get lastKnownSeqNumber() {\n\t\treturn this.deltaManager.lastKnownSeqNumber;\n\t}\n\n\tpublic get initialSequenceNumber(): number {\n\t\treturn this.deltaManager.initialSequenceNumber;\n\t}\n\n\tpublic get hasCheckpointSequenceNumber() {\n\t\treturn this.deltaManager.hasCheckpointSequenceNumber;\n\t}\n\n\tpublic get clientDetails(): IClientDetails {\n\t\treturn this.deltaManager.clientDetails;\n\t}\n\n\tpublic get version(): string {\n\t\treturn this.deltaManager.version;\n\t}\n\n\tpublic get maxMessageSize(): number {\n\t\treturn this.deltaManager.maxMessageSize;\n\t}\n\n\tpublic get serviceConfiguration(): IClientConfiguration | undefined {\n\t\treturn this.deltaManager.serviceConfiguration;\n\t}\n\n\tpublic get active(): boolean {\n\t\treturn this.deltaManager.active;\n\t}\n\n\tpublic get readOnlyInfo(): ReadOnlyInfo {\n\t\treturn this.deltaManager.readOnlyInfo;\n\t}\n\n\tconstructor(\n\t\tprotected readonly deltaManager: IDeltaManager<\n\t\t\tISequencedDocumentMessage,\n\t\t\tIDocumentMessage\n\t\t>,\n\t) {\n\t\tsuper();\n\n\t\t// We are expecting this class to have many listeners, so we suppress noisy \"MaxListenersExceededWarning\" logging.\n\t\tsuper.setMaxListeners(0);\n\n\t\tthis.deltaManager.on(\"prepareSend\", this.onPrepareSend);\n\t\tthis.deltaManager.on(\"submitOp\", this.onSubmitOp);\n\t\tthis.deltaManager.on(\"op\", this.onOp);\n\t\tthis.deltaManager.on(\"pong\", this.onPong);\n\t\tthis.deltaManager.on(\"connect\", this.onConnect);\n\t\tthis.deltaManager.on(\"disconnect\", this.onDisconnect);\n\t\tthis.deltaManager.on(\"readonly\", this.onReadonly);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.deltaManager.off(\"prepareSend\", this.onPrepareSend);\n\t\tthis.deltaManager.off(\"submitOp\", this.onSubmitOp);\n\t\tthis.deltaManager.off(\"op\", this.onOp);\n\t\tthis.deltaManager.off(\"pong\", this.onPong);\n\t\tthis.deltaManager.off(\"connect\", this.onConnect);\n\t\tthis.deltaManager.off(\"disconnect\", this.onDisconnect);\n\t\tthis.deltaManager.off(\"readonly\", this.onReadonly);\n\t}\n\n\tpublic submitSignal(content: string, targetClientId?: string): void {\n\t\treturn this.deltaManager.submitSignal(content, targetClientId);\n\t}\n\n\tpublic flush(): void {\n\t\treturn this.deltaManager.flush();\n\t}\n\n\tprivate readonly onPrepareSend = (messageBuffer: any[]): void => {\n\t\tthis.emit(\"prepareSend\", messageBuffer);\n\t};\n\tprivate readonly onSubmitOp = (message: IDocumentMessage): void => {\n\t\tthis.emit(\"submitOp\", message);\n\t};\n\tprotected readonly onOp = (\n\t\tmessage: ISequencedDocumentMessage,\n\t\tprocessingTime: number,\n\t): void => {\n\t\tthis.emit(\"op\", message, processingTime);\n\t};\n\tprivate readonly onPong = (latency: number): void => {\n\t\tthis.emit(\"pong\", latency);\n\t};\n\tprivate readonly onConnect = (details: IConnectionDetails, opsBehind?: number): void => {\n\t\tthis.emit(\"connect\", details, opsBehind);\n\t};\n\tprivate readonly onDisconnect = (reason: string, error?: IAnyDriverError): void => {\n\t\tthis.emit(\"disconnect\", reason, error);\n\t};\n\tprivate readonly onReadonly = (\n\t\treadonly: boolean,\n\t\treadonlyConnectionReason?: { reason: string; error?: IErrorBase },\n\t): void => {\n\t\tthis.emit(\"readonly\", readonly, readonlyConnectionReason);\n\t};\n}\n\n/**\n * Proxy to the real IDeltaManager for restricting certain access to layers below container runtime in summarizer clients:\n * - Summarizer client should be read-only to layers below the container runtime to restrict local changes.\n * - Summarizer client should not be active to layers below the container runtime to restrict local changes.\n */\nexport class DeltaManagerSummarizerProxy extends BaseDeltaManagerProxy {\n\tpublic get active(): boolean {\n\t\t// Summarize clients should not be active. There shouldn't be any local changes (writes) in the summarizer\n\t\t// except for the SummarizeOp which is generated by the runtime.\n\t\treturn !this.isSummarizerClient && this.deltaManager.active;\n\t}\n\n\tpublic get readOnlyInfo(): ReadOnlyInfo {\n\t\t// Summarizer clients should be read-only as far as the runtime and layers below are concerned. There shouldn't\n\t\t// be any local changes (writes) in the summarizer except for the summarize op which is generated by the runtime.\n\t\tif (this.isSummarizerClient) {\n\t\t\treturn {\n\t\t\t\treadonly: true,\n\t\t\t\tforced: false,\n\t\t\t\tpermissions: undefined,\n\t\t\t\tstorageOnly: false,\n\t\t\t};\n\t\t}\n\t\treturn this.deltaManager.readOnlyInfo;\n\t}\n\n\tprivate readonly isSummarizerClient: boolean;\n\n\tconstructor(\n\t\tprotected readonly deltaManager: IDeltaManager<\n\t\t\tISequencedDocumentMessage,\n\t\t\tIDocumentMessage\n\t\t>,\n\t) {\n\t\tsuper(deltaManager);\n\t\tthis.isSummarizerClient = this.deltaManager.clientDetails.type === summarizerClientType;\n\t}\n}\n\nexport class DeltaManagerPendingOpsProxy extends BaseDeltaManagerProxy {\n\tpublic get minimumSequenceNumber(): number {\n\t\tconst minPendingSeqNum = this.pendingStateManager.minimumPendingMessageSequenceNumber;\n\t\t/**\n\t\t * The reason why the minimum pending sequence number can be less than the delta manager's minimum sequence\n\t\t * number (DM's msn) is that when we are processing messages in the container runtime/delta manager, the delta\n\t\t * manager's msn can be updated to continually increase. In the meantime, the pending state manager's op which\n\t\t * hasn't been sent can still have a lower sequence number than the DM's msn (think about a disconnected\n\t\t * scenario). To successfully resubmit that pending op it has to be rebased first by the DDS. The DDS still\n\t\t * needs to keep the local data for that op that has a reference sequence number lower than the DM's msn. To\n\t\t * achieve this, the msn passed to the DDS needs to be the minimum of the DM's msn and the minimum pending\n\t\t * sequence number, so that it can keep the relevant local data to generate the right data for the new op\n\t\t * during resubmission.\n\t\t */\n\t\tif (\n\t\t\tminPendingSeqNum !== undefined &&\n\t\t\tminPendingSeqNum < this.deltaManager.minimumSequenceNumber\n\t\t) {\n\t\t\treturn minPendingSeqNum;\n\t\t}\n\t\treturn this.deltaManager.minimumSequenceNumber;\n\t}\n\n\tpublic get lastMessage() {\n\t\tif (this.deltaManager.lastMessage === undefined) {\n\t\t\treturn this.deltaManager.lastMessage;\n\t\t}\n\t\treturn {\n\t\t\t...this.deltaManager.lastMessage,\n\t\t\tminimumSequenceNumber: this.minimumSequenceNumber,\n\t\t};\n\t}\n\n\tprotected readonly onOp = (\n\t\tmessage: ISequencedDocumentMessage,\n\t\tprocessingTime: number,\n\t): void => {\n\t\tconst messageIntercept = {\n\t\t\t...message,\n\t\t\tminimumSequenceNumber: this.minimumSequenceNumber,\n\t\t};\n\t\tthis.emit(\"op\", messageIntercept, processingTime);\n\t};\n\n\tconstructor(\n\t\tprotected readonly deltaManager: IDeltaManager<\n\t\t\tISequencedDocumentMessage,\n\t\t\tIDocumentMessage\n\t\t>,\n\t\tprivate readonly pendingStateManager: Pick<\n\t\t\tPendingStateManager,\n\t\t\t\"minimumPendingMessageSequenceNumber\"\n\t\t>,\n\t) {\n\t\tsuper(deltaManager);\n\t}\n}\n"]}
1
+ {"version":3,"file":"deltaManagerProxies.js","sourceRoot":"","sources":["../src/deltaManagerProxies.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAoBjE,iDAA0D;AAE1D;;;;;GAKG;AACH,MAAsB,qBACrB,SAAQ,gCAAsC;IAG9C,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;IAClC,CAAC;IAED,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,IAAW,aAAa;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC;IACxC,CAAC;IAED,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC;IAChD,CAAC;IAED,IAAW,kBAAkB;QAC5B,OAAO,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC;IAC7C,CAAC;IAED,IAAW,WAAW;QACrB,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC;IACtC,CAAC;IAED,IAAW,kBAAkB;QAC5B,OAAO,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC;IAC7C,CAAC;IAED,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC;IAChD,CAAC;IAED,IAAW,2BAA2B;QACrC,OAAO,IAAI,CAAC,YAAY,CAAC,2BAA2B,CAAC;IACtD,CAAC;IA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AA3BD,kEA2BC;AAED,MAAa,2BAA4B,SAAQ,qBAAqB;IACrE,IAAW,qBAAqB;QAC/B,MAAM,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,CAAC,mCAAmC,CAAC;QACtF;;;;;;;;;;WAUG;QACH,IACC,gBAAgB,KAAK,SAAS;YAC9B,gBAAgB,GAAG,IAAI,CAAC,YAAY,CAAC,qBAAqB,EACzD,CAAC;YACF,OAAO,gBAAgB,CAAC;QACzB,CAAC;QACD,OAAO,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC;IAChD,CAAC;IAED,IAAW,WAAW;QACrB,IAAI,IAAI,CAAC,YAAY,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACjD,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC;QACtC,CAAC;QACD,OAAO;YACN,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW;YAChC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;SACjD,CAAC;IACH,CAAC;IAaD,YACoB,YAA+B,EACjC,mBAGhB;QAED,KAAK,CAAC,YAAY,CAAC,CAAC;QAND,iBAAY,GAAZ,YAAY,CAAmB;QACjC,wBAAmB,GAAnB,mBAAmB,CAGnC;QAhBiB,SAAI,GAAG,CACzB,OAAkC,EAClC,cAAsB,EACf,EAAE;YACT,MAAM,gBAAgB,GAAG;gBACxB,GAAG,OAAO;gBACV,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;aACjD,CAAC;YACF,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;QACnD,CAAC,CAAC;IAUF,CAAC;CACD;AArDD,kEAqDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport type {\n\tIConnectionDetails,\n\tIDeltaManagerEvents,\n\tIDeltaManagerFull,\n\tIDeltaQueue,\n\tIDeltaSender,\n\tReadOnlyInfo,\n} from \"@fluidframework/container-definitions/internal\";\nimport type { IErrorBase } from \"@fluidframework/core-interfaces\";\nimport { IClientDetails } from \"@fluidframework/driver-definitions\";\nimport type { IAnyDriverError } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tIClientConfiguration,\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tISignalMessage,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport type { PendingStateManager } from \"./pendingStateManager.js\";\nimport { summarizerClientType } from \"./summary/index.js\";\n\n/**\n * Base class for DeltaManager proxy that proxy's access to the real DeltaManager.\n *\n * This class allows us to build proxy functionality without actually having to implement all the methods\n * of the DeltaManager.\n */\nexport abstract class BaseDeltaManagerProxy\n\textends TypedEventEmitter<IDeltaManagerEvents>\n\timplements IDeltaManagerFull\n{\n\tpublic get IDeltaSender(): IDeltaSender {\n\t\treturn this;\n\t}\n\n\tpublic get inbound(): IDeltaQueue<ISequencedDocumentMessage> {\n\t\treturn this.deltaManager.inbound;\n\t}\n\n\tpublic get outbound(): IDeltaQueue<IDocumentMessage[]> {\n\t\treturn this.deltaManager.outbound;\n\t}\n\n\tpublic get inboundSignal(): IDeltaQueue<ISignalMessage> {\n\t\treturn this.deltaManager.inboundSignal;\n\t}\n\n\tpublic get minimumSequenceNumber(): number {\n\t\treturn this.deltaManager.minimumSequenceNumber;\n\t}\n\n\tpublic get lastSequenceNumber(): number {\n\t\treturn this.deltaManager.lastSequenceNumber;\n\t}\n\n\tpublic get lastMessage() {\n\t\treturn this.deltaManager.lastMessage;\n\t}\n\n\tpublic get lastKnownSeqNumber() {\n\t\treturn this.deltaManager.lastKnownSeqNumber;\n\t}\n\n\tpublic get initialSequenceNumber(): number {\n\t\treturn this.deltaManager.initialSequenceNumber;\n\t}\n\n\tpublic get hasCheckpointSequenceNumber() {\n\t\treturn this.deltaManager.hasCheckpointSequenceNumber;\n\t}\n\n\tpublic get clientDetails(): IClientDetails {\n\t\treturn this.deltaManager.clientDetails;\n\t}\n\n\tpublic get version(): string {\n\t\treturn this.deltaManager.version;\n\t}\n\n\tpublic get maxMessageSize(): number {\n\t\treturn this.deltaManager.maxMessageSize;\n\t}\n\n\tpublic get serviceConfiguration(): IClientConfiguration | undefined {\n\t\treturn this.deltaManager.serviceConfiguration;\n\t}\n\n\tpublic get active(): boolean {\n\t\treturn this.deltaManager.active;\n\t}\n\n\tpublic get readOnlyInfo(): ReadOnlyInfo {\n\t\treturn this.deltaManager.readOnlyInfo;\n\t}\n\n\tconstructor(protected readonly deltaManager: IDeltaManagerFull) {\n\t\tsuper();\n\n\t\t// We are expecting this class to have many listeners, so we suppress noisy \"MaxListenersExceededWarning\" logging.\n\t\tsuper.setMaxListeners(0);\n\n\t\tthis.deltaManager.on(\"prepareSend\", this.onPrepareSend);\n\t\tthis.deltaManager.on(\"submitOp\", this.onSubmitOp);\n\t\tthis.deltaManager.on(\"op\", this.onOp);\n\t\tthis.deltaManager.on(\"pong\", this.onPong);\n\t\tthis.deltaManager.on(\"connect\", this.onConnect);\n\t\tthis.deltaManager.on(\"disconnect\", this.onDisconnect);\n\t\tthis.deltaManager.on(\"readonly\", this.onReadonly);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.deltaManager.off(\"prepareSend\", this.onPrepareSend);\n\t\tthis.deltaManager.off(\"submitOp\", this.onSubmitOp);\n\t\tthis.deltaManager.off(\"op\", this.onOp);\n\t\tthis.deltaManager.off(\"pong\", this.onPong);\n\t\tthis.deltaManager.off(\"connect\", this.onConnect);\n\t\tthis.deltaManager.off(\"disconnect\", this.onDisconnect);\n\t\tthis.deltaManager.off(\"readonly\", this.onReadonly);\n\t}\n\n\tpublic submitSignal(content: string, targetClientId?: string): void {\n\t\treturn this.deltaManager.submitSignal(content, targetClientId);\n\t}\n\n\tpublic flush(): void {\n\t\treturn this.deltaManager.flush();\n\t}\n\n\tprivate readonly onPrepareSend = (messageBuffer: any[]): void => {\n\t\tthis.emit(\"prepareSend\", messageBuffer);\n\t};\n\tprivate readonly onSubmitOp = (message: IDocumentMessage): void => {\n\t\tthis.emit(\"submitOp\", message);\n\t};\n\tprotected readonly onOp = (\n\t\tmessage: ISequencedDocumentMessage,\n\t\tprocessingTime: number,\n\t): void => {\n\t\tthis.emit(\"op\", message, processingTime);\n\t};\n\tprivate readonly onPong = (latency: number): void => {\n\t\tthis.emit(\"pong\", latency);\n\t};\n\tprivate readonly onConnect = (details: IConnectionDetails, opsBehind?: number): void => {\n\t\tthis.emit(\"connect\", details, opsBehind);\n\t};\n\tprivate readonly onDisconnect = (reason: string, error?: IAnyDriverError): void => {\n\t\tthis.emit(\"disconnect\", reason, error);\n\t};\n\tprivate readonly onReadonly = (\n\t\treadonly: boolean,\n\t\treadonlyConnectionReason?: { reason: string; error?: IErrorBase },\n\t): void => {\n\t\tthis.emit(\"readonly\", readonly, readonlyConnectionReason);\n\t};\n}\n\n/**\n * Proxy to the real IDeltaManager for restricting certain access to layers below container runtime in summarizer clients:\n * - Summarizer client should be read-only to layers below the container runtime to restrict local changes.\n * - Summarizer client should not be active to layers below the container runtime to restrict local changes.\n */\nexport class DeltaManagerSummarizerProxy extends BaseDeltaManagerProxy {\n\tpublic get active(): boolean {\n\t\t// Summarize clients should not be active. There shouldn't be any local changes (writes) in the summarizer\n\t\t// except for the SummarizeOp which is generated by the runtime.\n\t\treturn !this.isSummarizerClient && this.deltaManager.active;\n\t}\n\n\tpublic get readOnlyInfo(): ReadOnlyInfo {\n\t\t// Summarizer clients should be read-only as far as the runtime and layers below are concerned. There shouldn't\n\t\t// be any local changes (writes) in the summarizer except for the summarize op which is generated by the runtime.\n\t\tif (this.isSummarizerClient) {\n\t\t\treturn {\n\t\t\t\treadonly: true,\n\t\t\t\tforced: false,\n\t\t\t\tpermissions: undefined,\n\t\t\t\tstorageOnly: false,\n\t\t\t};\n\t\t}\n\t\treturn this.deltaManager.readOnlyInfo;\n\t}\n\n\tprivate readonly isSummarizerClient: boolean;\n\n\tconstructor(protected readonly deltaManager: IDeltaManagerFull) {\n\t\tsuper(deltaManager);\n\t\tthis.isSummarizerClient = this.deltaManager.clientDetails.type === summarizerClientType;\n\t}\n}\n\nexport class DeltaManagerPendingOpsProxy extends BaseDeltaManagerProxy {\n\tpublic get minimumSequenceNumber(): number {\n\t\tconst minPendingSeqNum = this.pendingStateManager.minimumPendingMessageSequenceNumber;\n\t\t/**\n\t\t * The reason why the minimum pending sequence number can be less than the delta manager's minimum sequence\n\t\t * number (DM's msn) is that when we are processing messages in the container runtime/delta manager, the delta\n\t\t * manager's msn can be updated to continually increase. In the meantime, the pending state manager's op which\n\t\t * hasn't been sent can still have a lower sequence number than the DM's msn (think about a disconnected\n\t\t * scenario). To successfully resubmit that pending op it has to be rebased first by the DDS. The DDS still\n\t\t * needs to keep the local data for that op that has a reference sequence number lower than the DM's msn. To\n\t\t * achieve this, the msn passed to the DDS needs to be the minimum of the DM's msn and the minimum pending\n\t\t * sequence number, so that it can keep the relevant local data to generate the right data for the new op\n\t\t * during resubmission.\n\t\t */\n\t\tif (\n\t\t\tminPendingSeqNum !== undefined &&\n\t\t\tminPendingSeqNum < this.deltaManager.minimumSequenceNumber\n\t\t) {\n\t\t\treturn minPendingSeqNum;\n\t\t}\n\t\treturn this.deltaManager.minimumSequenceNumber;\n\t}\n\n\tpublic get lastMessage() {\n\t\tif (this.deltaManager.lastMessage === undefined) {\n\t\t\treturn this.deltaManager.lastMessage;\n\t\t}\n\t\treturn {\n\t\t\t...this.deltaManager.lastMessage,\n\t\t\tminimumSequenceNumber: this.minimumSequenceNumber,\n\t\t};\n\t}\n\n\tprotected readonly onOp = (\n\t\tmessage: ISequencedDocumentMessage,\n\t\tprocessingTime: number,\n\t): void => {\n\t\tconst messageIntercept = {\n\t\t\t...message,\n\t\t\tminimumSequenceNumber: this.minimumSequenceNumber,\n\t\t};\n\t\tthis.emit(\"op\", messageIntercept, processingTime);\n\t};\n\n\tconstructor(\n\t\tprotected readonly deltaManager: IDeltaManagerFull,\n\t\tprivate readonly pendingStateManager: Pick<\n\t\t\tPendingStateManager,\n\t\t\t\"minimumPendingMessageSequenceNumber\"\n\t\t>,\n\t) {\n\t\tsuper(deltaManager);\n\t}\n}\n"]}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IDeltaManager } from "@fluidframework/container-definitions/internal";
6
- import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
5
+ import { IDeltaManagerFull } from "@fluidframework/container-definitions/internal";
6
+ import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
7
7
  import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
8
8
  /**
9
9
  * DeltaScheduler is responsible for the scheduling of inbound delta queue in cases where there
@@ -27,7 +27,7 @@ export declare class DeltaScheduler {
27
27
  private currentAllowedProcessingTimeForTurn;
28
28
  private schedulingCount;
29
29
  private schedulingLog;
30
- constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>, logger: ITelemetryLoggerExt);
30
+ constructor(deltaManager: IDeltaManagerFull, logger: ITelemetryLoggerExt);
31
31
  batchBegin(message: ISequencedDocumentMessage): void;
32
32
  batchEnd(message: ISequencedDocumentMessage): void;
33
33
  private inboundQueueIdle;
@@ -1 +1 @@
1
- {"version":3,"file":"deltaScheduler.d.ts","sourceRoot":"","sources":["../src/deltaScheduler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EACN,gBAAgB,EAChB,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAc,MAAM,0CAA0C,CAAC;AAE3F;;;;;;;;;;;;GAYG;AACH,qBAAa,cAAc;IA8BzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IA7BxB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6D;IAE1F,gBAAuB,cAA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a,CAAC,SAAS,CAAC;gBAChE,eAAe,EAAE,IAAI,CAAC,eAAe;aACrC,CAAC,CAAC;YAEH,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAChC,CAAC;QAED,yFAAyF;QACzF,qCAAqC;QACrC,IAAI,CAAC,eAAe,EAAE,CAAC;QAEvB,8BAA8B;QAC9B,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;QACrC,IAAI,CAAC,mCAAmC,GAAG,cAAc,CAAC,cAAc,CAAC;IAC1E,CAAC;IAED;;OAEG;IACK,kBAAkB;QACzB,qFAAqF;QACrF,qBAAqB;QACrB,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7C,CAAC;;AArJF,wCAsJC;AApJA,gDAAgD;AACzB,6BAAc,GAAG,EAAE,AAAL,CAAM","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performance } from \"@fluid-internal/client-utils\";\nimport { IDeltaManager } from \"@fluidframework/container-definitions/internal\";\nimport {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { ITelemetryLoggerExt, formatTick } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * DeltaScheduler is responsible for the scheduling of inbound delta queue in cases where there\n * is more than one op a particular run of the queue. It does not schedule if there is just one\n * op or just one batch in the run. It does the following two things:\n *\n * 1. If the ops have been processed for more than a specific amount of time, it pauses the queue\n * and calls setTimeout to schedule a resume of the queue. This ensures that we don't block\n * the JS thread for a long time processing ops synchronously (for example, when catching up\n * ops right after boot or catching up ops / delayed realizing data stores by summarizer).\n *\n * 2. If we scheduled a particular run of the queue, it logs telemetry for the number of ops\n * processed, the time and number of turns it took to process the ops.\n */\nexport class DeltaScheduler {\n\tprivate readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\t// The time for processing ops in a single turn.\n\tpublic static readonly processingTime = 50;\n\n\t// The increase in time for processing ops after each turn.\n\tprivate readonly processingTimeIncrement = 10;\n\n\tprivate processingStartTime: number | undefined;\n\tprivate currentAllowedProcessingTimeForTurn: number = DeltaScheduler.processingTime;\n\n\t// This keeps track of the number of times inbound queue has been scheduled. After a particular\n\t// count, we log telemetry for the number of ops processed, the time and number of turns it took\n\t// to process the ops.\n\tprivate schedulingCount: number = 0;\n\n\tprivate schedulingLog:\n\t\t| {\n\t\t\t\topsRemainingToProcess: number;\n\t\t\t\ttotalProcessingTime: number;\n\t\t\t\tnumberOfTurns: number;\n\t\t\t\tnumberOfBatchesProcessed: number;\n\t\t\t\tlastSequenceNumber: number;\n\t\t\t\tfirstSequenceNumber: number;\n\t\t\t\tstartTime: number;\n\t\t }\n\t\t| undefined;\n\n\tconstructor(\n\t\tdeltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {\n\t\tthis.deltaManager = deltaManager;\n\t\tthis.deltaManager.inbound.on(\"idle\", () => {\n\t\t\tthis.inboundQueueIdle();\n\t\t});\n\t}\n\n\tpublic batchBegin(message: ISequencedDocumentMessage) {\n\t\tif (!this.processingStartTime) {\n\t\t\tthis.processingStartTime = performance.now();\n\t\t}\n\t\tif (this.schedulingLog === undefined && this.schedulingCount % 500 === 0) {\n\t\t\t// Every 500th time we are scheduling the inbound queue, we log telemetry for the\n\t\t\t// number of ops processed, the time and number of turns it took to process the ops.\n\t\t\tthis.schedulingLog = {\n\t\t\t\topsRemainingToProcess: 0,\n\t\t\t\tnumberOfTurns: 1,\n\t\t\t\ttotalProcessingTime: 0,\n\t\t\t\tnumberOfBatchesProcessed: 0,\n\t\t\t\tfirstSequenceNumber: message.sequenceNumber,\n\t\t\t\tlastSequenceNumber: message.sequenceNumber,\n\t\t\t\tstartTime: performance.now(),\n\t\t\t};\n\t\t}\n\t}\n\n\tpublic batchEnd(message: ISequencedDocumentMessage) {\n\t\tif (this.schedulingLog) {\n\t\t\tthis.schedulingLog.numberOfBatchesProcessed++;\n\t\t\tthis.schedulingLog.lastSequenceNumber = message.sequenceNumber;\n\t\t\tthis.schedulingLog.opsRemainingToProcess = this.deltaManager.inbound.length;\n\t\t}\n\n\t\tif (this.shouldRunScheduler()) {\n\t\t\tconst currentTime = performance.now();\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst elapsedTime = currentTime - this.processingStartTime!;\n\t\t\tif (elapsedTime > this.currentAllowedProcessingTimeForTurn) {\n\t\t\t\t// We have processed ops for more than the total processing time. So, pause the\n\t\t\t\t// queue, yield the thread and schedule a resume.\n\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\t\t\tthis.deltaManager.inbound.pause();\n\n\t\t\t\t// Increase the total processing time. Keep doing this after each turn until all the ops have\n\t\t\t\t// been processed. This way we keep the responsiveness at the beginning while also making sure\n\t\t\t\t// that all the ops process fairly quickly.\n\t\t\t\tthis.currentAllowedProcessingTimeForTurn += this.processingTimeIncrement;\n\n\t\t\t\t// If we are logging the telemetry this time, update the telemetry log object.\n\t\t\t\tif (this.schedulingLog) {\n\t\t\t\t\tthis.schedulingLog.numberOfTurns++;\n\t\t\t\t\tthis.schedulingLog.totalProcessingTime += elapsedTime;\n\t\t\t\t}\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tif (this.schedulingLog) {\n\t\t\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\t\t\teventName: \"InboundOpsPartialProcessingTime\",\n\t\t\t\t\t\t\tduration: formatTick(elapsedTime),\n\t\t\t\t\t\t\topsProcessed:\n\t\t\t\t\t\t\t\tthis.schedulingLog.lastSequenceNumber -\n\t\t\t\t\t\t\t\tthis.schedulingLog.firstSequenceNumber +\n\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\topsRemainingToProcess: this.deltaManager.inbound.length,\n\t\t\t\t\t\t\tprocessingTime: formatTick(this.schedulingLog.totalProcessingTime),\n\t\t\t\t\t\t\tnumberOfTurns: this.schedulingLog.numberOfTurns,\n\t\t\t\t\t\t\tbatchesProcessed: this.schedulingLog.numberOfBatchesProcessed,\n\t\t\t\t\t\t\ttimeToResume: formatTick(performance.now() - currentTime),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tthis.deltaManager.inbound.resume();\n\t\t\t\t});\n\n\t\t\t\tthis.processingStartTime = undefined;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate inboundQueueIdle() {\n\t\tif (this.schedulingLog) {\n\t\t\t// Add the time taken for processing the final ops to the total processing time in the\n\t\t\t// telemetry log object.\n\t\t\tconst currentTime = performance.now();\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tthis.schedulingLog.totalProcessingTime += currentTime - this.processingStartTime!;\n\n\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"InboundOpsProcessingTime\",\n\t\t\t\topsRemainingToProcess: this.schedulingLog.opsRemainingToProcess,\n\t\t\t\tnumberOfTurns: this.schedulingLog.numberOfTurns,\n\t\t\t\tprocessingTime: formatTick(this.schedulingLog.totalProcessingTime),\n\t\t\t\topsProcessed:\n\t\t\t\t\tthis.schedulingLog.lastSequenceNumber - this.schedulingLog.firstSequenceNumber + 1,\n\t\t\t\tbatchesProcessed: this.schedulingLog.numberOfBatchesProcessed,\n\t\t\t\tduration: formatTick(currentTime - this.schedulingLog.startTime),\n\t\t\t\tschedulingCount: this.schedulingCount,\n\t\t\t});\n\n\t\t\tthis.schedulingLog = undefined;\n\t\t}\n\n\t\t// If we scheduled this batch of the inbound queue, increment the counter that tracks the\n\t\t// number of times we have done this.\n\t\tthis.schedulingCount++;\n\n\t\t// Reset the processing times.\n\t\tthis.processingStartTime = undefined;\n\t\tthis.currentAllowedProcessingTimeForTurn = DeltaScheduler.processingTime;\n\t}\n\n\t/**\n\t * This function tells whether we should run the scheduler.\n\t */\n\tprivate shouldRunScheduler(): boolean {\n\t\t// If there are still ops in the queue after the one we are processing now, we should\n\t\t// run the scheduler.\n\t\treturn this.deltaManager.inbound.length > 0;\n\t}\n}\n"]}
1
+ {"version":3,"file":"deltaScheduler.js","sourceRoot":"","sources":["../src/deltaScheduler.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA2D;AAG3D,uEAA2F;AAE3F;;;;;;;;;;;;GAYG;AACH,MAAa,cAAc;IA4B1B,YACC,YAA+B,EACd,MAA2B;QAA3B,WAAM,GAAN,MAAM,CAAqB;QAzB7C,2DAA2D;QAC1C,4BAAuB,GAAG,EAAE,CAAC;QAGtC,wCAAmC,GAAW,cAAc,CAAC,cAAc,CAAC;QAEpF,+FAA+F;QAC/F,gGAAgG;QAChG,sBAAsB;QACd,oBAAe,GAAW,CAAC,CAAC;QAkBnC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;YACzC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,UAAU,CAAC,OAAkC;QACnD,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC/B,IAAI,CAAC,mBAAmB,GAAG,0BAAW,CAAC,GAAG,EAAE,CAAC;QAC9C,CAAC;QACD,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,eAAe,GAAG,GAAG,KAAK,CAAC,EAAE,CAAC;YAC1E,iFAAiF;YACjF,oFAAoF;YACpF,IAAI,CAAC,aAAa,GAAG;gBACpB,qBAAqB,EAAE,CAAC;gBACxB,aAAa,EAAE,CAAC;gBAChB,mBAAmB,EAAE,CAAC;gBACtB,wBAAwB,EAAE,CAAC;gBAC3B,mBAAmB,EAAE,OAAO,CAAC,cAAc;gBAC3C,kBAAkB,EAAE,OAAO,CAAC,cAAc;gBAC1C,SAAS,EAAE,0BAAW,C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AAwB;gBAC7D,QAAQ,EAAE,IAAA,qBAAU,EAAC,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC;gBAChE,eAAe,EAAE,IAAI,CAAC,eAAe;aACrC,CAAC,CAAC;YAEH,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAChC,CAAC;QAED,yFAAyF;QACzF,qCAAqC;QACrC,IAAI,CAAC,eAAe,EAAE,CAAC;QAEvB,8BAA8B;QAC9B,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;QACrC,IAAI,CAAC,mCAAmC,GAAG,cAAc,CAAC,cAAc,CAAC;IAC1E,CAAC;IAED;;OAEG;IACK,kBAAkB;QACzB,qFAAqF;QACrF,qBAAqB;QACrB,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7C,CAAC;;AArJF,wCAsJC;AApJA,gDAAgD;AACzB,6BAAc,GAAG,EAAE,AAAL,CAAM","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performance } from \"@fluid-internal/client-utils\";\nimport { IDeltaManagerFull } from \"@fluidframework/container-definitions/internal\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport { ITelemetryLoggerExt, formatTick } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * DeltaScheduler is responsible for the scheduling of inbound delta queue in cases where there\n * is more than one op a particular run of the queue. It does not schedule if there is just one\n * op or just one batch in the run. It does the following two things:\n *\n * 1. If the ops have been processed for more than a specific amount of time, it pauses the queue\n * and calls setTimeout to schedule a resume of the queue. This ensures that we don't block\n * the JS thread for a long time processing ops synchronously (for example, when catching up\n * ops right after boot or catching up ops / delayed realizing data stores by summarizer).\n *\n * 2. If we scheduled a particular run of the queue, it logs telemetry for the number of ops\n * processed, the time and number of turns it took to process the ops.\n */\nexport class DeltaScheduler {\n\tprivate readonly deltaManager: IDeltaManagerFull;\n\t// The time for processing ops in a single turn.\n\tpublic static readonly processingTime = 50;\n\n\t// The increase in time for processing ops after each turn.\n\tprivate readonly processingTimeIncrement = 10;\n\n\tprivate processingStartTime: number | undefined;\n\tprivate currentAllowedProcessingTimeForTurn: number = DeltaScheduler.processingTime;\n\n\t// This keeps track of the number of times inbound queue has been scheduled. After a particular\n\t// count, we log telemetry for the number of ops processed, the time and number of turns it took\n\t// to process the ops.\n\tprivate schedulingCount: number = 0;\n\n\tprivate schedulingLog:\n\t\t| {\n\t\t\t\topsRemainingToProcess: number;\n\t\t\t\ttotalProcessingTime: number;\n\t\t\t\tnumberOfTurns: number;\n\t\t\t\tnumberOfBatchesProcessed: number;\n\t\t\t\tlastSequenceNumber: number;\n\t\t\t\tfirstSequenceNumber: number;\n\t\t\t\tstartTime: number;\n\t\t }\n\t\t| undefined;\n\n\tconstructor(\n\t\tdeltaManager: IDeltaManagerFull,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {\n\t\tthis.deltaManager = deltaManager;\n\t\tthis.deltaManager.inbound.on(\"idle\", () => {\n\t\t\tthis.inboundQueueIdle();\n\t\t});\n\t}\n\n\tpublic batchBegin(message: ISequencedDocumentMessage) {\n\t\tif (!this.processingStartTime) {\n\t\t\tthis.processingStartTime = performance.now();\n\t\t}\n\t\tif (this.schedulingLog === undefined && this.schedulingCount % 500 === 0) {\n\t\t\t// Every 500th time we are scheduling the inbound queue, we log telemetry for the\n\t\t\t// number of ops processed, the time and number of turns it took to process the ops.\n\t\t\tthis.schedulingLog = {\n\t\t\t\topsRemainingToProcess: 0,\n\t\t\t\tnumberOfTurns: 1,\n\t\t\t\ttotalProcessingTime: 0,\n\t\t\t\tnumberOfBatchesProcessed: 0,\n\t\t\t\tfirstSequenceNumber: message.sequenceNumber,\n\t\t\t\tlastSequenceNumber: message.sequenceNumber,\n\t\t\t\tstartTime: performance.now(),\n\t\t\t};\n\t\t}\n\t}\n\n\tpublic batchEnd(message: ISequencedDocumentMessage) {\n\t\tif (this.schedulingLog) {\n\t\t\tthis.schedulingLog.numberOfBatchesProcessed++;\n\t\t\tthis.schedulingLog.lastSequenceNumber = message.sequenceNumber;\n\t\t\tthis.schedulingLog.opsRemainingToProcess = this.deltaManager.inbound.length;\n\t\t}\n\n\t\tif (this.shouldRunScheduler()) {\n\t\t\tconst currentTime = performance.now();\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst elapsedTime = currentTime - this.processingStartTime!;\n\t\t\tif (elapsedTime > this.currentAllowedProcessingTimeForTurn) {\n\t\t\t\t// We have processed ops for more than the total processing time. So, pause the\n\t\t\t\t// queue, yield the thread and schedule a resume.\n\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\t\t\tthis.deltaManager.inbound.pause();\n\n\t\t\t\t// Increase the total processing time. Keep doing this after each turn until all the ops have\n\t\t\t\t// been processed. This way we keep the responsiveness at the beginning while also making sure\n\t\t\t\t// that all the ops process fairly quickly.\n\t\t\t\tthis.currentAllowedProcessingTimeForTurn += this.processingTimeIncrement;\n\n\t\t\t\t// If we are logging the telemetry this time, update the telemetry log object.\n\t\t\t\tif (this.schedulingLog) {\n\t\t\t\t\tthis.schedulingLog.numberOfTurns++;\n\t\t\t\t\tthis.schedulingLog.totalProcessingTime += elapsedTime;\n\t\t\t\t}\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tif (this.schedulingLog) {\n\t\t\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\t\t\teventName: \"InboundOpsPartialProcessingTime\",\n\t\t\t\t\t\t\tduration: formatTick(elapsedTime),\n\t\t\t\t\t\t\topsProcessed:\n\t\t\t\t\t\t\t\tthis.schedulingLog.lastSequenceNumber -\n\t\t\t\t\t\t\t\tthis.schedulingLog.firstSequenceNumber +\n\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\topsRemainingToProcess: this.deltaManager.inbound.length,\n\t\t\t\t\t\t\tprocessingTime: formatTick(this.schedulingLog.totalProcessingTime),\n\t\t\t\t\t\t\tnumberOfTurns: this.schedulingLog.numberOfTurns,\n\t\t\t\t\t\t\tbatchesProcessed: this.schedulingLog.numberOfBatchesProcessed,\n\t\t\t\t\t\t\ttimeToResume: formatTick(performance.now() - currentTime),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tthis.deltaManager.inbound.resume();\n\t\t\t\t});\n\n\t\t\t\tthis.processingStartTime = undefined;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate inboundQueueIdle() {\n\t\tif (this.schedulingLog) {\n\t\t\t// Add the time taken for processing the final ops to the total processing time in the\n\t\t\t// telemetry log object.\n\t\t\tconst currentTime = performance.now();\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tthis.schedulingLog.totalProcessingTime += currentTime - this.processingStartTime!;\n\n\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"InboundOpsProcessingTime\",\n\t\t\t\topsRemainingToProcess: this.schedulingLog.opsRemainingToProcess,\n\t\t\t\tnumberOfTurns: this.schedulingLog.numberOfTurns,\n\t\t\t\tprocessingTime: formatTick(this.schedulingLog.totalProcessingTime),\n\t\t\t\topsProcessed:\n\t\t\t\t\tthis.schedulingLog.lastSequenceNumber - this.schedulingLog.firstSequenceNumber + 1,\n\t\t\t\tbatchesProcessed: this.schedulingLog.numberOfBatchesProcessed,\n\t\t\t\tduration: formatTick(currentTime - this.schedulingLog.startTime),\n\t\t\t\tschedulingCount: this.schedulingCount,\n\t\t\t});\n\n\t\t\tthis.schedulingLog = undefined;\n\t\t}\n\n\t\t// If we scheduled this batch of the inbound queue, increment the counter that tracks the\n\t\t// number of times we have done this.\n\t\tthis.schedulingCount++;\n\n\t\t// Reset the processing times.\n\t\tthis.processingStartTime = undefined;\n\t\tthis.currentAllowedProcessingTimeForTurn = DeltaScheduler.processingTime;\n\t}\n\n\t/**\n\t * This function tells whether we should run the scheduler.\n\t */\n\tprivate shouldRunScheduler(): boolean {\n\t\t// If there are still ops in the queue after the one we are processing now, we should\n\t\t// run the scheduler.\n\t\treturn this.deltaManager.inbound.length > 0;\n\t}\n}\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/container-runtime";
8
- export declare const pkgVersion = "2.5.0";
8
+ export declare const pkgVersion = "2.10.0-305357";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,sCAAsC,CAAC;AAC3D,eAAO,MAAM,UAAU,UAAU,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,sCAAsC,CAAC;AAC3D,eAAO,MAAM,UAAU,kBAAkB,CAAC"}
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/container-runtime";
11
- exports.pkgVersion = "2.5.0";
11
+ exports.pkgVersion = "2.10.0-305357";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,mCAAmC,CAAC;AAC9C,QAAA,UAAU,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-runtime\";\nexport const pkgVersion = \"2.5.0\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,mCAAmC,CAAC;AAC9C,QAAA,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-runtime\";\nexport const pkgVersion = \"2.10.0-305357\";\n"]}
@@ -3,8 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { EventEmitter } from "@fluid-internal/client-utils";
6
- import { IDeltaManager } from "@fluidframework/container-definitions/internal";
7
- import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
6
+ import { IDeltaManagerFull } from "@fluidframework/container-definitions/internal";
7
+ import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
8
8
  import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
9
9
  /**
10
10
  * This class has the following responsibilities:
@@ -21,7 +21,7 @@ export declare class ScheduleManager {
21
21
  readonly getClientId: () => string | undefined;
22
22
  private readonly logger;
23
23
  private readonly deltaScheduler;
24
- constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>, emitter: EventEmitter, getClientId: () => string | undefined, logger: ITelemetryLoggerExt);
24
+ constructor(deltaManager: IDeltaManagerFull, emitter: EventEmitter, getClientId: () => string | undefined, logger: ITelemetryLoggerExt);
25
25
  batchBegin(message: ISequencedDocumentMessage): void;
26
26
  batchEnd(error: any | undefined, message: ISequencedDocumentMessage): void;
27
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"scheduleManager.d.ts","sourceRoot":"","sources":["../src/scheduleManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,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EACL,IAAI,CAAC,oBAAoB,KAAK,SAAS,EACvC,KAAK,CAAC,mCAAmC,CACzC,CAAC;YACF,IAAA,iBAAM,EACL,CAAC,IAAI,CAAC,WAAW,EACjB,KAAK,CAAC,iEAAiE,CACvE,CAAC;YACF,IAAI,CAAC,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC;YAClD,+FAA+F;YAC/F,4EAA4E;YAC5E,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,QAAkB,CAAC;YACvD,qBAAqB;YACrB,mDAAmD;YACnD,+FAA+F;YAC/F,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC5C,IAAI,CAAC,UAAU,EAAE,CAAC;YACnB,CAAC;QACF,CAAC;aAAM,IAAI,aAAa,KAAK,KAAK,EAAE,CAAC;YACpC,IAAA,iBAAM,EACL,IAAI,CAAC,mBAAmB,KAAK,SAAS,EACtC,KAAK,CAAC,0CAA0C,CAChD,CAAC;YACF,wCAAwC;YACxC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;YACpD,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;YACrC,IAAI,CAAC,oBAAoB,GAAG,SAAS,CAAC;QACvC,CAAC;aAAM,CAAC;YACP,4CAA4C;YAC5C,IAAA,iBAAM,EAAC,IAAI,CAAC,oBAAoB,KAAK,SAAS,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC5E,CAAC;IACF,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { EventEmitter } from \"@fluid-internal/client-utils\";\nimport { performance } from \"@fluid-internal/client-utils\";\nimport { IDeltaManager } from \"@fluidframework/container-definitions/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { isRuntimeMessage } from \"@fluidframework/driver-utils/internal\";\nimport {\n\tITelemetryLoggerExt,\n\tDataCorruptionError,\n\tDataProcessingError,\n\tcreateChildLogger,\n\textractSafePropertiesFromMessage,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { DeltaScheduler } from \"./deltaScheduler.js\";\nimport { IBatchMetadata } from \"./metadata.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\n\ntype IRuntimeMessageMetadata =\n\t| undefined\n\t| {\n\t\t\tbatch?: boolean;\n\t };\n\n/**\n * This class has the following responsibilities:\n *\n * 1. It tracks batches as we process ops and raises \"batchBegin\" and \"batchEnd\" events.\n * As part of it, it validates batch correctness (i.e. no system ops in the middle of batch)\n *\n * 2. It creates instance of ScheduleManagerCore that ensures we never start processing ops from batch\n * unless all ops of the batch are in.\n */\nexport class ScheduleManager {\n\tprivate readonly deltaScheduler: DeltaScheduler;\n\n\tconstructor(\n\t\tprivate readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\t\tprivate readonly emitter: EventEmitter,\n\t\treadonly getClientId: () => string | undefined,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {\n\t\tthis.deltaScheduler = new DeltaScheduler(\n\t\t\tthis.deltaManager,\n\t\t\tcreateChildLogger({ logger: this.logger, namespace: \"DeltaScheduler\" }),\n\t\t);\n\t\tvoid new ScheduleManagerCore(deltaManager, getClientId, logger);\n\t}\n\n\tpublic batchBegin(message: ISequencedDocumentMessage) {\n\t\tthis.emitter.emit(\"batchBegin\", message);\n\t\tthis.deltaScheduler.batchBegin(message);\n\t}\n\n\tpublic batchEnd(error: any | undefined, message: ISequencedDocumentMessage) {\n\t\tthis.emitter.emit(\"batchEnd\", error, message);\n\t\tthis.deltaScheduler.batchEnd(message);\n\t}\n}\n\n/**\n * This class controls pausing and resuming of inbound queue to ensure that we never\n * start processing ops in a batch IF we do not have all ops in the batch.\n */\nclass ScheduleManagerCore {\n\tprivate pauseSequenceNumber: number | undefined;\n\tprivate currentBatchClientId: string | undefined;\n\tprivate localPaused = false;\n\tprivate timePaused = 0;\n\tprivate batchCount = 0;\n\n\tconstructor(\n\t\tprivate readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\t\tprivate readonly getClientId: () => string | undefined,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {\n\t\t// Listen for delta manager sends and add batch metadata to messages\n\t\tthis.deltaManager.on(\"prepareSend\", (messages: IDocumentMessage[]) => {\n\t\t\tif (messages.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// First message will have the batch flag set to true if doing a batched send\n\t\t\tconst firstMessageMetadata = messages[0].metadata as IRuntimeMessageMetadata;\n\t\t\tif (!firstMessageMetadata?.batch) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If the batch contains only a single op, clear the batch flag.\n\t\t\tif (messages.length === 1) {\n\t\t\t\tdelete firstMessageMetadata.batch;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the batch flag to false on the last message to indicate the end of the send batch\n\t\t\tconst lastMessage = messages[messages.length - 1];\n\t\t\t// TODO: It's not clear if this shallow clone is required, as opposed to just setting \"batch\" to false.\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n\t\t\tlastMessage.metadata = { ...(lastMessage.metadata as any), batch: false };\n\t\t});\n\n\t\t// Listen for updates and peek at the inbound\n\t\tthis.deltaManager.inbound.on(\"push\", (message: ISequencedDocumentMessage) => {\n\t\t\tthis.trackPending(message);\n\t\t});\n\n\t\t// Start with baseline - empty inbound queue.\n\t\tassert(!this.localPaused, 0x293 /* \"initial state\" */);\n\n\t\tconst allPending = this.deltaManager.inbound.toArray();\n\t\tfor (const pending of allPending) {\n\t\t\tthis.trackPending(pending);\n\t\t}\n\n\t\t// We are intentionally directly listening to the \"op\" to inspect system ops as well.\n\t\t// If we do not observe system ops, we are likely to hit 0x296 assert when system ops\n\t\t// precedes start of incomplete batch.\n\t\tthis.deltaManager.on(\"op\", (message) => this.afterOpProcessing(message));\n\t}\n\n\t/**\n\t * The only public function in this class - called when we processed an op,\n\t * to make decision if op processing should be paused or not after that.\n\t */\n\tpublic afterOpProcessing(message: ISequencedDocumentMessage) {\n\t\tassert(\n\t\t\t!this.localPaused,\n\t\t\t0x294 /* \"can't have op processing paused if we are processing an op\" */,\n\t\t);\n\n\t\t// If the inbound queue is ever empty, nothing to do!\n\t\tif (this.deltaManager.inbound.length === 0) {\n\t\t\tassert(\n\t\t\t\tthis.pauseSequenceNumber === undefined,\n\t\t\t\t0x295 /* \"there should be no pending batch if we have no ops\" */,\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// The queue is\n\t\t// 1. paused only when the next message to be processed is the beginning of a batch. Done in two places:\n\t\t// - here (processing ops until reaching start of incomplete batch)\n\t\t// - in trackPending(), when queue was empty and start of batch showed up.\n\t\t// 2. resumed when batch end comes in (in trackPending())\n\n\t\t// do we have incomplete batch to worry about?\n\t\tif (this.pauseSequenceNumber !== undefined) {\n\t\t\tif (message.sequenceNumber >= this.pauseSequenceNumber) {\n\t\t\t\tthrow DataProcessingError.create(\n\t\t\t\t\t// Former assert 0x296\n\t\t\t\t\t\"Incomplete batch\",\n\t\t\t\t\t\"ScheduleManager\",\n\t\t\t\t\tmessage,\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: message.type,\n\t\t\t\t\t\tcontentType: typeof message.contents,\n\t\t\t\t\t\tbatch: (message.metadata as IBatchMetadata | undefined)?.batch,\n\t\t\t\t\t\tcompression: message.compression,\n\t\t\t\t\t\tpauseSeqNum: this.pauseSequenceNumber,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// If the next op is the start of incomplete batch, then we can't process it until it's fully in - pause!\n\t\t\tif (message.sequenceNumber + 1 === this.pauseSequenceNumber) {\n\t\t\t\tthis.pauseQueue();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate pauseQueue() {\n\t\tassert(!this.localPaused, 0x297 /* \"always called from resumed state\" */);\n\t\tthis.localPaused = true;\n\t\tthis.timePaused = performance.now();\n\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\tthis.deltaManager.inbound.pause();\n\t}\n\n\tprivate resumeQueue(startBatch: number, messageEndBatch: ISequencedDocumentMessage) {\n\t\tconst endBatch = messageEndBatch.sequenceNumber;\n\t\tconst duration = this.localPaused ? performance.now() - this.timePaused : undefined;\n\n\t\tthis.batchCount++;\n\t\tif (this.batchCount % 1000 === 1) {\n\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"BatchStats\",\n\t\t\t\tsequenceNumber: endBatch,\n\t\t\t\tlength: endBatch - startBatch + 1,\n\t\t\t\tmsnDistance: endBatch - messageEndBatch.minimumSequenceNumber,\n\t\t\t\tduration,\n\t\t\t\tbatchCount: this.batchCount,\n\t\t\t\tinterrupted: this.localPaused,\n\t\t\t});\n\t\t}\n\n\t\t// Return early if no change in value\n\t\tif (!this.localPaused) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.localPaused = false;\n\n\t\tthis.deltaManager.inbound.resume();\n\t}\n\n\t/**\n\t * Called for each incoming op (i.e. inbound \"push\" notification)\n\t */\n\tprivate trackPending(message: ISequencedDocumentMessage) {\n\t\tassert(\n\t\t\tthis.deltaManager.inbound.length !== 0,\n\t\t\t0x298 /* \"we have something in the queue that generates this event\" */,\n\t\t);\n\n\t\tassert(\n\t\t\t(this.currentBatchClientId === undefined) === (this.pauseSequenceNumber === undefined),\n\t\t\t0x299 /* \"non-synchronized state\" */,\n\t\t);\n\n\t\tconst metadata = message.metadata as IRuntimeMessageMetadata;\n\t\t// batchMetadata will be true for the message that starts a batch, false for the one that ends it, and\n\t\t// undefined for all other messages.\n\t\tconst batchMetadata = metadata?.batch;\n\n\t\t// Protocol messages are never part of a runtime batch of messages\n\t\tif (!isRuntimeMessage(message)) {\n\t\t\t// Protocol messages should never show up in the middle of the batch!\n\t\t\tif (this.currentBatchClientId !== undefined) {\n\t\t\t\tthrow DataProcessingError.create(\n\t\t\t\t\t\"Received a system message during batch processing\", // Formerly known as assert 0x29a\n\t\t\t\t\t\"trackPending\",\n\t\t\t\t\tmessage,\n\t\t\t\t\t{\n\t\t\t\t\t\truntimeVersion: pkgVersion,\n\t\t\t\t\t\tbatchClientId:\n\t\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n\t\t\t\t\t\t\tthis.currentBatchClientId === null ? \"null\" : this.currentBatchClientId,\n\t\t\t\t\t\tpauseSequenceNumber: this.pauseSequenceNumber,\n\t\t\t\t\t\tlocalBatch: this.currentBatchClientId === this.getClientId(),\n\t\t\t\t\t\tmessageType: message.type,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tassert(batchMetadata === undefined, 0x29b /* \"system op in a batch?\" */);\n\t\t\tassert(\n\t\t\t\t!this.localPaused,\n\t\t\t\t0x29c /* \"we should be processing ops when there is no active batch\" */,\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.currentBatchClientId === undefined && batchMetadata === undefined) {\n\t\t\tassert(\n\t\t\t\t!this.localPaused,\n\t\t\t\t0x29d /* \"we should be processing ops when there is no active batch\" */,\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// If we got here, the message is part of a batch. Either starting, in progress, or ending.\n\n\t\t// If this is not the start of the batch, error out if the message was sent by a client other than the one that\n\t\t// started the current batch (it should not be possible for ops from other clients to get interleaved with a batch).\n\t\tif (\n\t\t\tthis.currentBatchClientId !== undefined &&\n\t\t\tthis.currentBatchClientId !== message.clientId\n\t\t) {\n\t\t\tthrow new DataCorruptionError(\"OpBatchIncomplete\", {\n\t\t\t\truntimeVersion: pkgVersion,\n\t\t\t\tbatchClientId:\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n\t\t\t\t\tthis.currentBatchClientId === null ? \"null\" : this.currentBatchClientId,\n\t\t\t\tpauseSequenceNumber: this.pauseSequenceNumber,\n\t\t\t\tlocalBatch: this.currentBatchClientId === this.getClientId(),\n\t\t\t\tlocalMessage: message.clientId === this.getClientId(),\n\t\t\t\t...extractSafePropertiesFromMessage(message),\n\t\t\t});\n\t\t}\n\n\t\t// The queue is\n\t\t// 1. paused only when the next message to be processed is the beginning of a batch. Done in two places:\n\t\t// - in afterOpProcessing() - processing ops until reaching start of incomplete batch\n\t\t// - here, when queue was empty and start of batch showed up (batchMetadata === true below).\n\t\t// 2. resumed when batch end comes in (batchMetadata === false below)\n\n\t\tif (batchMetadata) {\n\t\t\tassert(\n\t\t\t\tthis.currentBatchClientId === undefined,\n\t\t\t\t0x29e /* \"there can't be active batch\" */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\t!this.localPaused,\n\t\t\t\t0x29f /* \"we should be processing ops when there is no active batch\" */,\n\t\t\t);\n\t\t\tthis.pauseSequenceNumber = message.sequenceNumber;\n\t\t\t// TODO: Verify whether this should be able to handle server-generated ops (with null clientId)\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n\t\t\tthis.currentBatchClientId = message.clientId as string;\n\t\t\t// Start of the batch\n\t\t\t// Only pause processing if queue has no other ops!\n\t\t\t// If there are any other ops in the queue, processing will be stopped when they are processed!\n\t\t\tif (this.deltaManager.inbound.length === 1) {\n\t\t\t\tthis.pauseQueue();\n\t\t\t}\n\t\t} else if (batchMetadata === false) {\n\t\t\tassert(\n\t\t\t\tthis.pauseSequenceNumber !== undefined,\n\t\t\t\t0x2a0 /* \"batch presence was validated above\" */,\n\t\t\t);\n\t\t\t// Batch is complete, we can process it!\n\t\t\tthis.resumeQueue(this.pauseSequenceNumber, message);\n\t\t\tthis.pauseSequenceNumber = undefined;\n\t\t\tthis.currentBatchClientId = undefined;\n\t\t} else {\n\t\t\t// Continuation of current batch. Do nothing\n\t\t\tassert(this.currentBatchClientId !== undefined, 0x2a1 /* \"logic error\" */);\n\t\t}\n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B,mDAAmD;YACnD,+FAA+F;YAC/F,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC5C,IAAI,CAAC,UAAU,EAAE,CAAC;YACnB,CAAC;QACF,CAAC;aAAM,IAAI,aAAa,KAAK,KAAK,EAAE,CAAC;YACpC,IAAA,iBAAM,EACL,IAAI,CAAC,mBAAmB,KAAK,SAAS,EACtC,KAAK,CAAC,0CAA0C,CAChD,CAAC;YACF,wCAAwC;YACxC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;YACpD,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;YACrC,IAAI,CAAC,oBAAoB,GAAG,SAAS,CAAC;QACvC,CAAC;aAAM,CAAC;YACP,4CAA4C;YAC5C,IAAA,iBAAM,EAAC,IAAI,CAAC,oBAAoB,KAAK,SAAS,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC5E,CAAC;IACF,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { EventEmitter } from \"@fluid-internal/client-utils\";\nimport { performance } from \"@fluid-internal/client-utils\";\nimport { IDeltaManagerFull } from \"@fluidframework/container-definitions/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { isRuntimeMessage } from \"@fluidframework/driver-utils/internal\";\nimport {\n\tITelemetryLoggerExt,\n\tDataCorruptionError,\n\tDataProcessingError,\n\tcreateChildLogger,\n\textractSafePropertiesFromMessage,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { DeltaScheduler } from \"./deltaScheduler.js\";\nimport { IBatchMetadata } from \"./metadata.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\n\ntype IRuntimeMessageMetadata =\n\t| undefined\n\t| {\n\t\t\tbatch?: boolean;\n\t };\n\n/**\n * This class has the following responsibilities:\n *\n * 1. It tracks batches as we process ops and raises \"batchBegin\" and \"batchEnd\" events.\n * As part of it, it validates batch correctness (i.e. no system ops in the middle of batch)\n *\n * 2. It creates instance of ScheduleManagerCore that ensures we never start processing ops from batch\n * unless all ops of the batch are in.\n */\nexport class ScheduleManager {\n\tprivate readonly deltaScheduler: DeltaScheduler;\n\n\tconstructor(\n\t\tprivate readonly deltaManager: IDeltaManagerFull,\n\t\tprivate readonly emitter: EventEmitter,\n\t\treadonly getClientId: () => string | undefined,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {\n\t\tthis.deltaScheduler = new DeltaScheduler(\n\t\t\tthis.deltaManager,\n\t\t\tcreateChildLogger({ logger: this.logger, namespace: \"DeltaScheduler\" }),\n\t\t);\n\t\tvoid new ScheduleManagerCore(deltaManager, getClientId, logger);\n\t}\n\n\tpublic batchBegin(message: ISequencedDocumentMessage) {\n\t\tthis.emitter.emit(\"batchBegin\", message);\n\t\tthis.deltaScheduler.batchBegin(message);\n\t}\n\n\tpublic batchEnd(error: any | undefined, message: ISequencedDocumentMessage) {\n\t\tthis.emitter.emit(\"batchEnd\", error, message);\n\t\tthis.deltaScheduler.batchEnd(message);\n\t}\n}\n\n/**\n * This class controls pausing and resuming of inbound queue to ensure that we never\n * start processing ops in a batch IF we do not have all ops in the batch.\n */\nclass ScheduleManagerCore {\n\tprivate pauseSequenceNumber: number | undefined;\n\tprivate currentBatchClientId: string | undefined;\n\tprivate localPaused = false;\n\tprivate timePaused = 0;\n\tprivate batchCount = 0;\n\n\tconstructor(\n\t\tprivate readonly deltaManager: IDeltaManagerFull,\n\t\tprivate readonly getClientId: () => string | undefined,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {\n\t\t// Listen for delta manager sends and add batch metadata to messages\n\t\tthis.deltaManager.on(\"prepareSend\", (messages: IDocumentMessage[]) => {\n\t\t\tif (messages.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// First message will have the batch flag set to true if doing a batched send\n\t\t\tconst firstMessageMetadata = messages[0].metadata as IRuntimeMessageMetadata;\n\t\t\tif (!firstMessageMetadata?.batch) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If the batch contains only a single op, clear the batch flag.\n\t\t\tif (messages.length === 1) {\n\t\t\t\tdelete firstMessageMetadata.batch;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the batch flag to false on the last message to indicate the end of the send batch\n\t\t\tconst lastMessage = messages[messages.length - 1];\n\t\t\t// TODO: It's not clear if this shallow clone is required, as opposed to just setting \"batch\" to false.\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n\t\t\tlastMessage.metadata = { ...(lastMessage.metadata as any), batch: false };\n\t\t});\n\n\t\t// Listen for updates and peek at the inbound\n\t\tthis.deltaManager.inbound.on(\"push\", (message: ISequencedDocumentMessage) => {\n\t\t\tthis.trackPending(message);\n\t\t});\n\n\t\t// Start with baseline - empty inbound queue.\n\t\tassert(!this.localPaused, 0x293 /* \"initial state\" */);\n\n\t\tconst allPending = this.deltaManager.inbound.toArray();\n\t\tfor (const pending of allPending) {\n\t\t\tthis.trackPending(pending);\n\t\t}\n\n\t\t// We are intentionally directly listening to the \"op\" to inspect system ops as well.\n\t\t// If we do not observe system ops, we are likely to hit 0x296 assert when system ops\n\t\t// precedes start of incomplete batch.\n\t\tthis.deltaManager.on(\"op\", (message) => this.afterOpProcessing(message));\n\t}\n\n\t/**\n\t * The only public function in this class - called when we processed an op,\n\t * to make decision if op processing should be paused or not after that.\n\t */\n\tpublic afterOpProcessing(message: ISequencedDocumentMessage) {\n\t\tassert(\n\t\t\t!this.localPaused,\n\t\t\t0x294 /* \"can't have op processing paused if we are processing an op\" */,\n\t\t);\n\n\t\t// If the inbound queue is ever empty, nothing to do!\n\t\tif (this.deltaManager.inbound.length === 0) {\n\t\t\tassert(\n\t\t\t\tthis.pauseSequenceNumber === undefined,\n\t\t\t\t0x295 /* \"there should be no pending batch if we have no ops\" */,\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// The queue is\n\t\t// 1. paused only when the next message to be processed is the beginning of a batch. Done in two places:\n\t\t// - here (processing ops until reaching start of incomplete batch)\n\t\t// - in trackPending(), when queue was empty and start of batch showed up.\n\t\t// 2. resumed when batch end comes in (in trackPending())\n\n\t\t// do we have incomplete batch to worry about?\n\t\tif (this.pauseSequenceNumber !== undefined) {\n\t\t\tif (message.sequenceNumber >= this.pauseSequenceNumber) {\n\t\t\t\tthrow DataProcessingError.create(\n\t\t\t\t\t// Former assert 0x296\n\t\t\t\t\t\"Incomplete batch\",\n\t\t\t\t\t\"ScheduleManager\",\n\t\t\t\t\tmessage,\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: message.type,\n\t\t\t\t\t\tcontentType: typeof message.contents,\n\t\t\t\t\t\tbatch: (message.metadata as IBatchMetadata | undefined)?.batch,\n\t\t\t\t\t\tcompression: message.compression,\n\t\t\t\t\t\tpauseSeqNum: this.pauseSequenceNumber,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// If the next op is the start of incomplete batch, then we can't process it until it's fully in - pause!\n\t\t\tif (message.sequenceNumber + 1 === this.pauseSequenceNumber) {\n\t\t\t\tthis.pauseQueue();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate pauseQueue() {\n\t\tassert(!this.localPaused, 0x297 /* \"always called from resumed state\" */);\n\t\tthis.localPaused = true;\n\t\tthis.timePaused = performance.now();\n\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\tthis.deltaManager.inbound.pause();\n\t}\n\n\tprivate resumeQueue(startBatch: number, messageEndBatch: ISequencedDocumentMessage) {\n\t\tconst endBatch = messageEndBatch.sequenceNumber;\n\t\tconst duration = this.localPaused ? performance.now() - this.timePaused : undefined;\n\n\t\tthis.batchCount++;\n\t\tif (this.batchCount % 1000 === 1) {\n\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"BatchStats\",\n\t\t\t\tsequenceNumber: endBatch,\n\t\t\t\tlength: endBatch - startBatch + 1,\n\t\t\t\tmsnDistance: endBatch - messageEndBatch.minimumSequenceNumber,\n\t\t\t\tduration,\n\t\t\t\tbatchCount: this.batchCount,\n\t\t\t\tinterrupted: this.localPaused,\n\t\t\t});\n\t\t}\n\n\t\t// Return early if no change in value\n\t\tif (!this.localPaused) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.localPaused = false;\n\n\t\tthis.deltaManager.inbound.resume();\n\t}\n\n\t/**\n\t * Called for each incoming op (i.e. inbound \"push\" notification)\n\t */\n\tprivate trackPending(message: ISequencedDocumentMessage) {\n\t\tassert(\n\t\t\tthis.deltaManager.inbound.length !== 0,\n\t\t\t0x298 /* \"we have something in the queue that generates this event\" */,\n\t\t);\n\n\t\tassert(\n\t\t\t(this.currentBatchClientId === undefined) === (this.pauseSequenceNumber === undefined),\n\t\t\t0x299 /* \"non-synchronized state\" */,\n\t\t);\n\n\t\tconst metadata = message.metadata as IRuntimeMessageMetadata;\n\t\t// batchMetadata will be true for the message that starts a batch, false for the one that ends it, and\n\t\t// undefined for all other messages.\n\t\tconst batchMetadata = metadata?.batch;\n\n\t\t// Protocol messages are never part of a runtime batch of messages\n\t\tif (!isRuntimeMessage(message)) {\n\t\t\t// Protocol messages should never show up in the middle of the batch!\n\t\t\tif (this.currentBatchClientId !== undefined) {\n\t\t\t\tthrow DataProcessingError.create(\n\t\t\t\t\t\"Received a system message during batch processing\", // Formerly known as assert 0x29a\n\t\t\t\t\t\"trackPending\",\n\t\t\t\t\tmessage,\n\t\t\t\t\t{\n\t\t\t\t\t\truntimeVersion: pkgVersion,\n\t\t\t\t\t\tbatchClientId:\n\t\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n\t\t\t\t\t\t\tthis.currentBatchClientId === null ? \"null\" : this.currentBatchClientId,\n\t\t\t\t\t\tpauseSequenceNumber: this.pauseSequenceNumber,\n\t\t\t\t\t\tlocalBatch: this.currentBatchClientId === this.getClientId(),\n\t\t\t\t\t\tmessageType: message.type,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tassert(batchMetadata === undefined, 0x29b /* \"system op in a batch?\" */);\n\t\t\tassert(\n\t\t\t\t!this.localPaused,\n\t\t\t\t0x29c /* \"we should be processing ops when there is no active batch\" */,\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.currentBatchClientId === undefined && batchMetadata === undefined) {\n\t\t\tassert(\n\t\t\t\t!this.localPaused,\n\t\t\t\t0x29d /* \"we should be processing ops when there is no active batch\" */,\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// If we got here, the message is part of a batch. Either starting, in progress, or ending.\n\n\t\t// If this is not the start of the batch, error out if the message was sent by a client other than the one that\n\t\t// started the current batch (it should not be possible for ops from other clients to get interleaved with a batch).\n\t\tif (\n\t\t\tthis.currentBatchClientId !== undefined &&\n\t\t\tthis.currentBatchClientId !== message.clientId\n\t\t) {\n\t\t\tthrow new DataCorruptionError(\"OpBatchIncomplete\", {\n\t\t\t\truntimeVersion: pkgVersion,\n\t\t\t\tbatchClientId:\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n\t\t\t\t\tthis.currentBatchClientId === null ? \"null\" : this.currentBatchClientId,\n\t\t\t\tpauseSequenceNumber: this.pauseSequenceNumber,\n\t\t\t\tlocalBatch: this.currentBatchClientId === this.getClientId(),\n\t\t\t\tlocalMessage: message.clientId === this.getClientId(),\n\t\t\t\t...extractSafePropertiesFromMessage(message),\n\t\t\t});\n\t\t}\n\n\t\t// The queue is\n\t\t// 1. paused only when the next message to be processed is the beginning of a batch. Done in two places:\n\t\t// - in afterOpProcessing() - processing ops until reaching start of incomplete batch\n\t\t// - here, when queue was empty and start of batch showed up (batchMetadata === true below).\n\t\t// 2. resumed when batch end comes in (batchMetadata === false below)\n\n\t\tif (batchMetadata) {\n\t\t\tassert(\n\t\t\t\tthis.currentBatchClientId === undefined,\n\t\t\t\t0x29e /* \"there can't be active batch\" */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\t!this.localPaused,\n\t\t\t\t0x29f /* \"we should be processing ops when there is no active batch\" */,\n\t\t\t);\n\t\t\tthis.pauseSequenceNumber = message.sequenceNumber;\n\t\t\t// TODO: Verify whether this should be able to handle server-generated ops (with null clientId)\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n\t\t\tthis.currentBatchClientId = message.clientId as string;\n\t\t\t// Start of the batch\n\t\t\t// Only pause processing if queue has no other ops!\n\t\t\t// If there are any other ops in the queue, processing will be stopped when they are processed!\n\t\t\tif (this.deltaManager.inbound.length === 1) {\n\t\t\t\tthis.pauseQueue();\n\t\t\t}\n\t\t} else if (batchMetadata === false) {\n\t\t\tassert(\n\t\t\t\tthis.pauseSequenceNumber !== undefined,\n\t\t\t\t0x2a0 /* \"batch presence was validated above\" */,\n\t\t\t);\n\t\t\t// Batch is complete, we can process it!\n\t\t\tthis.resumeQueue(this.pauseSequenceNumber, message);\n\t\t\tthis.pauseSequenceNumber = undefined;\n\t\t\tthis.currentBatchClientId = undefined;\n\t\t} else {\n\t\t\t// Continuation of current batch. Do nothing\n\t\t\tassert(this.currentBatchClientId !== undefined, 0x2a1 /* \"logic error\" */);\n\t\t}\n\t}\n}\n"]}
@@ -2,10 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IDeltaManager } from "@fluidframework/container-definitions/internal";
5
+ import { IDeltaManagerFull } from "@fluidframework/container-definitions/internal";
6
6
  import { IContainerRuntimeEvents } from "@fluidframework/container-runtime-definitions/internal";
7
7
  import { IEventProvider } from "@fluidframework/core-interfaces";
8
- import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
9
8
  import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
10
9
  /**
11
10
  * We report various latency-related errors when waiting for op roundtrip takes longer than that amout of time.
@@ -62,5 +61,5 @@ export interface IPerfSignalReport {
62
61
  * @param containerRuntimeEvents - Emitter of events for the container runtime.
63
62
  * @param logger - Telemetry logger to write events to.
64
63
  */
65
- export declare function ReportOpPerfTelemetry(clientId: string | undefined, deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>, containerRuntimeEvents: IEventProvider<IContainerRuntimeEvents>, logger: ITelemetryLoggerExt): void;
64
+ export declare function ReportOpPerfTelemetry(clientId: string | undefined, deltaManager: IDeltaManagerFull, containerRuntimeEvents: IEventProvider<IContainerRuntimeEvents>, logger: ITelemetryLoggerExt): void;
66
65
  //# sourceMappingURL=connectionTelemetry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connectionTelemetry.d.ts","sourceRoot":"","sources":["../src/connectionTelemetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EACN,gBAAgB,EAEhB,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAEN,mBAAmB,EAKnB,MAAM,0CAA0C,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAC;AA4ZrC,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,6BAA6B,EAAE,MAAM,CAAC;IAEtC;;;;OAIG;IACH,+BAA+B,EAAE,MAAM,CAAC;IAExC;;;;OAIG;IACH,sCAAsC,EAAE,MAAM,CAAC;IAE/C;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;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AyB,GAAG,GAAG,AAAN,CAAO;AAGhC,yCAAyB,GAAG,GAAG,AAAN,CAAO;AA4YzD;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CACpC,QAA4B,EAC5B,YAAwE,EACxE,sBAA+D,EAC/D,MAA2B;IAE3B,IAAI,eAAe,CAAC,QAAQ,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,CAAC,CAAC;AAC7E,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performance } from \"@fluid-internal/client-utils\";\nimport { IDeltaManager } from \"@fluidframework/container-definitions/internal\";\nimport { IContainerRuntimeEvents } from \"@fluidframework/container-runtime-definitions/internal\";\nimport { IEventProvider } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIDocumentMessage,\n\tMessageType,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { isRuntimeMessage } from \"@fluidframework/driver-utils/internal\";\nimport {\n\tIEventSampler,\n\tITelemetryLoggerExt,\n\tISampledTelemetryLogger,\n\tcreateChildLogger,\n\tcreateSampledLogger,\n\tformatTick,\n} from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * We report various latency-related errors when waiting for op roundtrip takes longer than that amout of time.\n */\nexport const latencyThreshold = 5000;\n\n// Phases in OpPerfTelemetry:\n// 1.\tOp is added to DeltaManager (DM) buffer.\n// 2.\tOp is sent to service (op leaves outbound queue).\n// \t - Note: We do not know for sure when op is sent, we only track when it is added to outbound queue.\n// If outbound queue is paused, time queue is paused is counted as network time.\n// 3.\tOp received from service back (pushed to inbound queue).\n// 4.\tOp is processed.\ninterface IOpPerfTelemetryProperties {\n\t/** Measure time between (1) and (2) - Measure time outbound op is sitting in queue due to active batch */\n\tdurationOutboundBatching: number; // was durationOutboundQueue in previous versions\n\t/** Measure time between (2) and (3) - Track how long it took for op to be acked by service */\n\tdurationNetwork: number; // was durationInboundQueue\n\t/** Measure time between (3) and (4) - Time between DM's inbound \"push\" event until DM's \"op\" event */\n\tdurationInboundToProcessing: number;\n\t/** Length of the DeltaManager's inbound queue at the time of the DM's inbound \"push\" event (3) */\n\tlengthInboundQueue: number;\n}\n\n/**\n * Timings collected at various moments during the op processing.\n */\ninterface IOpPerfTimings {\n\t/** Starting time for (1) */\n\tsubmitOpEventTime: number;\n\t/** Starting time for (2) */\n\toutboundPushEventTime: number;\n\t/** Starting time for (3) */\n\tinboundPushEventTime: number;\n}\n\nclass OpPerfTelemetry {\n\tprivate pingLatency: number | undefined;\n\n\t// Collab window tracking. This is timestamp of %1000 message.\n\tprivate sequenceNumberForMsnTracking: number | undefined;\n\tprivate msnTrackingTimestamp: number = 0;\n\t// To track round trip time for every %500 client message.\n\tprivate clientSequenceNumberForLatencyStatistics: number | undefined;\n\t// Performance Data to be reported for ops round trips and processing.\n\tprivate readonly latencyStatistics = new Map<\n\t\tnumber,\n\t\t{\n\t\t\topProcessingTimes: Partial<IOpPerfTimings>;\n\t\t\topPerfData: Partial<IOpPerfTelemetryProperties>;\n\t\t}\n\t>();\n\n\tprivate firstConnection = true;\n\tprivate connectionOpSeqNumber: number | undefined;\n\tprivate readonly bootTime = performance.now();\n\tprivate connectionStartTime = 0;\n\tprivate gap = 0;\n\n\t/** Count of no-ops sent by this client. This variable is reset everytime the OpStats sampled event is logged */\n\tprivate noOpCountForTelemetry = 0;\n\t/** Cumulative size of the ops processed by this client. This variable is reset everytime the OpStats sampled event is logged */\n\tprivate processedOpSizeForTelemetry = 0;\n\n\tprivate readonly logger: ITelemetryLoggerExt;\n\n\tprivate static readonly OP_LATENCY_SAMPLE_RATE = 500;\n\tprivate readonly opLatencyLogger: ISampledTelemetryLogger;\n\n\tprivate static readonly DELTA_LATENCY_SAMPLE_RATE = 100;\n\tprivate readonly deltaLatencyLogger: ISampledTelemetryLogger;\n\n\tprivate static readonly PROCESSED_OPS_SAMPLE_RATE = 500;\n\n\t/**\n\t * A sampled logger to log Ops that have been processed by the current client, the NoOp sent and the\n\t * size of the ops processed within one sampling window of this log event.\n\t * The data from this logger will be used to monitor the efficiency of NoOp-heuristics or to get approximate collab window size.\n\t * Note: no log events are sent when sampling is disabled, because logging at every op will be too noisy.\n\t */\n\tprivate readonly opsLogger: ISampledTelemetryLogger;\n\n\t/**\n\t * Create an instance of OpPerfTelemetry which starts monitoring and generating telemetry related to op performance.\n\t *\n\t * @param clientId - The clientId of the current container.\n\t * @param deltaManager - DeltaManager instance to monitor.\n\t * @param containerRuntimeEvents - Emitter of events for the container runtime.\n\t * @param logger - Telemetry logger to write events to.\n\t */\n\tpublic constructor(\n\t\t/**\n\t\t * The clientId of the current container.\n\t\t *\n\t\t * @remarks Until the container connects to the server and receives an ack for its own join op, this can be undefined.\n\t\t * It gets updated in response to event changes once the value provided by the server is available.\n\t\t * If the container loses its connection, this could be the last known clientId.\n\t\t */\n\t\tprivate clientId: string | undefined,\n\t\t/**\n\t\t * DeltaManager instance to monitor.\n\t\t */\n\t\tprivate readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\t\t/**\n\t\t * Emitter of events for the container runtime.\n\t\t */\n\t\tcontainerRuntimeEvents: IEventProvider<IContainerRuntimeEvents>,\n\t\t/**\n\t\t * Telemetry logger to write events to.\n\t\t */\n\t\tlogger: ITelemetryLoggerExt,\n\t) {\n\t\tthis.logger = createChildLogger({ logger, namespace: \"OpPerf\" });\n\n\t\tconst deltaLatencyEventSampler: IEventSampler = (() => {\n\t\t\tlet eventCount = -1;\n\t\t\treturn {\n\t\t\t\tsample: () => {\n\t\t\t\t\teventCount++;\n\t\t\t\t\tconst shouldSample = eventCount % OpPerfTelemetry.DELTA_LATENCY_SAMPLE_RATE === 0;\n\t\t\t\t\tif (shouldSample) {\n\t\t\t\t\t\teventCount = 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn shouldSample;\n\t\t\t\t},\n\t\t\t};\n\t\t})();\n\n\t\tthis.deltaLatencyLogger = createSampledLogger(logger, deltaLatencyEventSampler);\n\n\t\t// The SampledLogger here is used get access to the isSamplingDisabled property derived from\n\t\t// telemetry config properties. The actual sampling logic for op messages happens outside this SampledLogger\n\t\t// due to complexity of the different asynchronus scenarios of the op message lifecycle.\n\t\tthis.opLatencyLogger = createSampledLogger(logger);\n\n\t\tconst opsEventSampler: IEventSampler = (() => {\n\t\t\tlet eventCount = 0;\n\t\t\treturn {\n\t\t\t\tsample: () => {\n\t\t\t\t\teventCount++;\n\t\t\t\t\tconst shouldSample = eventCount % OpPerfTelemetry.PROCESSED_OPS_SAMPLE_RATE === 0;\n\t\t\t\t\tif (shouldSample) {\n\t\t\t\t\t\teventCount = 0;\n\t\t\t\t\t\tthis.noOpCountForTelemetry = 0;\n\t\t\t\t\t\tthis.processedOpSizeForTelemetry = 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn shouldSample;\n\t\t\t\t},\n\t\t\t};\n\t\t})();\n\t\tthis.opsLogger = createSampledLogger(\n\t\t\tlogger,\n\t\t\topsEventSampler,\n\t\t\ttrue /* skipLoggingWhenSamplingIsDisabled */,\n\t\t);\n\n\t\tthis.deltaManager.on(\"pong\", (latency) => this.recordPingTime(latency));\n\t\tthis.deltaManager.on(\"submitOp\", (message) => this.beforeOpSubmit(message));\n\t\tthis.deltaManager.on(\"op\", (message) => this.afterProcessingOp(message));\n\t\tthis.deltaManager.on(\"connect\", (details, opsBehind) => {\n\t\t\tif (opsBehind !== undefined) {\n\t\t\t\tthis.connectionOpSeqNumber = this.deltaManager.lastKnownSeqNumber;\n\t\t\t\tthis.gap = opsBehind;\n\t\t\t\tthis.connectionStartTime = performance.now();\n\n\t\t\t\t// We might be already up-today. If so, report it right away.\n\t\t\t\tif (this.gap <= 0) {\n\t\t\t\t\tthis.reportGettingUpToDate();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.deltaManager.on(\"disconnect\", () => {\n\t\t\tthis.sequenceNumberForMsnTracking = undefined;\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = undefined;\n\t\t\tthis.connectionOpSeqNumber = undefined;\n\t\t\tthis.firstConnection = false;\n\t\t\tthis.latencyStatistics.clear();\n\t\t});\n\n\t\tthis.deltaManager.outbound.on(\"push\", (messages) => {\n\t\t\tfor (const msg of messages) {\n\t\t\t\tif (\n\t\t\t\t\tmsg.type === MessageType.Operation &&\n\t\t\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === msg.clientSequenceNumber)\n\t\t\t\t) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tconst latencyStats = this.latencyStatistics.get(msg.clientSequenceNumber)!;\n\t\t\t\t\tassert(latencyStats !== undefined, 0x7c2 /* Latency stats for op should exist */);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime === undefined,\n\t\t\t\t\t\t0x2c8 /* \"outboundPushEventTime should be undefined\" */,\n\t\t\t\t\t);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opPerfData.durationNetwork === undefined,\n\t\t\t\t\t\t0x2c9 /* \"durationNetwork should be undefined\" */,\n\t\t\t\t\t);\n\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime = Date.now();\n\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opPerfData.durationOutboundBatching === undefined,\n\t\t\t\t\t\t0x2ca /* \"durationOutboundBatching should be undefined\" */,\n\t\t\t\t\t);\n\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.submitOpEventTime !== undefined,\n\t\t\t\t\t\t0x2cb /* \"submitOpEventTime should be undefined\" */,\n\t\t\t\t\t);\n\n\t\t\t\t\tlatencyStats.opPerfData.durationOutboundBatching =\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime -\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.submitOpEventTime;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tthis.deltaManager.inbound.on(\"push\", (message: ISequencedDocumentMessage) => {\n\t\t\tif (\n\t\t\t\tthis.clientId === message.clientId &&\n\t\t\t\tmessage.type === MessageType.Operation &&\n\t\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber)\n\t\t\t) {\n\t\t\t\t// We do an explicit check for undefined right after this\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tconst latencyStats = this.latencyStatistics.get(message.clientSequenceNumber)!;\n\t\t\t\tassert(latencyStats !== undefined, 0x7c3 /* Latency stats for op should exist */);\n\t\t\t\tif (latencyStats.opProcessingTimes.outboundPushEventTime !== undefined) {\n\t\t\t\t\tlatencyStats.opProcessingTimes.inboundPushEventTime = Date.now();\n\t\t\t\t\tlatencyStats.opPerfData.durationNetwork =\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.inboundPushEventTime -\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime;\n\t\t\t\t\tlatencyStats.opPerfData.lengthInboundQueue = this.deltaManager.inbound.length;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isRuntimeMessage(message) && typeof message.contents === \"string\") {\n\t\t\t\tthis.processedOpSizeForTelemetry += message.contents.length;\n\t\t\t}\n\t\t});\n\n\t\tthis.deltaManager.inbound.on(\"idle\", (count: number, duration: number) => {\n\t\t\t// Do not want to log zero for sure.\n\t\t\t// We are more interested in aggregates, so logging only if we are processing some number of ops\n\t\t\t// Cut-off is arbitrary - can be increased or decreased based on amount of data collected and questions we\n\t\t\t// want to get answered\n\t\t\t// back-compat: Once 0.36 loader version saturates (count & duration args were added there),\n\t\t\t// we can remove typeof check.\n\t\t\tif (typeof count === \"number\" && count >= 100) {\n\t\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\t\teventName: \"GetDeltas_OpProcessing\",\n\t\t\t\t\tcount,\n\t\t\t\t\tduration,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tcontainerRuntimeEvents.on(\"connected\", (newClientId) => {\n\t\t\tthis.clientId = newClientId;\n\t\t});\n\t}\n\n\tprivate reportGettingUpToDate() {\n\t\tthis.connectionOpSeqNumber = undefined;\n\t\tthis.logger.sendPerformanceEvent({\n\t\t\teventName: \"ConnectionSpeed\",\n\t\t\tduration: performance.now() - this.connectionStartTime,\n\t\t\tops: this.gap,\n\t\t\t// track time to connect only for first connection.\n\t\t\ttimeToConnect: this.firstConnection\n\t\t\t\t? formatTick(this.connectionStartTime - this.bootTime)\n\t\t\t\t: undefined,\n\t\t\tfirstConnection: this.firstConnection,\n\t\t});\n\t}\n\n\tprivate recordPingTime(latency: number) {\n\t\tthis.pingLatency = latency;\n\n\t\t// Log if latency is longer than 1 min\n\t\tif (latency > 1000 * 60) {\n\t\t\tthis.logger.sendErrorEvent({\n\t\t\t\teventName: \"LatencyTooLong\",\n\t\t\t\tduration: latency,\n\t\t\t});\n\t\t}\n\n\t\t// logging one in every DELTA_LATENCY_SAMPLE_RATE pongs, including the first time, if it is a \"write\" client.\n\t\tif (this.deltaManager.active) {\n\t\t\tthis.deltaLatencyLogger.sendPerformanceEvent({\n\t\t\t\teventName: \"DeltaLatency\",\n\t\t\t\tduration: latency,\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate beforeOpSubmit(message: IDocumentMessage) {\n\t\t// start with first client op and measure latency every 500 client ops\n\t\tif (\n\t\t\tthis.opLatencyLogger.isSamplingDisabled ||\n\t\t\t(this.clientSequenceNumberForLatencyStatistics === undefined &&\n\t\t\t\tmessage.clientSequenceNumber % OpPerfTelemetry.OP_LATENCY_SAMPLE_RATE === 1)\n\t\t) {\n\t\t\tassert(\n\t\t\t\tthis.latencyStatistics.get(message.clientSequenceNumber) === undefined,\n\t\t\t\t0x7c4 /* Existing op perf data for client sequence number */,\n\t\t\t);\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = message.clientSequenceNumber;\n\t\t\tthis.latencyStatistics.set(message.clientSequenceNumber, {\n\t\t\t\topProcessingTimes: {\n\t\t\t\t\tsubmitOpEventTime: Date.now(),\n\t\t\t\t},\n\t\t\t\topPerfData: {},\n\t\t\t});\n\t\t}\n\n\t\tif (message.type === MessageType.NoOp) {\n\t\t\t// Count the number of no-ops submitted by this client.\n\t\t\t// The value is reset when we log the OpStats sampled event.\n\t\t\tthis.noOpCountForTelemetry++;\n\t\t}\n\t}\n\n\tprivate afterProcessingOp(message: ISequencedDocumentMessage) {\n\t\tconst sequenceNumber = message.sequenceNumber;\n\n\t\tif (sequenceNumber === this.connectionOpSeqNumber) {\n\t\t\tthis.reportGettingUpToDate();\n\t\t}\n\n\t\t// Record collab window max size after every 1000th op.\n\t\tif (this.sequenceNumberForMsnTracking === undefined && sequenceNumber % 1000 === 0) {\n\t\t\tthis.sequenceNumberForMsnTracking = sequenceNumber;\n\t\t\tthis.msnTrackingTimestamp = message.timestamp;\n\t\t}\n\t\tif (\n\t\t\tthis.sequenceNumberForMsnTracking !== undefined &&\n\t\t\tmessage.minimumSequenceNumber >= this.sequenceNumberForMsnTracking\n\t\t) {\n\t\t\tassert(\n\t\t\t\tthis.msnTrackingTimestamp !== undefined,\n\t\t\t\t0x2ce /* \"msnTrackingTimestamp should not be undefined\" */,\n\t\t\t);\n\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\teventName: \"MsnStatistics\",\n\t\t\t\tsequenceNumber,\n\t\t\t\tmsnDistance: sequenceNumber - this.sequenceNumberForMsnTracking,\n\t\t\t\tduration: message.timestamp - this.msnTrackingTimestamp,\n\t\t\t});\n\t\t\tthis.sequenceNumberForMsnTracking = undefined;\n\t\t}\n\n\t\tif (\n\t\t\tthis.clientId === message.clientId &&\n\t\t\tmessage.type === MessageType.Operation &&\n\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber)\n\t\t) {\n\t\t\t// We do an explicit check for undefined right after this\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst latencyData = this.latencyStatistics.get(message.clientSequenceNumber)!;\n\t\t\tassert(latencyData !== undefined, 0x7c5 /* Undefined latency statistics for op */);\n\t\t\tassert(\n\t\t\t\tlatencyData.opProcessingTimes.submitOpEventTime !== undefined,\n\t\t\t\t0x120 /* \"Undefined latency statistics for op (op send time)\" */,\n\t\t\t);\n\t\t\tconst currentTime = Date.now();\n\t\t\tif (latencyData.opProcessingTimes.inboundPushEventTime !== undefined) {\n\t\t\t\tlatencyData.opPerfData.durationInboundToProcessing =\n\t\t\t\t\tcurrentTime - latencyData.opProcessingTimes.inboundPushEventTime;\n\t\t\t}\n\t\t\tconst duration = currentTime - latencyData.opProcessingTimes.submitOpEventTime;\n\n\t\t\t// One of the core expectations for Fluid service is to be fast.\n\t\t\t// When it's not the case, we want to learn about it and be able to investigate, so\n\t\t\t// raise awareness.\n\t\t\t// This also helps identify cases where it's due to client behavior (sending too many ops)\n\t\t\t// that results in overwhelming ordering service and thus starting to see long latencies.\n\t\t\t// The threshold could be adjusted, but ideally it stays workload-agnostic, as service\n\t\t\t// performance impacts all workloads relying on service.\n\t\t\tconst category = duration > latencyThreshold ? \"error\" : \"performance\";\n\t\t\tthis.opLatencyLogger.sendPerformanceEvent({\n\t\t\t\teventName: \"OpRoundtripTime\",\n\t\t\t\tsequenceNumber,\n\t\t\t\treferenceSequenceNumber: message.referenceSequenceNumber,\n\t\t\t\tduration,\n\t\t\t\tcategory,\n\t\t\t\tpingLatency: this.pingLatency,\n\t\t\t\tmsnDistance:\n\t\t\t\t\tthis.deltaManager.lastSequenceNumber - this.deltaManager.minimumSequenceNumber,\n\t\t\t\t...latencyData.opPerfData,\n\t\t\t});\n\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = undefined;\n\t\t\tthis.latencyStatistics.delete(message.clientSequenceNumber);\n\t\t}\n\n\t\tif (isRuntimeMessage(message)) {\n\t\t\t// Sampled logging of Ops that have been processed by the current client, the NoOp sent and the\n\t\t\t// size of the ops processed within one sampling window of this log event.\n\t\t\t// This data will be used to monitor the efficiency of NoOp-heuristics or to get approximate collab window size.\n\t\t\tthis.opsLogger.sendPerformanceEvent({\n\t\t\t\teventName: \"OpStats\",\n\t\t\t\t// Logging as 'details' property to avoid adding new column name to the log tables */\n\t\t\t\tdetails: {\n\t\t\t\t\t// Count of the ops processed by the current client. Note: these counts are after\n\t\t\t\t\t// compression/grouping/chunking (if enabled) of the ops.\n\t\t\t\t\tprocessedOpCount: OpPerfTelemetry.PROCESSED_OPS_SAMPLE_RATE,\n\t\t\t\t\t// Cumulative size of all the ops processed by the current client since the last OpStats event log\n\t\t\t\t\tprocessedOpSize: this.processedOpSizeForTelemetry,\n\t\t\t\t\t// Count of all the NoOp sent by the current client since the last OpStats event log\n\t\t\t\t\tsubmitedNoOpCount: this.noOpCountForTelemetry,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n}\nexport interface IPerfSignalReport {\n\t/**\n\t * Identifier to track broadcast signals being submitted in order to\n\t * allow collection of data around the roundtrip of signal messages.\n\t */\n\tbroadcastSignalSequenceNumber: number;\n\n\t/**\n\t * Accumulates the total number of broadcast signals sent during the current signal latency measurement window.\n\t * This value represents the total number of signals sent since the latency measurement began and is used\n\t * logged in telemetry when the latency measurement completes.\n\t */\n\ttotalSignalsSentInLatencyWindow: number;\n\n\t/**\n\t * Counts the number of broadcast signals sent since the last latency measurement was initiated.\n\t * This counter increments with each broadcast signal sent. When a new latency measurement starts,\n\t * this counter is added to `totalSignalsSentInLatencyWindow` and then reset to zero.\n\t */\n\tsignalsSentSinceLastLatencyMeasurement: number;\n\n\t/**\n\t * Number of signals that were expected but not received.\n\t */\n\tsignalsLost: number;\n\n\t/**\n\t * Number of signals received out of order/non-sequentially.\n\t */\n\tsignalsOutOfOrder: number;\n\n\t/**\n\t * Timestamp before submitting the signal we will trace.\n\t */\n\tsignalTimestamp: number;\n\n\t/**\n\t * Signal we will trace for roundtrip latency.\n\t */\n\troundTripSignalSequenceNumber: number | undefined;\n\n\t/**\n\t * Next expected signal sequence number to be received.\n\t */\n\ttrackingSignalSequenceNumber: number | undefined;\n\n\t/**\n\t * Inclusive lower bound of signal monitoring window.\n\t */\n\tminimumTrackingSignalSequenceNumber: number | undefined;\n}\n\n/**\n * Starts monitoring and generation of telemetry related to op performance.\n *\n * @param clientId - The clientId of the current container.\n * @param deltaManager - DeltaManager instance to monitor.\n * @param containerRuntimeEvents - Emitter of events for the container runtime.\n * @param logger - Telemetry logger to write events to.\n */\nexport function ReportOpPerfTelemetry(\n\tclientId: string | undefined,\n\tdeltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\tcontainerRuntimeEvents: IEventProvider<IContainerRuntimeEvents>,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tnew OpPerfTelemetry(clientId, deltaManager, containerRuntimeEvents, logger);\n}\n"]}
1
+ {"version":3,"file":"connectionTelemetry.js","sourceRoot":"","sources":["../src/connectionTelemetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAI3D,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAEN,WAAW,GAEX,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAIN,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,GACV,MAAM,0CAA0C,CAAC;AAElD;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAgCrC,MAAM,eAAe;IA8CpB;;;;;;;OAOG;IACH;IACC;;;;;;OAMG;IACK,QAA4B;IACpC;;OAEG;IACc,YAA+B;IAChD;;OAEG;IACH,sBAA+D;IAC/D;;OAEG;IACH,MAA2B;QAZnB,aAAQ,GAAR,QAAQ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H,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC;gBACnC,SAAS,EAAE,SAAS;gBACpB,qFAAqF;gBACrF,OAAO,EAAE;oBACR,iFAAiF;oBACjF,yDAAyD;oBACzD,gBAAgB,EAAE,eAAe,CAAC,yBAAyB;oBAC3D,kGAAkG;oBAClG,eAAe,EAAE,IAAI,CAAC,2BAA2B;oBACjD,oFAAoF;oBACpF,iBAAiB,EAAE,IAAI,CAAC,qBAAqB;iBAC7C;aACD,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;;AA5VuB,sCAAsB,GAAG,GAAG,AAAN,CAAO;AAG7B,yCAAyB,GAAG,GAAG,AAAN,CAAO;AAGhC,yCAAyB,GAAG,GAAG,AAAN,CAAO;AA4YzD;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CACpC,QAA4B,EAC5B,YAA+B,EAC/B,sBAA+D,EAC/D,MAA2B;IAE3B,IAAI,eAAe,CAAC,QAAQ,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,CAAC,CAAC;AAC7E,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performance } from \"@fluid-internal/client-utils\";\nimport { IDeltaManagerFull } from \"@fluidframework/container-definitions/internal\";\nimport { IContainerRuntimeEvents } from \"@fluidframework/container-runtime-definitions/internal\";\nimport { IEventProvider } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIDocumentMessage,\n\tMessageType,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { isRuntimeMessage } from \"@fluidframework/driver-utils/internal\";\nimport {\n\tIEventSampler,\n\tITelemetryLoggerExt,\n\tISampledTelemetryLogger,\n\tcreateChildLogger,\n\tcreateSampledLogger,\n\tformatTick,\n} from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * We report various latency-related errors when waiting for op roundtrip takes longer than that amout of time.\n */\nexport const latencyThreshold = 5000;\n\n// Phases in OpPerfTelemetry:\n// 1.\tOp is added to DeltaManager (DM) buffer.\n// 2.\tOp is sent to service (op leaves outbound queue).\n// \t - Note: We do not know for sure when op is sent, we only track when it is added to outbound queue.\n// If outbound queue is paused, time queue is paused is counted as network time.\n// 3.\tOp received from service back (pushed to inbound queue).\n// 4.\tOp is processed.\ninterface IOpPerfTelemetryProperties {\n\t/** Measure time between (1) and (2) - Measure time outbound op is sitting in queue due to active batch */\n\tdurationOutboundBatching: number; // was durationOutboundQueue in previous versions\n\t/** Measure time between (2) and (3) - Track how long it took for op to be acked by service */\n\tdurationNetwork: number; // was durationInboundQueue\n\t/** Measure time between (3) and (4) - Time between DM's inbound \"push\" event until DM's \"op\" event */\n\tdurationInboundToProcessing: number;\n\t/** Length of the DeltaManager's inbound queue at the time of the DM's inbound \"push\" event (3) */\n\tlengthInboundQueue: number;\n}\n\n/**\n * Timings collected at various moments during the op processing.\n */\ninterface IOpPerfTimings {\n\t/** Starting time for (1) */\n\tsubmitOpEventTime: number;\n\t/** Starting time for (2) */\n\toutboundPushEventTime: number;\n\t/** Starting time for (3) */\n\tinboundPushEventTime: number;\n}\n\nclass OpPerfTelemetry {\n\tprivate pingLatency: number | undefined;\n\n\t// Collab window tracking. This is timestamp of %1000 message.\n\tprivate sequenceNumberForMsnTracking: number | undefined;\n\tprivate msnTrackingTimestamp: number = 0;\n\t// To track round trip time for every %500 client message.\n\tprivate clientSequenceNumberForLatencyStatistics: number | undefined;\n\t// Performance Data to be reported for ops round trips and processing.\n\tprivate readonly latencyStatistics = new Map<\n\t\tnumber,\n\t\t{\n\t\t\topProcessingTimes: Partial<IOpPerfTimings>;\n\t\t\topPerfData: Partial<IOpPerfTelemetryProperties>;\n\t\t}\n\t>();\n\n\tprivate firstConnection = true;\n\tprivate connectionOpSeqNumber: number | undefined;\n\tprivate readonly bootTime = performance.now();\n\tprivate connectionStartTime = 0;\n\tprivate gap = 0;\n\n\t/** Count of no-ops sent by this client. This variable is reset everytime the OpStats sampled event is logged */\n\tprivate noOpCountForTelemetry = 0;\n\t/** Cumulative size of the ops processed by this client. This variable is reset everytime the OpStats sampled event is logged */\n\tprivate processedOpSizeForTelemetry = 0;\n\n\tprivate readonly logger: ITelemetryLoggerExt;\n\n\tprivate static readonly OP_LATENCY_SAMPLE_RATE = 500;\n\tprivate readonly opLatencyLogger: ISampledTelemetryLogger;\n\n\tprivate static readonly DELTA_LATENCY_SAMPLE_RATE = 100;\n\tprivate readonly deltaLatencyLogger: ISampledTelemetryLogger;\n\n\tprivate static readonly PROCESSED_OPS_SAMPLE_RATE = 500;\n\n\t/**\n\t * A sampled logger to log Ops that have been processed by the current client, the NoOp sent and the\n\t * size of the ops processed within one sampling window of this log event.\n\t * The data from this logger will be used to monitor the efficiency of NoOp-heuristics or to get approximate collab window size.\n\t * Note: no log events are sent when sampling is disabled, because logging at every op will be too noisy.\n\t */\n\tprivate readonly opsLogger: ISampledTelemetryLogger;\n\n\t/**\n\t * Create an instance of OpPerfTelemetry which starts monitoring and generating telemetry related to op performance.\n\t *\n\t * @param clientId - The clientId of the current container.\n\t * @param deltaManager - DeltaManager instance to monitor.\n\t * @param containerRuntimeEvents - Emitter of events for the container runtime.\n\t * @param logger - Telemetry logger to write events to.\n\t */\n\tpublic constructor(\n\t\t/**\n\t\t * The clientId of the current container.\n\t\t *\n\t\t * @remarks Until the container connects to the server and receives an ack for its own join op, this can be undefined.\n\t\t * It gets updated in response to event changes once the value provided by the server is available.\n\t\t * If the container loses its connection, this could be the last known clientId.\n\t\t */\n\t\tprivate clientId: string | undefined,\n\t\t/**\n\t\t * DeltaManager instance to monitor.\n\t\t */\n\t\tprivate readonly deltaManager: IDeltaManagerFull,\n\t\t/**\n\t\t * Emitter of events for the container runtime.\n\t\t */\n\t\tcontainerRuntimeEvents: IEventProvider<IContainerRuntimeEvents>,\n\t\t/**\n\t\t * Telemetry logger to write events to.\n\t\t */\n\t\tlogger: ITelemetryLoggerExt,\n\t) {\n\t\tthis.logger = createChildLogger({ logger, namespace: \"OpPerf\" });\n\n\t\tconst deltaLatencyEventSampler: IEventSampler = (() => {\n\t\t\tlet eventCount = -1;\n\t\t\treturn {\n\t\t\t\tsample: () => {\n\t\t\t\t\teventCount++;\n\t\t\t\t\tconst shouldSample = eventCount % OpPerfTelemetry.DELTA_LATENCY_SAMPLE_RATE === 0;\n\t\t\t\t\tif (shouldSample) {\n\t\t\t\t\t\teventCount = 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn shouldSample;\n\t\t\t\t},\n\t\t\t};\n\t\t})();\n\n\t\tthis.deltaLatencyLogger = createSampledLogger(logger, deltaLatencyEventSampler);\n\n\t\t// The SampledLogger here is used get access to the isSamplingDisabled property derived from\n\t\t// telemetry config properties. The actual sampling logic for op messages happens outside this SampledLogger\n\t\t// due to complexity of the different asynchronus scenarios of the op message lifecycle.\n\t\tthis.opLatencyLogger = createSampledLogger(logger);\n\n\t\tconst opsEventSampler: IEventSampler = (() => {\n\t\t\tlet eventCount = 0;\n\t\t\treturn {\n\t\t\t\tsample: () => {\n\t\t\t\t\teventCount++;\n\t\t\t\t\tconst shouldSample = eventCount % OpPerfTelemetry.PROCESSED_OPS_SAMPLE_RATE === 0;\n\t\t\t\t\tif (shouldSample) {\n\t\t\t\t\t\teventCount = 0;\n\t\t\t\t\t\tthis.noOpCountForTelemetry = 0;\n\t\t\t\t\t\tthis.processedOpSizeForTelemetry = 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn shouldSample;\n\t\t\t\t},\n\t\t\t};\n\t\t})();\n\t\tthis.opsLogger = createSampledLogger(\n\t\t\tlogger,\n\t\t\topsEventSampler,\n\t\t\ttrue /* skipLoggingWhenSamplingIsDisabled */,\n\t\t);\n\n\t\tthis.deltaManager.on(\"pong\", (latency) => this.recordPingTime(latency));\n\t\tthis.deltaManager.on(\"submitOp\", (message) => this.beforeOpSubmit(message));\n\t\tthis.deltaManager.on(\"op\", (message) => this.afterProcessingOp(message));\n\t\tthis.deltaManager.on(\"connect\", (details, opsBehind) => {\n\t\t\tif (opsBehind !== undefined) {\n\t\t\t\tthis.connectionOpSeqNumber = this.deltaManager.lastKnownSeqNumber;\n\t\t\t\tthis.gap = opsBehind;\n\t\t\t\tthis.connectionStartTime = performance.now();\n\n\t\t\t\t// We might be already up-today. If so, report it right away.\n\t\t\t\tif (this.gap <= 0) {\n\t\t\t\t\tthis.reportGettingUpToDate();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.deltaManager.on(\"disconnect\", () => {\n\t\t\tthis.sequenceNumberForMsnTracking = undefined;\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = undefined;\n\t\t\tthis.connectionOpSeqNumber = undefined;\n\t\t\tthis.firstConnection = false;\n\t\t\tthis.latencyStatistics.clear();\n\t\t});\n\n\t\tthis.deltaManager.outbound.on(\"push\", (messages) => {\n\t\t\tfor (const msg of messages) {\n\t\t\t\tif (\n\t\t\t\t\tmsg.type === MessageType.Operation &&\n\t\t\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === msg.clientSequenceNumber)\n\t\t\t\t) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tconst latencyStats = this.latencyStatistics.get(msg.clientSequenceNumber)!;\n\t\t\t\t\tassert(latencyStats !== undefined, 0x7c2 /* Latency stats for op should exist */);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime === undefined,\n\t\t\t\t\t\t0x2c8 /* \"outboundPushEventTime should be undefined\" */,\n\t\t\t\t\t);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opPerfData.durationNetwork === undefined,\n\t\t\t\t\t\t0x2c9 /* \"durationNetwork should be undefined\" */,\n\t\t\t\t\t);\n\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime = Date.now();\n\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opPerfData.durationOutboundBatching === undefined,\n\t\t\t\t\t\t0x2ca /* \"durationOutboundBatching should be undefined\" */,\n\t\t\t\t\t);\n\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.submitOpEventTime !== undefined,\n\t\t\t\t\t\t0x2cb /* \"submitOpEventTime should be undefined\" */,\n\t\t\t\t\t);\n\n\t\t\t\t\tlatencyStats.opPerfData.durationOutboundBatching =\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime -\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.submitOpEventTime;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tthis.deltaManager.inbound.on(\"push\", (message: ISequencedDocumentMessage) => {\n\t\t\tif (\n\t\t\t\tthis.clientId === message.clientId &&\n\t\t\t\tmessage.type === MessageType.Operation &&\n\t\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber)\n\t\t\t) {\n\t\t\t\t// We do an explicit check for undefined right after this\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tconst latencyStats = this.latencyStatistics.get(message.clientSequenceNumber)!;\n\t\t\t\tassert(latencyStats !== undefined, 0x7c3 /* Latency stats for op should exist */);\n\t\t\t\tif (latencyStats.opProcessingTimes.outboundPushEventTime !== undefined) {\n\t\t\t\t\tlatencyStats.opProcessingTimes.inboundPushEventTime = Date.now();\n\t\t\t\t\tlatencyStats.opPerfData.durationNetwork =\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.inboundPushEventTime -\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime;\n\t\t\t\t\tlatencyStats.opPerfData.lengthInboundQueue = this.deltaManager.inbound.length;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isRuntimeMessage(message) && typeof message.contents === \"string\") {\n\t\t\t\tthis.processedOpSizeForTelemetry += message.contents.length;\n\t\t\t}\n\t\t});\n\n\t\tthis.deltaManager.inbound.on(\"idle\", (count: number, duration: number) => {\n\t\t\t// Do not want to log zero for sure.\n\t\t\t// We are more interested in aggregates, so logging only if we are processing some number of ops\n\t\t\t// Cut-off is arbitrary - can be increased or decreased based on amount of data collected and questions we\n\t\t\t// want to get answered\n\t\t\t// back-compat: Once 0.36 loader version saturates (count & duration args were added there),\n\t\t\t// we can remove typeof check.\n\t\t\tif (typeof count === \"number\" && count >= 100) {\n\t\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\t\teventName: \"GetDeltas_OpProcessing\",\n\t\t\t\t\tcount,\n\t\t\t\t\tduration,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tcontainerRuntimeEvents.on(\"connected\", (newClientId) => {\n\t\t\tthis.clientId = newClientId;\n\t\t});\n\t}\n\n\tprivate reportGettingUpToDate() {\n\t\tthis.connectionOpSeqNumber = undefined;\n\t\tthis.logger.sendPerformanceEvent({\n\t\t\teventName: \"ConnectionSpeed\",\n\t\t\tduration: performance.now() - this.connectionStartTime,\n\t\t\tops: this.gap,\n\t\t\t// track time to connect only for first connection.\n\t\t\ttimeToConnect: this.firstConnection\n\t\t\t\t? formatTick(this.connectionStartTime - this.bootTime)\n\t\t\t\t: undefined,\n\t\t\tfirstConnection: this.firstConnection,\n\t\t});\n\t}\n\n\tprivate recordPingTime(latency: number) {\n\t\tthis.pingLatency = latency;\n\n\t\t// Log if latency is longer than 1 min\n\t\tif (latency > 1000 * 60) {\n\t\t\tthis.logger.sendErrorEvent({\n\t\t\t\teventName: \"LatencyTooLong\",\n\t\t\t\tduration: latency,\n\t\t\t});\n\t\t}\n\n\t\t// logging one in every DELTA_LATENCY_SAMPLE_RATE pongs, including the first time, if it is a \"write\" client.\n\t\tif (this.deltaManager.active) {\n\t\t\tthis.deltaLatencyLogger.sendPerformanceEvent({\n\t\t\t\teventName: \"DeltaLatency\",\n\t\t\t\tduration: latency,\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate beforeOpSubmit(message: IDocumentMessage) {\n\t\t// start with first client op and measure latency every 500 client ops\n\t\tif (\n\t\t\tthis.opLatencyLogger.isSamplingDisabled ||\n\t\t\t(this.clientSequenceNumberForLatencyStatistics === undefined &&\n\t\t\t\tmessage.clientSequenceNumber % OpPerfTelemetry.OP_LATENCY_SAMPLE_RATE === 1)\n\t\t) {\n\t\t\tassert(\n\t\t\t\tthis.latencyStatistics.get(message.clientSequenceNumber) === undefined,\n\t\t\t\t0x7c4 /* Existing op perf data for client sequence number */,\n\t\t\t);\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = message.clientSequenceNumber;\n\t\t\tthis.latencyStatistics.set(message.clientSequenceNumber, {\n\t\t\t\topProcessingTimes: {\n\t\t\t\t\tsubmitOpEventTime: Date.now(),\n\t\t\t\t},\n\t\t\t\topPerfData: {},\n\t\t\t});\n\t\t}\n\n\t\tif (message.type === MessageType.NoOp) {\n\t\t\t// Count the number of no-ops submitted by this client.\n\t\t\t// The value is reset when we log the OpStats sampled event.\n\t\t\tthis.noOpCountForTelemetry++;\n\t\t}\n\t}\n\n\tprivate afterProcessingOp(message: ISequencedDocumentMessage) {\n\t\tconst sequenceNumber = message.sequenceNumber;\n\n\t\tif (sequenceNumber === this.connectionOpSeqNumber) {\n\t\t\tthis.reportGettingUpToDate();\n\t\t}\n\n\t\t// Record collab window max size after every 1000th op.\n\t\tif (this.sequenceNumberForMsnTracking === undefined && sequenceNumber % 1000 === 0) {\n\t\t\tthis.sequenceNumberForMsnTracking = sequenceNumber;\n\t\t\tthis.msnTrackingTimestamp = message.timestamp;\n\t\t}\n\t\tif (\n\t\t\tthis.sequenceNumberForMsnTracking !== undefined &&\n\t\t\tmessage.minimumSequenceNumber >= this.sequenceNumberForMsnTracking\n\t\t) {\n\t\t\tassert(\n\t\t\t\tthis.msnTrackingTimestamp !== undefined,\n\t\t\t\t0x2ce /* \"msnTrackingTimestamp should not be undefined\" */,\n\t\t\t);\n\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\teventName: \"MsnStatistics\",\n\t\t\t\tsequenceNumber,\n\t\t\t\tmsnDistance: sequenceNumber - this.sequenceNumberForMsnTracking,\n\t\t\t\tduration: message.timestamp - this.msnTrackingTimestamp,\n\t\t\t});\n\t\t\tthis.sequenceNumberForMsnTracking = undefined;\n\t\t}\n\n\t\tif (\n\t\t\tthis.clientId === message.clientId &&\n\t\t\tmessage.type === MessageType.Operation &&\n\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber)\n\t\t) {\n\t\t\t// We do an explicit check for undefined right after this\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst latencyData = this.latencyStatistics.get(message.clientSequenceNumber)!;\n\t\t\tassert(latencyData !== undefined, 0x7c5 /* Undefined latency statistics for op */);\n\t\t\tassert(\n\t\t\t\tlatencyData.opProcessingTimes.submitOpEventTime !== undefined,\n\t\t\t\t0x120 /* \"Undefined latency statistics for op (op send time)\" */,\n\t\t\t);\n\t\t\tconst currentTime = Date.now();\n\t\t\tif (latencyData.opProcessingTimes.inboundPushEventTime !== undefined) {\n\t\t\t\tlatencyData.opPerfData.durationInboundToProcessing =\n\t\t\t\t\tcurrentTime - latencyData.opProcessingTimes.inboundPushEventTime;\n\t\t\t}\n\t\t\tconst duration = currentTime - latencyData.opProcessingTimes.submitOpEventTime;\n\n\t\t\t// One of the core expectations for Fluid service is to be fast.\n\t\t\t// When it's not the case, we want to learn about it and be able to investigate, so\n\t\t\t// raise awareness.\n\t\t\t// This also helps identify cases where it's due to client behavior (sending too many ops)\n\t\t\t// that results in overwhelming ordering service and thus starting to see long latencies.\n\t\t\t// The threshold could be adjusted, but ideally it stays workload-agnostic, as service\n\t\t\t// performance impacts all workloads relying on service.\n\t\t\tconst category = duration > latencyThreshold ? \"error\" : \"performance\";\n\t\t\tthis.opLatencyLogger.sendPerformanceEvent({\n\t\t\t\teventName: \"OpRoundtripTime\",\n\t\t\t\tsequenceNumber,\n\t\t\t\treferenceSequenceNumber: message.referenceSequenceNumber,\n\t\t\t\tduration,\n\t\t\t\tcategory,\n\t\t\t\tpingLatency: this.pingLatency,\n\t\t\t\tmsnDistance:\n\t\t\t\t\tthis.deltaManager.lastSequenceNumber - this.deltaManager.minimumSequenceNumber,\n\t\t\t\t...latencyData.opPerfData,\n\t\t\t});\n\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = undefined;\n\t\t\tthis.latencyStatistics.delete(message.clientSequenceNumber);\n\t\t}\n\n\t\tif (isRuntimeMessage(message)) {\n\t\t\t// Sampled logging of Ops that have been processed by the current client, the NoOp sent and the\n\t\t\t// size of the ops processed within one sampling window of this log event.\n\t\t\t// This data will be used to monitor the efficiency of NoOp-heuristics or to get approximate collab window size.\n\t\t\tthis.opsLogger.sendPerformanceEvent({\n\t\t\t\teventName: \"OpStats\",\n\t\t\t\t// Logging as 'details' property to avoid adding new column name to the log tables */\n\t\t\t\tdetails: {\n\t\t\t\t\t// Count of the ops processed by the current client. Note: these counts are after\n\t\t\t\t\t// compression/grouping/chunking (if enabled) of the ops.\n\t\t\t\t\tprocessedOpCount: OpPerfTelemetry.PROCESSED_OPS_SAMPLE_RATE,\n\t\t\t\t\t// Cumulative size of all the ops processed by the current client since the last OpStats event log\n\t\t\t\t\tprocessedOpSize: this.processedOpSizeForTelemetry,\n\t\t\t\t\t// Count of all the NoOp sent by the current client since the last OpStats event log\n\t\t\t\t\tsubmitedNoOpCount: this.noOpCountForTelemetry,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n}\nexport interface IPerfSignalReport {\n\t/**\n\t * Identifier to track broadcast signals being submitted in order to\n\t * allow collection of data around the roundtrip of signal messages.\n\t */\n\tbroadcastSignalSequenceNumber: number;\n\n\t/**\n\t * Accumulates the total number of broadcast signals sent during the current signal latency measurement window.\n\t * This value represents the total number of signals sent since the latency measurement began and is used\n\t * logged in telemetry when the latency measurement completes.\n\t */\n\ttotalSignalsSentInLatencyWindow: number;\n\n\t/**\n\t * Counts the number of broadcast signals sent since the last latency measurement was initiated.\n\t * This counter increments with each broadcast signal sent. When a new latency measurement starts,\n\t * this counter is added to `totalSignalsSentInLatencyWindow` and then reset to zero.\n\t */\n\tsignalsSentSinceLastLatencyMeasurement: number;\n\n\t/**\n\t * Number of signals that were expected but not received.\n\t */\n\tsignalsLost: number;\n\n\t/**\n\t * Number of signals received out of order/non-sequentially.\n\t */\n\tsignalsOutOfOrder: number;\n\n\t/**\n\t * Timestamp before submitting the signal we will trace.\n\t */\n\tsignalTimestamp: number;\n\n\t/**\n\t * Signal we will trace for roundtrip latency.\n\t */\n\troundTripSignalSequenceNumber: number | undefined;\n\n\t/**\n\t * Next expected signal sequence number to be received.\n\t */\n\ttrackingSignalSequenceNumber: number | undefined;\n\n\t/**\n\t * Inclusive lower bound of signal monitoring window.\n\t */\n\tminimumTrackingSignalSequenceNumber: number | undefined;\n}\n\n/**\n * Starts monitoring and generation of telemetry related to op performance.\n *\n * @param clientId - The clientId of the current container.\n * @param deltaManager - DeltaManager instance to monitor.\n * @param containerRuntimeEvents - Emitter of events for the container runtime.\n * @param logger - Telemetry logger to write events to.\n */\nexport function ReportOpPerfTelemetry(\n\tclientId: string | undefined,\n\tdeltaManager: IDeltaManagerFull,\n\tcontainerRuntimeEvents: IEventProvider<IContainerRuntimeEvents>,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tnew OpPerfTelemetry(clientId, deltaManager, containerRuntimeEvents, logger);\n}\n"]}
@@ -493,7 +493,8 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
493
493
  * accesses such as sets "read-only" mode for the summarizer client. This is the default delta manager that should
494
494
  * be used unless the innerDeltaManager is required.
495
495
  */
496
- readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
496
+ get deltaManager(): IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
497
+ private readonly _deltaManager;
497
498
  /**
498
499
  * The delta manager provided by the container context. By default, using the default delta manager (proxy)
499
500
  * should be sufficient. This should be used only if necessary. For example, for validating and propagating connected