@fluidframework/container-runtime 0.58.2000 → 0.58.3000-61081
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blobManager.d.ts +3 -2
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +13 -9
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +63 -23
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +12 -4
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +61 -15
- package/dist/containerRuntime.js.map +1 -1
- package/dist/opTelemetry.d.ts +22 -0
- package/dist/opTelemetry.d.ts.map +1 -0
- package/dist/opTelemetry.js +59 -0
- package/dist/opTelemetry.js.map +1 -0
- package/dist/orderedClientElection.d.ts +57 -6
- package/dist/orderedClientElection.d.ts.map +1 -1
- package/dist/orderedClientElection.js +140 -25
- package/dist/orderedClientElection.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/summarizerClientElection.d.ts +2 -0
- package/dist/summarizerClientElection.d.ts.map +1 -1
- package/dist/summarizerClientElection.js +7 -2
- package/dist/summarizerClientElection.js.map +1 -1
- package/dist/summarizerTypes.d.ts +9 -0
- package/dist/summarizerTypes.d.ts.map +1 -1
- package/dist/summarizerTypes.js.map +1 -1
- package/dist/summaryGenerator.d.ts.map +1 -1
- package/dist/summaryGenerator.js +1 -1
- package/dist/summaryGenerator.js.map +1 -1
- package/dist/summaryManager.d.ts.map +1 -1
- package/dist/summaryManager.js +14 -3
- package/dist/summaryManager.js.map +1 -1
- package/lib/blobManager.d.ts +3 -2
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +14 -10
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +63 -23
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +12 -4
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +62 -16
- package/lib/containerRuntime.js.map +1 -1
- package/lib/opTelemetry.d.ts +22 -0
- package/lib/opTelemetry.d.ts.map +1 -0
- package/lib/opTelemetry.js +55 -0
- package/lib/opTelemetry.js.map +1 -0
- package/lib/orderedClientElection.d.ts +57 -6
- package/lib/orderedClientElection.d.ts.map +1 -1
- package/lib/orderedClientElection.js +140 -25
- package/lib/orderedClientElection.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/summarizerClientElection.d.ts +2 -0
- package/lib/summarizerClientElection.d.ts.map +1 -1
- package/lib/summarizerClientElection.js +7 -2
- package/lib/summarizerClientElection.js.map +1 -1
- package/lib/summarizerTypes.d.ts +9 -0
- package/lib/summarizerTypes.d.ts.map +1 -1
- package/lib/summarizerTypes.js.map +1 -1
- package/lib/summaryGenerator.d.ts.map +1 -1
- package/lib/summaryGenerator.js +1 -1
- package/lib/summaryGenerator.js.map +1 -1
- package/lib/summaryManager.d.ts.map +1 -1
- package/lib/summaryManager.js +14 -3
- package/lib/summaryManager.js.map +1 -1
- package/package.json +47 -15
- package/src/blobManager.ts +19 -11
- package/src/connectionTelemetry.ts +110 -19
- package/src/containerRuntime.ts +85 -19
- package/src/opTelemetry.ts +71 -0
- package/src/orderedClientElection.ts +154 -25
- package/src/packageVersion.ts +1 -1
- package/src/summarizerClientElection.ts +7 -2
- package/src/summarizerTypes.ts +9 -0
- package/src/summaryGenerator.ts +9 -1
- package/src/summaryManager.ts +15 -4
package/dist/blobManager.d.ts
CHANGED
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { IFluidHandle, IFluidHandleContext } from "@fluidframework/core-interfaces";
|
|
6
6
|
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
7
|
-
import { ISnapshotTree
|
|
7
|
+
import { ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
8
8
|
import { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
9
9
|
import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
|
|
10
|
+
import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
|
|
10
11
|
/**
|
|
11
12
|
* This class represents blob (long string)
|
|
12
13
|
* This object is used only when creating (writing) new blob and serialization purposes.
|
|
@@ -69,7 +70,7 @@ export declare class BlobManager {
|
|
|
69
70
|
* attachment types returned in snapshot() with blobs.
|
|
70
71
|
*/
|
|
71
72
|
private load;
|
|
72
|
-
|
|
73
|
+
summarize(): ISummaryTreeWithStats;
|
|
73
74
|
setRedirectTable(table: Map<string, string>): void;
|
|
74
75
|
}
|
|
75
76
|
//# sourceMappingURL=blobManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blobManager.d.ts","sourceRoot":"","sources":["../src/blobManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"blobManager.d.ts","sourceRoot":"","sources":["../src/blobManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,qB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AAC,MAAM,EAAE,MAAM,KAAK,IAAI,EAC5C,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,gBAAgB;IAU7C,OAAO,CAAC,OAAO;IAIF,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;IAsB/D,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;IAmC/E,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;IAUzD;;OAEG;WACiB,IAAI,CACpB,SAAS,EAAE,aAAa,GAAG,SAAS,EACpC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GAC1D,OAAO,CAAC,oBAAoB,CAAC;IAchC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,IAAI;IAeL,SAAS,IAAI,qBAAqB;IAoBlC,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;CAWrD"}
|
package/dist/blobManager.js
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.BlobManager = exports.BlobHandle = void 0;
|
|
8
|
-
const protocol_base_1 = require("@fluidframework/protocol-base");
|
|
9
8
|
const runtime_utils_1 = require("@fluidframework/runtime-utils");
|
|
10
9
|
const common_utils_1 = require("@fluidframework/common-utils");
|
|
11
10
|
const container_definitions_1 = require("@fluidframework/container-definitions");
|
|
@@ -103,10 +102,12 @@ class BlobManager {
|
|
|
103
102
|
return handle;
|
|
104
103
|
}
|
|
105
104
|
processBlobAttachOp(blobId, local) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
105
|
+
if (local) {
|
|
106
|
+
const pendingBlobP = this.pendingBlobIds.get(blobId);
|
|
107
|
+
common_utils_1.assert(pendingBlobP !== undefined, 0x1f8 /* "local BlobAttach op with no pending blob" */);
|
|
108
|
+
pendingBlobP.resolve();
|
|
109
|
+
this.pendingBlobIds.delete(blobId);
|
|
110
|
+
}
|
|
110
111
|
this.blobIds.add(blobId);
|
|
111
112
|
}
|
|
112
113
|
/**
|
|
@@ -154,16 +155,19 @@ class BlobManager {
|
|
|
154
155
|
redirectTable: (_c = snapshot.redirectTable) === null || _c === void 0 ? void 0 : _c.length,
|
|
155
156
|
});
|
|
156
157
|
}
|
|
157
|
-
|
|
158
|
+
summarize() {
|
|
158
159
|
// If we have a redirect table it means the container is about to transition to "Attaching" state, so we need
|
|
159
160
|
// to return an actual snapshot containing all the real storage IDs we know about.
|
|
160
161
|
const attachingOrAttached = !!this.redirectTable || this.runtime.attachState !== container_definitions_1.AttachState.Detached;
|
|
161
162
|
const blobIds = attachingOrAttached ? this.blobIds : this.detachedBlobIds;
|
|
162
|
-
const
|
|
163
|
+
const builder = new runtime_utils_1.SummaryTreeBuilder();
|
|
164
|
+
blobIds.forEach((blobId) => {
|
|
165
|
+
builder.addAttachment(blobId);
|
|
166
|
+
});
|
|
163
167
|
if (this.redirectTable && this.redirectTable.size > 0) {
|
|
164
|
-
|
|
168
|
+
builder.addBlob(BlobManager.redirectTableBlobName, JSON.stringify(Array.from(this.redirectTable.entries())));
|
|
165
169
|
}
|
|
166
|
-
return
|
|
170
|
+
return builder.getSummaryTree();
|
|
167
171
|
}
|
|
168
172
|
setRedirectTable(table) {
|
|
169
173
|
common_utils_1.assert(this.runtime.attachState === container_definitions_1.AttachState.Detached, 0x252 /* "redirect table can only be set in detached container" */);
|
package/dist/blobManager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blobManager.js","sourceRoot":"","sources":["../src/blobManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,iEAAmF;AAEnF,iEAA0E;AAE1E,+DAAgE;AAEhE,iFA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CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAC5D,CAAC;SACL;QACD,OAAO,EAAE,OAAO,EAAE,CAAC;IACvB,CAAC;IAEM,gBAAgB,CAAC,KAA0B;QAC9C,qBAAM,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,KAAK,mCAAW,CAAC,QAAQ,EACpD,KAAK,CAAC,4DAA4D,CAAC,CAAC;QACxE,qBAAM,CAAC,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACzE,KAAK,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,KAAK,EAAE;YACtC,qBAAM,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,yCAAyC,CAAC,CAAC;YAC9F,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;SAC/B;QACD,qBAAM,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,EAAE,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACjG,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC/B,CAAC;;AA3KL,kCA4KC;AA3K0B,oBAAQ,GAAG,QAAQ,CAAC;AACnB,iCAAqB,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle, IFluidHandleContext } from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { AttachmentTreeEntry, BlobTreeEntry } from \"@fluidframework/protocol-base\";\nimport { ISnapshotTree, ITree, ITreeEntry } from \"@fluidframework/protocol-definitions\";\nimport { generateHandleContextPath } from \"@fluidframework/runtime-utils\";\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { assert, Deferred } from \"@fluidframework/common-utils\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\n\n/**\n * This class represents blob (long string)\n * This object is used only when creating (writing) new blob and serialization purposes.\n * De-serialization process goes through FluidObjectHandle and request flow:\n * DataObject.request() recognizes requests in the form of `/blobs/<id>`\n * and loads blob.\n */\nexport class BlobHandle implements IFluidHandle<ArrayBufferLike> {\n private attached: boolean = false;\n\n public get IFluidHandle(): IFluidHandle { return this; }\n\n public get isAttached(): boolean {\n return this.attached;\n }\n\n public readonly absolutePath: string;\n\n constructor(\n public readonly path: string,\n public readonly routeContext: IFluidHandleContext,\n public get: () => Promise<any>,\n ) {\n this.absolutePath = generateHandleContextPath(path, this.routeContext);\n }\n\n public attachGraph() {\n this.attached = true;\n }\n\n public bind(handle: IFluidHandle) {\n throw new Error(\"Cannot bind to blob handle\");\n }\n}\n\n/**\n * Information from a snapshot needed to load BlobManager\n */\nexport interface IBlobManagerLoadInfo {\n ids?: string[],\n redirectTable?: [string, string][],\n}\n\nexport class BlobManager {\n public static readonly basePath = \"_blobs\";\n private static readonly redirectTableBlobName = \".redirectTable\";\n // uploaded blob IDs\n private readonly blobIds: Set<string> = new Set();\n // blobs for which upload is pending. maps to a promise that will resolve once the blob has been uploaded and a\n // BlobAttach op has round-tripped.\n private readonly pendingBlobIds: Map<string, Deferred<void>> = new Map();\n // blobs uploaded while detached; cleared upon attach\n private readonly detachedBlobIds: Set<string> = new Set();\n // map of detached blob IDs to IDs used by storage. used to support blob handles given out while detached\n private redirectTable: Map<string, string> | undefined;\n\n constructor(\n private readonly routeContext: IFluidHandleContext,\n snapshot: IBlobManagerLoadInfo,\n private readonly getStorage: () => IDocumentStorageService,\n private readonly attachBlobCallback: (blobId: string) => void,\n private readonly runtime: IContainerRuntime,\n private readonly logger: ITelemetryLogger,\n ) {\n this.runtime.once(\"dispose\", () => {\n for (const promise of this.pendingBlobIds.values()) {\n promise.reject(new Error(\"runtime disposed while blobAttach op in flight\"));\n }\n });\n this.load(snapshot);\n }\n\n private hasBlob(id: string): boolean {\n return this.blobIds.has(id) || this.detachedBlobIds.has(id);\n }\n\n public async getBlob(blobId: string): Promise<IFluidHandle<ArrayBufferLike>> {\n const storageId = this.redirectTable?.get(blobId) ?? blobId;\n assert(this.hasBlob(storageId), 0x11f /* \"requesting unknown blobs\" */);\n\n return new BlobHandle(\n `${BlobManager.basePath}/${storageId}`,\n this.routeContext,\n async () => {\n return this.getStorage().readBlob(storageId).catch((error) => {\n this.logger.sendErrorEvent(\n {\n eventName:\"AttachmentReadBlobError\",\n id: storageId,\n },\n error,\n );\n throw error;\n });\n },\n );\n }\n\n public async createBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>> {\n if (this.runtime.attachState === AttachState.Attaching) {\n // blob upload is not supported in \"Attaching\" state\n this.logger.sendTelemetryEvent({ eventName: \"CreateBlobWhileAttaching\" });\n await new Promise<void>((resolve) => this.runtime.once(\"attached\", resolve));\n }\n\n const response = await this.getStorage().createBlob(blob);\n const handle = new BlobHandle(\n `${BlobManager.basePath}/${response.id}`,\n this.routeContext,\n // get() should go through BlobManager.getBlob() so handles created while detached can be redirected\n // to the correct storage id after they are uploaded\n async () => this.getBlob(response.id).then(async (h) => h.get()),\n );\n\n if (this.runtime.attachState === AttachState.Detached) {\n this.detachedBlobIds.add(response.id);\n return handle;\n }\n\n // Note - server will de-dup blobs, so we might get existing blobId!\n if (this.pendingBlobIds.has(response.id)) {\n await this.pendingBlobIds.get(response.id)?.promise;\n } else if (!this.blobIds.has(response.id)) {\n this.pendingBlobIds.set(response.id, new Deferred<void>());\n\n // send blob attach op and wait until we see it to return the handle\n this.attachBlobCallback(response.id);\n await this.pendingBlobIds.get(response.id)?.promise;\n }\n\n return handle;\n }\n\n public processBlobAttachOp(blobId: string, local: boolean) {\n assert(!local || this.pendingBlobIds.has(blobId), 0x1f8 /* \"local BlobAttach op with no pending blob\" */);\n this.pendingBlobIds.get(blobId)?.resolve();\n this.pendingBlobIds.delete(blobId);\n this.blobIds.add(blobId);\n }\n\n /**\n * Reads blobs needed to load BlobManager from storage.\n */\n public static async load(\n blobsTree: ISnapshotTree | undefined,\n tryFetchBlob: (id: string) => Promise<[string, string][]>,\n ): Promise<IBlobManagerLoadInfo> {\n if (!blobsTree) {\n return {};\n }\n let redirectTable;\n const tableId = blobsTree.blobs[this.redirectTableBlobName];\n if (tableId) {\n redirectTable = await tryFetchBlob(tableId);\n }\n const ids = Object.entries(blobsTree.blobs)\n .filter(([k, _]) => k !== this.redirectTableBlobName).map(([_, v]) => v);\n return { ids, redirectTable };\n }\n\n /**\n * Load a set of previously attached blob IDs from a previous snapshot. Note\n * that BlobManager tracking and reporting attached blobs is a temporary\n * solution since storage expects attached blobs to be reported and any that\n * are not reported as attached may be GCed. In the future attached blob\n * IDs will be collected at summarization time, and runtime will not care\n * about the existence or specific formatting of this tree in returned\n * snapshots.\n *\n * @param blobsTree - Tree containing IDs of previously attached blobs. This\n * corresponds to snapshot() below. We look for the IDs in the blob entries\n * of the tree since the both the r11s and SPO drivers replace the\n * attachment types returned in snapshot() with blobs.\n */\n private load(snapshot: IBlobManagerLoadInfo): void {\n if (snapshot.ids) {\n const detached = this.runtime.attachState === AttachState.Detached;\n snapshot.ids.map((entry) => detached ? this.detachedBlobIds.add(entry) : this.blobIds.add(entry));\n }\n if (snapshot.redirectTable) {\n this.redirectTable = new Map(snapshot.redirectTable);\n }\n this.logger.sendTelemetryEvent({\n eventName: \"AttachmentBlobsLoaded\",\n count: snapshot.ids?.length ?? 0,\n redirectTable: snapshot.redirectTable?.length,\n });\n }\n\n public snapshot(): ITree {\n // If we have a redirect table it means the container is about to transition to \"Attaching\" state, so we need\n // to return an actual snapshot containing all the real storage IDs we know about.\n const attachingOrAttached = !!this.redirectTable || this.runtime.attachState !== AttachState.Detached;\n const blobIds = attachingOrAttached ? this.blobIds : this.detachedBlobIds;\n const entries: ITreeEntry[] = [...blobIds].map((id) => new AttachmentTreeEntry(id, id));\n if (this.redirectTable && this.redirectTable.size > 0) {\n entries.push(new BlobTreeEntry(\n BlobManager.redirectTableBlobName,\n JSON.stringify(Array.from(this.redirectTable.entries()))),\n );\n }\n return { entries };\n }\n\n public setRedirectTable(table: Map<string, string>) {\n assert(this.runtime.attachState === AttachState.Detached,\n 0x252 /* \"redirect table can only be set in detached container\" */);\n assert(!this.redirectTable, 0x253 /* \"redirect table already exists\" */);\n for (const [localId, storageId] of table) {\n assert(this.detachedBlobIds.delete(localId), 0x254 /* \"unrecognized id in redirect table\" */);\n this.blobIds.add(storageId);\n }\n assert(this.detachedBlobIds.size === 0, 0x255 /* \"detached blob id absent in redirect table\" */);\n this.redirectTable = table;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"blobManager.js","sourceRoot":"","sources":["../src/blobManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,iEAA8F;AAE9F,+DAAgE;AAEhE,iFAAoE;AAGpE;;;;;;GAMG;AACH,MAAa,UAAU;IAWnB,YACoB,IAAY,EACZ,YAAiC,EAC1C,GAAuB;QAFd,SAAI,GAAJ,IAAI,CAAQ;QACZ,iBAAY,GAAZ,YAAY,CAAqB;QAC1C,QAAG,GAAH,GAAG,CAAoB;QAb1B,aAAQ,GAAY,KAAK,CAAC;QAe9B,IAAI,CAAC,YAAY,GAAG,yCAAyB,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC3E,CAAC;IAdD,IAAW,YAAY,KAAmB,OAAO,IAAI,CAAC,CAAC,CAAC;IAExD,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAYM,WAAW;QACd,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACzB,CAAC;IAEM,IAAI,CAAC,MAAoB;QAC5B,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAClD,CAAC;CACJ;AA1BD,gCA0BC;AAUD,MAAa,WAAW;IAapB,YACqB,YAAiC,EAClD,QAA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AK,CAAC,EAAE,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACjG,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC/B,CAAC;;AAnLL,kCAoLC;AAnL0B,oBAAQ,GAAG,QAAQ,CAAC;AACnB,iCAAqB,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle, IFluidHandleContext } from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport { generateHandleContextPath, SummaryTreeBuilder } from \"@fluidframework/runtime-utils\";\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { assert, Deferred } from \"@fluidframework/common-utils\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\n\n/**\n * This class represents blob (long string)\n * This object is used only when creating (writing) new blob and serialization purposes.\n * De-serialization process goes through FluidObjectHandle and request flow:\n * DataObject.request() recognizes requests in the form of `/blobs/<id>`\n * and loads blob.\n */\nexport class BlobHandle implements IFluidHandle<ArrayBufferLike> {\n private attached: boolean = false;\n\n public get IFluidHandle(): IFluidHandle { return this; }\n\n public get isAttached(): boolean {\n return this.attached;\n }\n\n public readonly absolutePath: string;\n\n constructor(\n public readonly path: string,\n public readonly routeContext: IFluidHandleContext,\n public get: () => Promise<any>,\n ) {\n this.absolutePath = generateHandleContextPath(path, this.routeContext);\n }\n\n public attachGraph() {\n this.attached = true;\n }\n\n public bind(handle: IFluidHandle) {\n throw new Error(\"Cannot bind to blob handle\");\n }\n}\n\n/**\n * Information from a snapshot needed to load BlobManager\n */\nexport interface IBlobManagerLoadInfo {\n ids?: string[],\n redirectTable?: [string, string][],\n}\n\nexport class BlobManager {\n public static readonly basePath = \"_blobs\";\n private static readonly redirectTableBlobName = \".redirectTable\";\n // uploaded blob IDs\n private readonly blobIds: Set<string> = new Set();\n // blobs for which upload is pending. maps to a promise that will resolve once the blob has been uploaded and a\n // BlobAttach op has round-tripped.\n private readonly pendingBlobIds: Map<string, Deferred<void>> = new Map();\n // blobs uploaded while detached; cleared upon attach\n private readonly detachedBlobIds: Set<string> = new Set();\n // map of detached blob IDs to IDs used by storage. used to support blob handles given out while detached\n private redirectTable: Map<string, string> | undefined;\n\n constructor(\n private readonly routeContext: IFluidHandleContext,\n snapshot: IBlobManagerLoadInfo,\n private readonly getStorage: () => IDocumentStorageService,\n private readonly attachBlobCallback: (blobId: string) => void,\n private readonly runtime: IContainerRuntime,\n private readonly logger: ITelemetryLogger,\n ) {\n this.runtime.once(\"dispose\", () => {\n for (const promise of this.pendingBlobIds.values()) {\n promise.reject(new Error(\"runtime disposed while blobAttach op in flight\"));\n }\n });\n this.load(snapshot);\n }\n\n private hasBlob(id: string): boolean {\n return this.blobIds.has(id) || this.detachedBlobIds.has(id);\n }\n\n public async getBlob(blobId: string): Promise<IFluidHandle<ArrayBufferLike>> {\n const storageId = this.redirectTable?.get(blobId) ?? blobId;\n assert(this.hasBlob(storageId), 0x11f /* \"requesting unknown blobs\" */);\n\n return new BlobHandle(\n `${BlobManager.basePath}/${storageId}`,\n this.routeContext,\n async () => {\n return this.getStorage().readBlob(storageId).catch((error) => {\n this.logger.sendErrorEvent(\n {\n eventName:\"AttachmentReadBlobError\",\n id: storageId,\n },\n error,\n );\n throw error;\n });\n },\n );\n }\n\n public async createBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>> {\n if (this.runtime.attachState === AttachState.Attaching) {\n // blob upload is not supported in \"Attaching\" state\n this.logger.sendTelemetryEvent({ eventName: \"CreateBlobWhileAttaching\" });\n await new Promise<void>((resolve) => this.runtime.once(\"attached\", resolve));\n }\n\n const response = await this.getStorage().createBlob(blob);\n const handle = new BlobHandle(\n `${BlobManager.basePath}/${response.id}`,\n this.routeContext,\n // get() should go through BlobManager.getBlob() so handles created while detached can be redirected\n // to the correct storage id after they are uploaded\n async () => this.getBlob(response.id).then(async (h) => h.get()),\n );\n\n if (this.runtime.attachState === AttachState.Detached) {\n this.detachedBlobIds.add(response.id);\n return handle;\n }\n\n // Note - server will de-dup blobs, so we might get existing blobId!\n if (this.pendingBlobIds.has(response.id)) {\n await this.pendingBlobIds.get(response.id)?.promise;\n } else if (!this.blobIds.has(response.id)) {\n this.pendingBlobIds.set(response.id, new Deferred<void>());\n\n // send blob attach op and wait until we see it to return the handle\n this.attachBlobCallback(response.id);\n await this.pendingBlobIds.get(response.id)?.promise;\n }\n\n return handle;\n }\n\n public processBlobAttachOp(blobId: string, local: boolean) {\n if (local) {\n const pendingBlobP = this.pendingBlobIds.get(blobId);\n assert(pendingBlobP !== undefined, 0x1f8 /* \"local BlobAttach op with no pending blob\" */);\n pendingBlobP.resolve();\n this.pendingBlobIds.delete(blobId);\n }\n this.blobIds.add(blobId);\n }\n\n /**\n * Reads blobs needed to load BlobManager from storage.\n */\n public static async load(\n blobsTree: ISnapshotTree | undefined,\n tryFetchBlob: (id: string) => Promise<[string, string][]>,\n ): Promise<IBlobManagerLoadInfo> {\n if (!blobsTree) {\n return {};\n }\n let redirectTable;\n const tableId = blobsTree.blobs[this.redirectTableBlobName];\n if (tableId) {\n redirectTable = await tryFetchBlob(tableId);\n }\n const ids = Object.entries(blobsTree.blobs)\n .filter(([k, _]) => k !== this.redirectTableBlobName).map(([_, v]) => v);\n return { ids, redirectTable };\n }\n\n /**\n * Load a set of previously attached blob IDs from a previous snapshot. Note\n * that BlobManager tracking and reporting attached blobs is a temporary\n * solution since storage expects attached blobs to be reported and any that\n * are not reported as attached may be GCed. In the future attached blob\n * IDs will be collected at summarization time, and runtime will not care\n * about the existence or specific formatting of this tree in returned\n * snapshots.\n *\n * @param blobsTree - Tree containing IDs of previously attached blobs. This\n * corresponds to snapshot() below. We look for the IDs in the blob entries\n * of the tree since the both the r11s and SPO drivers replace the\n * attachment types returned in snapshot() with blobs.\n */\n private load(snapshot: IBlobManagerLoadInfo): void {\n if (snapshot.ids) {\n const detached = this.runtime.attachState === AttachState.Detached;\n snapshot.ids.map((entry) => detached ? this.detachedBlobIds.add(entry) : this.blobIds.add(entry));\n }\n if (snapshot.redirectTable) {\n this.redirectTable = new Map(snapshot.redirectTable);\n }\n this.logger.sendTelemetryEvent({\n eventName: \"AttachmentBlobsLoaded\",\n count: snapshot.ids?.length ?? 0,\n redirectTable: snapshot.redirectTable?.length,\n });\n }\n\n public summarize(): ISummaryTreeWithStats {\n // If we have a redirect table it means the container is about to transition to \"Attaching\" state, so we need\n // to return an actual snapshot containing all the real storage IDs we know about.\n const attachingOrAttached = !!this.redirectTable || this.runtime.attachState !== AttachState.Detached;\n const blobIds = attachingOrAttached ? this.blobIds : this.detachedBlobIds;\n const builder = new SummaryTreeBuilder();\n blobIds.forEach((blobId) => {\n builder.addAttachment(blobId);\n });\n\n if (this.redirectTable && this.redirectTable.size > 0) {\n builder.addBlob(\n BlobManager.redirectTableBlobName,\n JSON.stringify(Array.from(this.redirectTable.entries())),\n );\n }\n\n return builder.getSummaryTree();\n }\n\n public setRedirectTable(table: Map<string, string>) {\n assert(this.runtime.attachState === AttachState.Detached,\n 0x252 /* \"redirect table can only be set in detached container\" */);\n assert(!this.redirectTable, 0x253 /* \"redirect table already exists\" */);\n for (const [localId, storageId] of table) {\n assert(this.detachedBlobIds.delete(localId), 0x254 /* \"unrecognized id in redirect table\" */);\n this.blobIds.add(storageId);\n }\n assert(this.detachedBlobIds.size === 0, 0x255 /* \"detached blob id absent in redirect table\" */);\n this.redirectTable = table;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectionTelemetry.d.ts","sourceRoot":"","sources":["../src/connectionTelemetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EACH,gBAAgB,EAChB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"connectionTelemetry.d.ts","sourceRoot":"","sources":["../src/connectionTelemetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EACH,gBAAgB,EAChB,yBAAyB,EAE5B,MAAM,sCAAsC,CAAC;AAG9C;;GAEG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAmPrC,wBAAgB,qBAAqB,CACjC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,YAAY,EAAE,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,EACxE,MAAM,EAAE,gBAAgB,QAE3B"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.ReportOpPerfTelemetry = exports.latencyThreshold = void 0;
|
|
8
8
|
const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
|
|
9
|
+
const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
|
|
9
10
|
const common_utils_1 = require("@fluidframework/common-utils");
|
|
10
11
|
/**
|
|
11
12
|
* We report various latency-related errors when waiting for op roundtrip takes longer than that amout of time.
|
|
@@ -16,6 +17,10 @@ class OpPerfTelemetry {
|
|
|
16
17
|
this.clientId = clientId;
|
|
17
18
|
this.deltaManager = deltaManager;
|
|
18
19
|
this.pongCount = 0;
|
|
20
|
+
this.msnTrackingTimestamp = 0;
|
|
21
|
+
this.opProcessingTimes = {};
|
|
22
|
+
// Performance Data to be reported for ops round trips and processing.
|
|
23
|
+
this.opPerfData = {};
|
|
19
24
|
this.firstConnection = true;
|
|
20
25
|
this.bootTime = common_utils_1.performance.now();
|
|
21
26
|
this.connectionStartTime = 0;
|
|
@@ -37,11 +42,39 @@ class OpPerfTelemetry {
|
|
|
37
42
|
}
|
|
38
43
|
});
|
|
39
44
|
this.deltaManager.on("disconnect", () => {
|
|
40
|
-
this.
|
|
45
|
+
this.sequenceNumberForMsnTracking = undefined;
|
|
41
46
|
this.clientSequenceNumberForLatencyStatistics = undefined;
|
|
47
|
+
this.opProcessingTimes = {};
|
|
48
|
+
this.opPerfData = {};
|
|
42
49
|
this.connectionOpSeqNumber = undefined;
|
|
43
50
|
this.firstConnection = false;
|
|
44
51
|
});
|
|
52
|
+
this.deltaManager.outbound.on("push", (messages) => {
|
|
53
|
+
for (const msg of messages) {
|
|
54
|
+
if (msg.type === protocol_definitions_1.MessageType.Operation &&
|
|
55
|
+
this.clientSequenceNumberForLatencyStatistics === msg.clientSequenceNumber) {
|
|
56
|
+
common_utils_1.assert(this.opProcessingTimes.opStartTimeSittingInboundQueue === undefined, "opStartTimeSittingInboundQueue should be undefined");
|
|
57
|
+
common_utils_1.assert(this.opPerfData.durationInboundQueue === undefined, "durationInboundQueue should be undefined");
|
|
58
|
+
this.opProcessingTimes.opStartTimeSittingInboundQueue = Date.now();
|
|
59
|
+
common_utils_1.assert(this.opPerfData.durationOutboundQueue === undefined, "durationOutboundQueue should be undefined");
|
|
60
|
+
common_utils_1.assert(this.opProcessingTimes.opStartTimeForLatencyStatistics !== undefined, "opStartTimeForLatencyStatistics should be undefined");
|
|
61
|
+
this.opPerfData.durationOutboundQueue = this.opProcessingTimes.opStartTimeSittingInboundQueue
|
|
62
|
+
- this.opProcessingTimes.opStartTimeForLatencyStatistics;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
this.deltaManager.inbound.on("push", (message) => {
|
|
67
|
+
if (this.clientId === message.clientId &&
|
|
68
|
+
message.type === protocol_definitions_1.MessageType.Operation &&
|
|
69
|
+
this.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber &&
|
|
70
|
+
this.opProcessingTimes.opStartTimeSittingInboundQueue !== undefined) {
|
|
71
|
+
this.opProcessingTimes.opStartTimeInboundPushEvent = Date.now();
|
|
72
|
+
this.opPerfData.durationInboundQueue = this.opProcessingTimes.opStartTimeInboundPushEvent
|
|
73
|
+
- this.opProcessingTimes.opStartTimeSittingInboundQueue;
|
|
74
|
+
this.opProcessingTimes.opStartTimeSittingInboundQueue = undefined;
|
|
75
|
+
this.opPerfData.lenghtInboundQueue = this.deltaManager.inbound.length;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
45
78
|
this.deltaManager.inbound.on("idle", (count, duration) => {
|
|
46
79
|
// Do not want to log zero for sure.
|
|
47
80
|
// We are more interested in aggregates, so logging only if we are processing some number of ops
|
|
@@ -85,8 +118,11 @@ class OpPerfTelemetry {
|
|
|
85
118
|
}
|
|
86
119
|
beforeOpSubmit(message) {
|
|
87
120
|
// start with first client op and measure latency every 500 client ops
|
|
88
|
-
if (this.clientSequenceNumberForLatencyStatistics === undefined &&
|
|
89
|
-
|
|
121
|
+
if (this.clientSequenceNumberForLatencyStatistics === undefined &&
|
|
122
|
+
message.clientSequenceNumber % 500 === 1) {
|
|
123
|
+
common_utils_1.assert(this.opProcessingTimes.opStartTimeSittingInboundQueue === undefined, "OpTimeSittingInboundQueue should be undefined");
|
|
124
|
+
common_utils_1.assert(this.opPerfData.durationInboundQueue === undefined, "durationInboundQueue should be undefined");
|
|
125
|
+
this.opProcessingTimes.opStartTimeForLatencyStatistics = Date.now();
|
|
90
126
|
this.clientSequenceNumberForLatencyStatistics = message.clientSequenceNumber;
|
|
91
127
|
}
|
|
92
128
|
}
|
|
@@ -96,21 +132,30 @@ class OpPerfTelemetry {
|
|
|
96
132
|
this.reportGettingUpToDate();
|
|
97
133
|
}
|
|
98
134
|
// Record collab window max size after every 1000th op.
|
|
99
|
-
if (sequenceNumber % 1000 === 0) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
135
|
+
if (this.sequenceNumberForMsnTracking === undefined && sequenceNumber % 1000 === 0) {
|
|
136
|
+
this.sequenceNumberForMsnTracking = sequenceNumber;
|
|
137
|
+
this.msnTrackingTimestamp = message.timestamp;
|
|
138
|
+
}
|
|
139
|
+
if (this.sequenceNumberForMsnTracking !== undefined &&
|
|
140
|
+
message.minimumSequenceNumber >= this.sequenceNumberForMsnTracking) {
|
|
141
|
+
common_utils_1.assert(this.msnTrackingTimestamp !== undefined, "msnTrackingTimestamp should not be undefined");
|
|
142
|
+
this.logger.sendPerformanceEvent({
|
|
143
|
+
eventName: "MsnStatistics",
|
|
144
|
+
sequenceNumber,
|
|
145
|
+
msnDistance: sequenceNumber - this.sequenceNumberForMsnTracking,
|
|
146
|
+
duration: message.timestamp - this.msnTrackingTimestamp,
|
|
147
|
+
});
|
|
148
|
+
this.sequenceNumberForMsnTracking = undefined;
|
|
109
149
|
}
|
|
110
150
|
if (this.clientId === message.clientId &&
|
|
111
151
|
this.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber) {
|
|
112
|
-
common_utils_1.assert(this.
|
|
113
|
-
const
|
|
152
|
+
common_utils_1.assert(this.opProcessingTimes.opStartTimeForLatencyStatistics !== undefined, 0x120 /* "Undefined latency statistics (op send time)" */);
|
|
153
|
+
const currentTime = Date.now();
|
|
154
|
+
if (this.opProcessingTimes.opStartTimeInboundPushEvent !== undefined) {
|
|
155
|
+
this.opPerfData.durationInboundToProcessing = currentTime
|
|
156
|
+
- this.opProcessingTimes.opStartTimeInboundPushEvent;
|
|
157
|
+
}
|
|
158
|
+
const duration = currentTime - this.opProcessingTimes.opStartTimeForLatencyStatistics;
|
|
114
159
|
// One of the core expectations for Fluid service is to be fast.
|
|
115
160
|
// When it's not the case, we want to learn about it and be able to investigate, so
|
|
116
161
|
// raise awareness.
|
|
@@ -119,15 +164,10 @@ class OpPerfTelemetry {
|
|
|
119
164
|
// The threshold could be adjusted, but ideally it stays workload-agnostic, as service
|
|
120
165
|
// performance impacts all workloads relying on service.
|
|
121
166
|
const category = duration > exports.latencyThreshold ? "error" : "performance";
|
|
122
|
-
this.logger.sendPerformanceEvent({
|
|
123
|
-
|
|
124
|
-
sequenceNumber,
|
|
125
|
-
referenceSequenceNumber: message.referenceSequenceNumber,
|
|
126
|
-
duration,
|
|
127
|
-
category,
|
|
128
|
-
pingLatency: this.pingLatency,
|
|
129
|
-
});
|
|
167
|
+
this.logger.sendPerformanceEvent(Object.assign({ eventName: "OpRoundtripTime", sequenceNumber, referenceSequenceNumber: message.referenceSequenceNumber, duration,
|
|
168
|
+
category, pingLatency: this.pingLatency, msnDistance: this.deltaManager.lastSequenceNumber - this.deltaManager.minimumSequenceNumber }, this.opPerfData));
|
|
130
169
|
this.clientSequenceNumberForLatencyStatistics = undefined;
|
|
170
|
+
this.opPerfData = {};
|
|
131
171
|
}
|
|
132
172
|
}
|
|
133
173
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectionTelemetry.js","sourceRoot":"","sources":["../src/connectionTelemetry.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,qEAA+E;AAM/E,+DAAmE;AAEnE;;GAEG;AACU,QAAA,gBAAgB,GAAG,IAAI,CAAC;AAErC,MAAM,eAAe;IAmBjB,YACY,QAA4B,EACnB,YAAwE,EACzF,MAAwB;QAFhB,aAAQ,GAAR,QAAQ,CAAoB;QACnB,iBAAY,GAAZ,YAAY,CAA4D;QApBrF,cAAS,GAAW,CAAC,CAAC;QAUtB,oBAAe,GAAG,IAAI,CAAC;QAEd,aAAQ,GAAG,0BAAW,CAAC,GAAG,EAAE,CAAC;QACtC,wBAAmB,GAAG,CAAC,CAAC;QACxB,QAAG,GAAG,CAAC,CAAC;QAQZ,IAAI,CAAC,MAAM,GAAG,6BAAW,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAEnD,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,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OAAO,CAAC,CAAC,CAAC,aAAa,CAAC;YAEvE,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC;gBAC7B,SAAS,EAAE,iBAAiB;gBAC5B,cAAc;gBACd,uBAAuB,EAAE,OAAO,CAAC,uBAAuB;gBACxD,QAAQ;gBACR,QAAQ;gBACR,WAAW,EAAE,IAAI,CAAC,WAAW;aAChC,CAAC,CAAC;YACH,IAAI,CAAC,wCAAwC,GAAG,SAAS,CAAC;SAC7D;IACL,CAAC;CACJ;AAED,SAAgB,qBAAqB,CACjC,QAA4B,EAC5B,YAAwE,EACxE,MAAwB;IACxB,IAAI,eAAe,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;AACxD,CAAC;AALD,sDAKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { ChildLogger, TelemetryLogger } from \"@fluidframework/telemetry-utils\";\nimport { IDeltaManager } from \"@fluidframework/container-definitions\";\nimport {\n IDocumentMessage,\n ISequencedDocumentMessage,\n} from \"@fluidframework/protocol-definitions\";\nimport { assert, performance } from \"@fluidframework/common-utils\";\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\nclass OpPerfTelemetry {\n private pongCount: number = 0;\n private pingLatency: number | undefined;\n\n // Collab window tracking. This is timestamp of %1000 message.\n private opSendTimeForLatencyStatisticsForMsnStatistics: number | undefined;\n\n // To track round trip time for every %1000 client message.\n private opSendTimeForLatencyStatistics: number | undefined;\n private clientSequenceNumberForLatencyStatistics: number | undefined;\n\n private firstConnection = true;\n private connectionOpSeqNumber: number | undefined;\n private readonly bootTime = performance.now();\n private connectionStartTime = 0;\n private gap = 0;\n\n private readonly logger: ITelemetryLogger;\n\n public constructor(\n private clientId: string | undefined,\n private readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n logger: ITelemetryLogger) {\n this.logger = ChildLogger.create(logger, \"OpPerf\");\n\n this.deltaManager.on(\"pong\", (latency) => this.recordPingTime(latency));\n this.deltaManager.on(\"submitOp\", (message) => this.beforeOpSubmit(message));\n\n this.deltaManager.on(\"op\", (message) => this.afterProcessingOp(message));\n\n this.deltaManager.on(\"connect\", (details, opsBehind) => {\n this.clientId = details.clientId;\n if (opsBehind !== undefined) {\n this.connectionOpSeqNumber = this.deltaManager.lastKnownSeqNumber;\n this.gap = opsBehind;\n this.connectionStartTime = performance.now();\n\n // We might be already up-today. If so, report it right away.\n if (this.gap <= 0) {\n this.reportGettingUpToDate();\n }\n }\n });\n this.deltaManager.on(\"disconnect\", () => {\n this.opSendTimeForLatencyStatisticsForMsnStatistics = undefined;\n this.clientSequenceNumberForLatencyStatistics = undefined;\n this.connectionOpSeqNumber = undefined;\n this.firstConnection = false;\n });\n\n this.deltaManager.inbound.on(\"idle\", (count: number, duration: number) => {\n // Do not want to log zero for sure.\n // We are more interested in aggregates, so logging only if we are processing some number of ops\n // Cut-off is arbitrary - can be increased or decreased based on amount of data collected and questions we\n // want to get answered\n // back-compat: Once 0.36 loader version saturates (count & duration args were added there),\n // we can remove typeof check.\n if (typeof count === \"number\" && count >= 100) {\n this.logger.sendPerformanceEvent({\n eventName: \"GetDeltas_OpProcessing\",\n count,\n duration,\n });\n }\n });\n }\n\n private reportGettingUpToDate() {\n this.connectionOpSeqNumber = undefined;\n this.logger.sendPerformanceEvent({\n eventName: \"ConnectionSpeed\",\n duration: performance.now() - this.connectionStartTime,\n ops: this.gap,\n // track time to connect only for first connection.\n timeToConnect: this.firstConnection ?\n TelemetryLogger.formatTick(this.connectionStartTime - this.bootTime) :\n undefined,\n firstConnection: this.firstConnection,\n });\n }\n\n private recordPingTime(latency: number) {\n this.pongCount++;\n this.pingLatency = latency;\n // logging one in every 100 pongs\n if (this.pongCount === 100) {\n this.logger.sendPerformanceEvent({\n eventName: \"DeltaLatency\",\n duration: latency,\n });\n this.pongCount = 0;\n }\n }\n\n private beforeOpSubmit(message: IDocumentMessage) {\n // start with first client op and measure latency every 500 client ops\n if (this.clientSequenceNumberForLatencyStatistics === undefined && message.clientSequenceNumber % 500 === 1) {\n this.opSendTimeForLatencyStatistics = Date.now();\n this.clientSequenceNumberForLatencyStatistics = message.clientSequenceNumber;\n }\n }\n\n private afterProcessingOp(message: ISequencedDocumentMessage) {\n const sequenceNumber = message.sequenceNumber;\n\n if (sequenceNumber === this.connectionOpSeqNumber) {\n this.reportGettingUpToDate();\n }\n\n // Record collab window max size after every 1000th op.\n if (sequenceNumber % 1000 === 0) {\n if (this.opSendTimeForLatencyStatisticsForMsnStatistics !== undefined) {\n this.logger.sendPerformanceEvent({\n eventName: \"MsnStatistics\",\n sequenceNumber,\n msnDistance: this.deltaManager.lastSequenceNumber - this.deltaManager.minimumSequenceNumber,\n duration: message.timestamp - this.opSendTimeForLatencyStatisticsForMsnStatistics,\n });\n }\n this.opSendTimeForLatencyStatisticsForMsnStatistics = message.timestamp;\n }\n\n if (this.clientId === message.clientId &&\n this.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber) {\n assert(this.opSendTimeForLatencyStatistics !== undefined,\n 0x120 /* \"Undefined latency statistics (op send time)\" */);\n\n const duration = Date.now() - this.opSendTimeForLatencyStatistics;\n\n // One of the core expectations for Fluid service is to be fast.\n // When it's not the case, we want to learn about it and be able to investigate, so\n // raise awareness.\n // This also helps identify cases where it's due to client behavior (sending too many ops)\n // that results in overwhelming ordering service and thus starting to see long latencies.\n // The threshold could be adjusted, but ideally it stays workload-agnostic, as service\n // performance impacts all workloads relying on service.\n const category = duration > latencyThreshold ? \"error\" : \"performance\";\n\n this.logger.sendPerformanceEvent({\n eventName: \"OpRoundtripTime\",\n sequenceNumber,\n referenceSequenceNumber: message.referenceSequenceNumber,\n duration,\n category,\n pingLatency: this.pingLatency,\n });\n this.clientSequenceNumberForLatencyStatistics = undefined;\n }\n }\n}\n\nexport function ReportOpPerfTelemetry(\n clientId: string | undefined,\n deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n logger: ITelemetryLogger) {\n new OpPerfTelemetry(clientId, deltaManager, logger);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"connectionTelemetry.js","sourceRoot":"","sources":["../src/connectionTelemetry.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,qEAA+E;AAE/E,+EAI8C;AAC9C,+DAAmE;AAEnE;;GAEG;AACU,QAAA,gBAAgB,GAAG,IAAI,CAAC;AAgCrC,MAAM,eAAe;IAuBjB,YACY,QAA4B,EACnB,YAAwE,EACzF,MAAwB;QAFhB,aAAQ,GAAR,QAAQ,CAAoB;QACnB,iBAAY,GAAZ,YAAY,CAA4D;QAxBrF,cAAS,GAAW,CAAC,CAAC;QAKtB,yBAAoB,GAAW,CAAC,CAAC;QAIjC,sBAAiB,GAA4B,EAAE,CAAC;QAExD,sEAAsE;QAC9D,eAAU,GAAwC,EAAE,CAAC;QAErD,oBAAe,GAAG,IAAI,CAAC;QAEd,aAAQ,GAAG,0BAAW,CAAC,GAAG,EAAE,CAAC;QACtC,wBAAmB,GAAG,CAAC,CAAC;QACxB,QAAG,GAAG,CAAC,CAAC;QAQZ,IAAI,CAAC,MAAM,GAAG,6BAAW,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAEnD,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;QACxE,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;QAE5E,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CA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,qBAAqB,CACjC,QAA4B,EAC5B,YAAwE,EACxE,MAAwB;IACxB,IAAI,eAAe,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;AACxD,CAAC;AALD,sDAKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { ChildLogger, TelemetryLogger } from \"@fluidframework/telemetry-utils\";\nimport { IDeltaManager } from \"@fluidframework/container-definitions\";\nimport {\n IDocumentMessage,\n ISequencedDocumentMessage,\n MessageType,\n} from \"@fluidframework/protocol-definitions\";\nimport { assert, performance } from \"@fluidframework/common-utils\";\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 sits in a buffer in DeltaManager (DM) queue, then in outbound queue for some time.\n// \t - Note: We do not differentiate these two today in telemetry, but first one is due to batches,\n// second one might happen due to outbound queue being paused.\n// 2.\tOp is sent to service and back.\n// 3.\tOp sits in inbound queue.\n// 4.\tOp is processed.\ninterface IOpPerfTelemetryProperties {\n /** Measure time between (1) and (2) - Measure time outbound op is sitting in queue due to active batch */\n durationOutboundQueue: number;\n /** Measure time between (2) and (3) - Track how long op is sitting in inbound queue until it is processed */\n durationInboundQueue: number;\n /** Measure time between (3) and (4) - Time between DM's inbound \"push\" event until DM's \"op\" event */\n durationInboundToProcessing: number;\n /** Length of the DeltaManager's inbound queue at the time of the DM's inbound \"push\" event (3) */\n lenghtInboundQueue: number;\n}\n\n/**\n * Timings collected at various moments during the op processing.\n */\n interface IOpPerfTimings {\n /** Starting time for (1) */\n opStartTimeForLatencyStatistics: number;\n /** Starting time for (2) */\n opStartTimeSittingInboundQueue: number;\n /** Starting time for (3) */\n opStartTimeInboundPushEvent: number;\n}\n\nclass OpPerfTelemetry {\n private pongCount: number = 0;\n private pingLatency: number | undefined;\n\n // Collab window tracking. This is timestamp of %1000 message.\n private sequenceNumberForMsnTracking: number | undefined;\n private msnTrackingTimestamp: number = 0;\n // To track round trip time for every %500 client message.\n private clientSequenceNumberForLatencyStatistics: number | undefined;\n\n private opProcessingTimes: Partial<IOpPerfTimings> = {};\n\n // Performance Data to be reported for ops round trips and processing.\n private opPerfData: Partial<IOpPerfTelemetryProperties> = {};\n\n private firstConnection = true;\n private connectionOpSeqNumber: number | undefined;\n private readonly bootTime = performance.now();\n private connectionStartTime = 0;\n private gap = 0;\n\n private readonly logger: ITelemetryLogger;\n\n public constructor(\n private clientId: string | undefined,\n private readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n logger: ITelemetryLogger) {\n this.logger = ChildLogger.create(logger, \"OpPerf\");\n\n this.deltaManager.on(\"pong\", (latency) => this.recordPingTime(latency));\n this.deltaManager.on(\"submitOp\", (message) => this.beforeOpSubmit(message));\n\n this.deltaManager.on(\"op\", (message) => this.afterProcessingOp(message));\n\n this.deltaManager.on(\"connect\", (details, opsBehind) => {\n this.clientId = details.clientId;\n if (opsBehind !== undefined) {\n this.connectionOpSeqNumber = this.deltaManager.lastKnownSeqNumber;\n this.gap = opsBehind;\n this.connectionStartTime = performance.now();\n\n // We might be already up-today. If so, report it right away.\n if (this.gap <= 0) {\n this.reportGettingUpToDate();\n }\n }\n });\n this.deltaManager.on(\"disconnect\", () => {\n this.sequenceNumberForMsnTracking = undefined;\n this.clientSequenceNumberForLatencyStatistics = undefined;\n this.opProcessingTimes = {};\n this.opPerfData = {};\n this.connectionOpSeqNumber = undefined;\n this.firstConnection = false;\n });\n\n this.deltaManager.outbound.on(\"push\", (messages) => {\n for (const msg of messages) {\n if (msg.type === MessageType.Operation &&\n this.clientSequenceNumberForLatencyStatistics === msg.clientSequenceNumber) {\n assert(this.opProcessingTimes.opStartTimeSittingInboundQueue === undefined,\n \"opStartTimeSittingInboundQueue should be undefined\");\n assert(this.opPerfData.durationInboundQueue === undefined,\n \"durationInboundQueue should be undefined\");\n this.opProcessingTimes.opStartTimeSittingInboundQueue = Date.now();\n\n assert(this.opPerfData.durationOutboundQueue === undefined,\n \"durationOutboundQueue should be undefined\");\n\n assert(this.opProcessingTimes.opStartTimeForLatencyStatistics !== undefined,\n \"opStartTimeForLatencyStatistics should be undefined\");\n\n this.opPerfData.durationOutboundQueue = this.opProcessingTimes.opStartTimeSittingInboundQueue\n - this.opProcessingTimes.opStartTimeForLatencyStatistics;\n }\n }\n });\n\n this.deltaManager.inbound.on(\"push\", (message: ISequencedDocumentMessage) => {\n if (this.clientId === message.clientId &&\n message.type === MessageType.Operation &&\n this.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber &&\n this.opProcessingTimes.opStartTimeSittingInboundQueue !== undefined) {\n this.opProcessingTimes.opStartTimeInboundPushEvent = Date.now();\n this.opPerfData.durationInboundQueue = this.opProcessingTimes.opStartTimeInboundPushEvent\n - this.opProcessingTimes.opStartTimeSittingInboundQueue;\n this.opProcessingTimes.opStartTimeSittingInboundQueue = undefined;\n this.opPerfData.lenghtInboundQueue = this.deltaManager.inbound.length;\n }\n });\n\n this.deltaManager.inbound.on(\"idle\", (count: number, duration: number) => {\n // Do not want to log zero for sure.\n // We are more interested in aggregates, so logging only if we are processing some number of ops\n // Cut-off is arbitrary - can be increased or decreased based on amount of data collected and questions we\n // want to get answered\n // back-compat: Once 0.36 loader version saturates (count & duration args were added there),\n // we can remove typeof check.\n if (typeof count === \"number\" && count >= 100) {\n this.logger.sendPerformanceEvent({\n eventName: \"GetDeltas_OpProcessing\",\n count,\n duration,\n });\n }\n });\n }\n\n private reportGettingUpToDate() {\n this.connectionOpSeqNumber = undefined;\n this.logger.sendPerformanceEvent({\n eventName: \"ConnectionSpeed\",\n duration: performance.now() - this.connectionStartTime,\n ops: this.gap,\n // track time to connect only for first connection.\n timeToConnect: this.firstConnection ?\n TelemetryLogger.formatTick(this.connectionStartTime - this.bootTime) :\n undefined,\n firstConnection: this.firstConnection,\n });\n }\n\n private recordPingTime(latency: number) {\n this.pongCount++;\n this.pingLatency = latency;\n // logging one in every 100 pongs\n if (this.pongCount === 100) {\n this.logger.sendPerformanceEvent({\n eventName: \"DeltaLatency\",\n duration: latency,\n });\n this.pongCount = 0;\n }\n }\n\n private beforeOpSubmit(message: IDocumentMessage) {\n // start with first client op and measure latency every 500 client ops\n if (this.clientSequenceNumberForLatencyStatistics === undefined &&\n message.clientSequenceNumber % 500 === 1) {\n assert(this.opProcessingTimes.opStartTimeSittingInboundQueue === undefined,\n \"OpTimeSittingInboundQueue should be undefined\");\n assert(this.opPerfData.durationInboundQueue === undefined,\n \"durationInboundQueue should be undefined\");\n this.opProcessingTimes.opStartTimeForLatencyStatistics = Date.now();\n this.clientSequenceNumberForLatencyStatistics = message.clientSequenceNumber;\n }\n }\n\n private afterProcessingOp(message: ISequencedDocumentMessage) {\n const sequenceNumber = message.sequenceNumber;\n\n if (sequenceNumber === this.connectionOpSeqNumber) {\n this.reportGettingUpToDate();\n }\n\n // Record collab window max size after every 1000th op.\n if (this.sequenceNumberForMsnTracking === undefined && sequenceNumber % 1000 === 0) {\n this.sequenceNumberForMsnTracking = sequenceNumber;\n this.msnTrackingTimestamp = message.timestamp;\n }\n if (this.sequenceNumberForMsnTracking !== undefined &&\n message.minimumSequenceNumber >= this.sequenceNumberForMsnTracking) {\n assert(this.msnTrackingTimestamp !== undefined,\n \"msnTrackingTimestamp should not be undefined\");\n this.logger.sendPerformanceEvent({\n eventName: \"MsnStatistics\",\n sequenceNumber,\n msnDistance: sequenceNumber - this.sequenceNumberForMsnTracking,\n duration: message.timestamp - this.msnTrackingTimestamp,\n });\n this.sequenceNumberForMsnTracking = undefined;\n }\n\n if (this.clientId === message.clientId &&\n this.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber) {\n assert(this.opProcessingTimes.opStartTimeForLatencyStatistics !== undefined,\n 0x120 /* \"Undefined latency statistics (op send time)\" */);\n const currentTime = Date.now();\n\n if (this.opProcessingTimes.opStartTimeInboundPushEvent !== undefined) {\n this.opPerfData.durationInboundToProcessing = currentTime\n - this.opProcessingTimes.opStartTimeInboundPushEvent;\n }\n\n const duration = currentTime - this.opProcessingTimes.opStartTimeForLatencyStatistics;\n\n // One of the core expectations for Fluid service is to be fast.\n // When it's not the case, we want to learn about it and be able to investigate, so\n // raise awareness.\n // This also helps identify cases where it's due to client behavior (sending too many ops)\n // that results in overwhelming ordering service and thus starting to see long latencies.\n // The threshold could be adjusted, but ideally it stays workload-agnostic, as service\n // performance impacts all workloads relying on service.\n const category = duration > latencyThreshold ? \"error\" : \"performance\";\n\n this.logger.sendPerformanceEvent({\n eventName: \"OpRoundtripTime\",\n sequenceNumber,\n referenceSequenceNumber: message.referenceSequenceNumber,\n duration,\n category,\n pingLatency: this.pingLatency,\n msnDistance: this.deltaManager.lastSequenceNumber - this.deltaManager.minimumSequenceNumber,\n ...this.opPerfData,\n });\n this.clientSequenceNumberForLatencyStatistics = undefined;\n this.opPerfData = {};\n }\n }\n}\n\nexport function ReportOpPerfTelemetry(\n clientId: string | undefined,\n deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n logger: ITelemetryLogger) {\n new OpPerfTelemetry(clientId, deltaManager, logger);\n}\n"]}
|
|
@@ -86,8 +86,8 @@ export interface ISummaryRuntimeOptions {
|
|
|
86
86
|
* Options for container runtime.
|
|
87
87
|
*/
|
|
88
88
|
export interface IContainerRuntimeOptions {
|
|
89
|
-
summaryOptions?: ISummaryRuntimeOptions;
|
|
90
|
-
gcOptions?: IGCRuntimeOptions;
|
|
89
|
+
readonly summaryOptions?: ISummaryRuntimeOptions;
|
|
90
|
+
readonly gcOptions?: IGCRuntimeOptions;
|
|
91
91
|
/**
|
|
92
92
|
* Affects the behavior while loading the runtime when the data verification check which
|
|
93
93
|
* compares the DeltaManager sequence number (obtained from protocol in summary) to the
|
|
@@ -96,13 +96,20 @@ export interface IContainerRuntimeOptions {
|
|
|
96
96
|
* 2. "log" will log an error event to telemetry, but still continue to load.
|
|
97
97
|
* 3. "bypass" will skip the check entirely. This is not recommended.
|
|
98
98
|
*/
|
|
99
|
-
loadSequenceNumberVerification?: "close" | "log" | "bypass";
|
|
99
|
+
readonly loadSequenceNumberVerification?: "close" | "log" | "bypass";
|
|
100
100
|
/**
|
|
101
101
|
* Should the runtime use data store aliasing for creating root datastores.
|
|
102
102
|
* In case of aliasing conflicts, the runtime will raise an exception which does
|
|
103
103
|
* not effect the status of the container.
|
|
104
104
|
*/
|
|
105
|
-
useDataStoreAliasing?: boolean;
|
|
105
|
+
readonly useDataStoreAliasing?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Sets the flush mode for the runtime. In Immediate flush mode the runtime will immediately
|
|
108
|
+
* send all operations to the driver layer, while in TurnBased the operations will be buffered
|
|
109
|
+
* and then sent them as a single batch at the end of the turn.
|
|
110
|
+
* By default, flush mode is TurnBased.
|
|
111
|
+
*/
|
|
112
|
+
readonly flushMode?: FlushMode;
|
|
106
113
|
}
|
|
107
114
|
/**
|
|
108
115
|
* The summary tree returned by the root node. It adds state relevant to the root of the tree.
|
|
@@ -257,6 +264,7 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
257
264
|
private get summariesDisabled();
|
|
258
265
|
private readonly createContainerMetadata;
|
|
259
266
|
private summaryCount;
|
|
267
|
+
private readonly opTracker;
|
|
260
268
|
private constructor();
|
|
261
269
|
dispose(error?: Error): void;
|
|
262
270
|
get IFluidTokenProvider(): IFluidTokenProvider | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerRuntime.d.ts","sourceRoot":"","sources":["../src/containerRuntime.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAgD,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACpH,OAAO,EACH,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,Q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