@fluidframework/container-runtime 0.58.3000-61081 → 0.59.2000-61729
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 +13 -1
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +52 -0
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.js +8 -8
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +27 -3
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +100 -14
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.js +8 -1
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +9 -3
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +22 -6
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStores.d.ts +13 -5
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +39 -18
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaScheduler.d.ts +4 -5
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +54 -35
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/garbageCollection.d.ts +31 -27
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +76 -75
- package/dist/garbageCollection.js.map +1 -1
- package/dist/orderedClientElection.d.ts.map +1 -1
- package/dist/orderedClientElection.js +2 -2
- package/dist/orderedClientElection.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/summarizerClientElection.d.ts.map +1 -1
- package/dist/summarizerClientElection.js +8 -0
- package/dist/summarizerClientElection.js.map +1 -1
- package/dist/summaryGenerator.d.ts.map +1 -1
- package/dist/summaryGenerator.js +2 -3
- package/dist/summaryGenerator.js.map +1 -1
- package/lib/blobManager.d.ts +13 -1
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +52 -0
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.js +8 -8
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +27 -3
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +101 -15
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.js +8 -1
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +9 -3
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +22 -6
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStores.d.ts +13 -5
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +39 -18
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaScheduler.d.ts +4 -5
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +54 -35
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/garbageCollection.d.ts +31 -27
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +75 -74
- package/lib/garbageCollection.js.map +1 -1
- package/lib/orderedClientElection.d.ts.map +1 -1
- package/lib/orderedClientElection.js +2 -2
- package/lib/orderedClientElection.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/summarizerClientElection.d.ts.map +1 -1
- package/lib/summarizerClientElection.js +8 -0
- package/lib/summarizerClientElection.js.map +1 -1
- package/lib/summaryGenerator.d.ts.map +1 -1
- package/lib/summaryGenerator.js +2 -3
- package/lib/summaryGenerator.js.map +1 -1
- package/package.json +33 -21
- package/src/blobManager.ts +60 -1
- package/src/connectionTelemetry.ts +9 -9
- package/src/containerRuntime.ts +106 -17
- package/src/dataStore.ts +7 -1
- package/src/dataStoreContext.ts +22 -7
- package/src/dataStores.ts +40 -19
- package/src/deltaScheduler.ts +65 -39
- package/src/garbageCollection.ts +92 -78
- package/src/orderedClientElection.ts +2 -1
- package/src/packageVersion.ts +1 -1
- package/src/summarizerClientElection.ts +8 -0
- package/src/summaryGenerator.ts +1 -7
package/dist/blobManager.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
|
7
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
|
+
import { IGarbageCollectionData, ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
|
|
11
11
|
/**
|
|
12
12
|
* This class represents blob (long string)
|
|
13
13
|
* This object is used only when creating (writing) new blob and serialization purposes.
|
|
@@ -70,6 +70,18 @@ export declare class BlobManager {
|
|
|
70
70
|
* attachment types returned in snapshot() with blobs.
|
|
71
71
|
*/
|
|
72
72
|
private load;
|
|
73
|
+
/**
|
|
74
|
+
* Generates data used for garbage collection. Each blob uploaded represents a node in the GC graph as it can be
|
|
75
|
+
* individually referenced by storing its handle in a referenced DDS. Returns the list of blob ids as GC nodes.
|
|
76
|
+
* @param fullGC - true to bypass optimizations and force full generation of GC data. BlobManager doesn't care
|
|
77
|
+
* about this for now because the data is a simple list of blob ids.
|
|
78
|
+
*/
|
|
79
|
+
getGCData(fullGC?: boolean): IGarbageCollectionData;
|
|
80
|
+
/**
|
|
81
|
+
* When running GC in test mode, this is called to delete blobs that are unused.
|
|
82
|
+
* @param unusedRoutes - These are the blob node ids that are unused and should be deleted.
|
|
83
|
+
*/
|
|
84
|
+
deleteUnusedRoutes(unusedRoutes: string[]): void;
|
|
73
85
|
summarize(): ISummaryTreeWithStats;
|
|
74
86
|
setRedirectTable(table: Map<string, string>): void;
|
|
75
87
|
}
|
|
@@ -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;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,qBAAqB,EAAE,MAAM,qCAAqC,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,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAEpG;;;;;;GAMG;AACH,qBAAa,UAAW,YAAW,YAAY,CAAC,eAAe,CAAC;aAYxC,IAAI,EAAE,MAAM;aACZ,YAAY,EAAE,mBAAmB;IAC1C,GAAG,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC;IAblC,OAAO,CAAC,QAAQ,CAAkB;IAElC,IAAW,YAAY,IAAI,YAAY,CAAiB;IAExD,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED,SAAgB,YAAY,EAAE,MAAM,CAAC;gBAGjB,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,mBAAmB,EAC1C,GAAG,EAAE,MAAM,OAAO,CA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,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;IAeZ;;;;;OAKG;IACI,SAAS,CAAC,MAAM,GAAE,OAAe,GAAG,sBAAsB;IA6BjE;;;OAGG;IACI,kBAAkB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI;IAoBhD,SAAS,IAAI,qBAAqB;IAoBlC,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;CAWrD"}
|
package/dist/blobManager.js
CHANGED
|
@@ -155,6 +155,58 @@ class BlobManager {
|
|
|
155
155
|
redirectTable: (_c = snapshot.redirectTable) === null || _c === void 0 ? void 0 : _c.length,
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Generates data used for garbage collection. Each blob uploaded represents a node in the GC graph as it can be
|
|
160
|
+
* individually referenced by storing its handle in a referenced DDS. Returns the list of blob ids as GC nodes.
|
|
161
|
+
* @param fullGC - true to bypass optimizations and force full generation of GC data. BlobManager doesn't care
|
|
162
|
+
* about this for now because the data is a simple list of blob ids.
|
|
163
|
+
*/
|
|
164
|
+
getGCData(fullGC = false) {
|
|
165
|
+
const getGCNodePath = (blobId) => { return `/${BlobManager.basePath}/${blobId}`; };
|
|
166
|
+
const gcData = { gcNodes: {} };
|
|
167
|
+
/**
|
|
168
|
+
* The node path is of the format `/_blobs/blobId`. This path must match the path of the blob handle returned
|
|
169
|
+
* by the createBlob API because blobs are marked referenced by storing these handles in a referenced DDS.
|
|
170
|
+
*/
|
|
171
|
+
this.blobIds.forEach((blobId) => {
|
|
172
|
+
gcData.gcNodes[getGCNodePath(blobId)] = [];
|
|
173
|
+
});
|
|
174
|
+
/**
|
|
175
|
+
* For all blobs in the redirect table, the handle returned on creation is based off of the localId. So, these
|
|
176
|
+
* nodes can be referenced by storing the localId handle. When that happens, the corresponding storageId node
|
|
177
|
+
* must also be marked referenced. So, we add a route from the localId node to the storageId node.
|
|
178
|
+
* Note that because of de-duping, there can be multiple localIds that all redirect to the same storageId or
|
|
179
|
+
* a blob may be referenced via its storageId handle.
|
|
180
|
+
*/
|
|
181
|
+
if (this.redirectTable !== undefined) {
|
|
182
|
+
for (const [localId, storageId] of this.redirectTable) {
|
|
183
|
+
// Add node for the localId and add a route to the storageId node. The storageId node will have been
|
|
184
|
+
// added above when adding nodes for this.blobIds.
|
|
185
|
+
gcData.gcNodes[getGCNodePath(localId)] = [getGCNodePath(storageId)];
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return gcData;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* When running GC in test mode, this is called to delete blobs that are unused.
|
|
192
|
+
* @param unusedRoutes - These are the blob node ids that are unused and should be deleted.
|
|
193
|
+
*/
|
|
194
|
+
deleteUnusedRoutes(unusedRoutes) {
|
|
195
|
+
var _a;
|
|
196
|
+
// The routes or blob node paths are in the same format as returned in getGCData - `/_blobs/blobId`.
|
|
197
|
+
for (const route of unusedRoutes) {
|
|
198
|
+
const pathParts = route.split("/");
|
|
199
|
+
common_utils_1.assert(pathParts.length === 3 && pathParts[1] === BlobManager.basePath, 0x2d5 /* "Invalid blob node id in unused routes." */);
|
|
200
|
+
const blobId = pathParts[2];
|
|
201
|
+
// The unused blobId could be a localId. If so, remove it from the redirect table and continue. The
|
|
202
|
+
// corresponding storageId may still be used either directly or via other localIds.
|
|
203
|
+
if ((_a = this.redirectTable) === null || _a === void 0 ? void 0 : _a.has(blobId)) {
|
|
204
|
+
this.redirectTable.delete(blobId);
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
this.blobIds.delete(blobId);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
158
210
|
summarize() {
|
|
159
211
|
// If we have a redirect table it means the container is about to transition to "Attaching" state, so we need
|
|
160
212
|
// to return an actual snapshot containing all the real storage IDs we know about.
|
package/dist/blobManager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,QAA8B,EACb,UAAyC,EACzC,kBAA4C,EAC5C,OAA0B,EAC1B,MAAwB;QALxB,iBAAY,GAAZ,YAAY,CAAqB;QAEjC,eAAU,GAAV,UAAU,CAA+B;QACzC,uBAAkB,GAAlB,kBAAkB,CAA0B;QAC5C,YAAO,GAAP,OAAO,CAAmB;QAC1B,WAAM,GAAN,MAAM,CAAkB;QAhB7C,oBAAoB;QACH,YAAO,GAAgB,IAAI,GAAG,EAAE,CAAC;QAClD,+GAA+G;QAC/G,mCAAmC;QAClB,mBAAc,GAAgC,IAAI,GAAG,EAAE,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aAAa,CAAC,MAAM,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;QAEH,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,EAAE;YACnD,OAAO,CAAC,OAAO,CACX,WAAW,CAAC,qBAAqB,EACjC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAC3D,CAAC;SACL;QAED,OAAO,OAAO,CAAC,cAAc,EAAE,CAAC;IACpC,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;;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
|
+
{"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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DAA4D,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;;AA9OL,kCA+OC;AA9O0B,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 { IGarbageCollectionData, 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 /**\n * Generates data used for garbage collection. Each blob uploaded represents a node in the GC graph as it can be\n * individually referenced by storing its handle in a referenced DDS. Returns the list of blob ids as GC nodes.\n * @param fullGC - true to bypass optimizations and force full generation of GC data. BlobManager doesn't care\n * about this for now because the data is a simple list of blob ids.\n */\n public getGCData(fullGC: boolean = false): IGarbageCollectionData {\n const getGCNodePath = (blobId: string) => { return `/${BlobManager.basePath}/${blobId}`; };\n const gcData: IGarbageCollectionData = { gcNodes: {} };\n /**\n * The node path is of the format `/_blobs/blobId`. This path must match the path of the blob handle returned\n * by the createBlob API because blobs are marked referenced by storing these handles in a referenced DDS.\n */\n this.blobIds.forEach((blobId: string) => {\n gcData.gcNodes[getGCNodePath(blobId)] = [];\n });\n\n /**\n * For all blobs in the redirect table, the handle returned on creation is based off of the localId. So, these\n * nodes can be referenced by storing the localId handle. When that happens, the corresponding storageId node\n * must also be marked referenced. So, we add a route from the localId node to the storageId node.\n * Note that because of de-duping, there can be multiple localIds that all redirect to the same storageId or\n * a blob may be referenced via its storageId handle.\n */\n if (this.redirectTable !== undefined) {\n for (const [localId, storageId] of this.redirectTable) {\n // Add node for the localId and add a route to the storageId node. The storageId node will have been\n // added above when adding nodes for this.blobIds.\n gcData.gcNodes[getGCNodePath(localId)] = [getGCNodePath(storageId)];\n }\n }\n\n return gcData;\n }\n\n /**\n * When running GC in test mode, this is called to delete blobs that are unused.\n * @param unusedRoutes - These are the blob node ids that are unused and should be deleted.\n */\n public deleteUnusedRoutes(unusedRoutes: string[]): void {\n // The routes or blob node paths are in the same format as returned in getGCData - `/_blobs/blobId`.\n for (const route of unusedRoutes) {\n const pathParts = route.split(\"/\");\n assert(\n pathParts.length === 3 && pathParts[1] === BlobManager.basePath,\n 0x2d5 /* \"Invalid blob node id in unused routes.\" */,\n );\n const blobId = pathParts[2];\n\n // The unused blobId could be a localId. If so, remove it from the redirect table and continue. The\n // corresponding storageId may still be used either directly or via other localIds.\n if (this.redirectTable?.has(blobId)) {\n this.redirectTable.delete(blobId);\n continue;\n }\n this.blobIds.delete(blobId);\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"]}
|
|
@@ -53,11 +53,11 @@ class OpPerfTelemetry {
|
|
|
53
53
|
for (const msg of messages) {
|
|
54
54
|
if (msg.type === protocol_definitions_1.MessageType.Operation &&
|
|
55
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");
|
|
56
|
+
common_utils_1.assert(this.opProcessingTimes.opStartTimeSittingInboundQueue === undefined, 0x2c8 /* "opStartTimeSittingInboundQueue should be undefined" */);
|
|
57
|
+
common_utils_1.assert(this.opPerfData.durationInboundQueue === undefined, 0x2c9 /* "durationInboundQueue should be undefined" */);
|
|
58
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");
|
|
59
|
+
common_utils_1.assert(this.opPerfData.durationOutboundQueue === undefined, 0x2ca /* "durationOutboundQueue should be undefined" */);
|
|
60
|
+
common_utils_1.assert(this.opProcessingTimes.opStartTimeForLatencyStatistics !== undefined, 0x2cb /* "opStartTimeForLatencyStatistics should be undefined" */);
|
|
61
61
|
this.opPerfData.durationOutboundQueue = this.opProcessingTimes.opStartTimeSittingInboundQueue
|
|
62
62
|
- this.opProcessingTimes.opStartTimeForLatencyStatistics;
|
|
63
63
|
}
|
|
@@ -72,7 +72,7 @@ class OpPerfTelemetry {
|
|
|
72
72
|
this.opPerfData.durationInboundQueue = this.opProcessingTimes.opStartTimeInboundPushEvent
|
|
73
73
|
- this.opProcessingTimes.opStartTimeSittingInboundQueue;
|
|
74
74
|
this.opProcessingTimes.opStartTimeSittingInboundQueue = undefined;
|
|
75
|
-
this.opPerfData.
|
|
75
|
+
this.opPerfData.lengthInboundQueue = this.deltaManager.inbound.length;
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
this.deltaManager.inbound.on("idle", (count, duration) => {
|
|
@@ -120,8 +120,8 @@ class OpPerfTelemetry {
|
|
|
120
120
|
// start with first client op and measure latency every 500 client ops
|
|
121
121
|
if (this.clientSequenceNumberForLatencyStatistics === undefined &&
|
|
122
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");
|
|
123
|
+
common_utils_1.assert(this.opProcessingTimes.opStartTimeSittingInboundQueue === undefined, 0x2cc /* "OpTimeSittingInboundQueue should be undefined" */);
|
|
124
|
+
common_utils_1.assert(this.opPerfData.durationInboundQueue === undefined, 0x2cd /* "durationInboundQueue should be undefined" */);
|
|
125
125
|
this.opProcessingTimes.opStartTimeForLatencyStatistics = Date.now();
|
|
126
126
|
this.clientSequenceNumberForLatencyStatistics = message.clientSequenceNumber;
|
|
127
127
|
}
|
|
@@ -138,7 +138,7 @@ class OpPerfTelemetry {
|
|
|
138
138
|
}
|
|
139
139
|
if (this.sequenceNumberForMsnTracking !== undefined &&
|
|
140
140
|
message.minimumSequenceNumber >= this.sequenceNumberForMsnTracking) {
|
|
141
|
-
common_utils_1.assert(this.msnTrackingTimestamp !== undefined, "msnTrackingTimestamp should not be undefined");
|
|
141
|
+
common_utils_1.assert(this.msnTrackingTimestamp !== undefined, 0x2ce /* "msnTrackingTimestamp should not be undefined" */);
|
|
142
142
|
this.logger.sendPerformanceEvent({
|
|
143
143
|
eventName: "MsnStatistics",
|
|
144
144
|
sequenceNumber,
|
|
@@ -1 +1 @@
|
|
|
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,EA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AS,CAAC;YAC1D,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;SACxB;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 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"]}
|
|
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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,CAAC,UAAU,CAAC,2BAA2B,GAAG,WAAW;sBACvD,IAAI,CAAC,iBAAiB,CAAC,2BAA2B,CAAC;aACxD;YAED,MAAM,QAAQ,GAAG,WAAW,GAAG,IAAI,CAAC,iBAAiB,CAAC,+BAA+B,CAAC;YAEtF,gEAAgE;YAChE,mFAAmF;YACnF,mBAAmB;YACnB,0FAA0F;YAC1F,yFAAyF;YACzF,uFAAuF;YACvF,wDAAwD;YACxD,MAAM,QAAQ,GAAG,QAAQ,GAAG,wBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC;YAEvE,IAAI,CAAC,MAAM,CAAC,oBAAoB,iBAC5B,SAAS,EAAE,iBAAiB,EAC5B,cAAc,EACd,uBAAuB,EAAE,OAAO,CAAC,uBAAuB,EACxD,QAAQ;gBACR,QAAQ,EACR,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,kBAAkB,GAAG,IAAI,CAAC,YAAY,CAAC,qBAAqB,IACxF,IAAI,CAAC,UAAU,EACpB,CAAC;YACH,IAAI,CAAC,wCAAwC,GAAG,SAAS,CAAC;YAC1D,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;SACxB;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 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 lengthInboundQueue: 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 0x2c8 /* \"opStartTimeSittingInboundQueue should be undefined\" */);\n assert(this.opPerfData.durationInboundQueue === undefined,\n 0x2c9 /* \"durationInboundQueue should be undefined\" */);\n this.opProcessingTimes.opStartTimeSittingInboundQueue = Date.now();\n\n assert(this.opPerfData.durationOutboundQueue === undefined,\n 0x2ca /* \"durationOutboundQueue should be undefined\" */);\n\n assert(this.opProcessingTimes.opStartTimeForLatencyStatistics !== undefined,\n 0x2cb /* \"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.lengthInboundQueue = 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 0x2cc /* \"OpTimeSittingInboundQueue should be undefined\" */);\n assert(this.opPerfData.durationInboundQueue === undefined,\n 0x2cd /* \"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 0x2ce /* \"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"]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { EventEmitter } from "events";
|
|
7
7
|
import { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
8
|
-
import { FluidObject, IFluidHandle, IFluidHandleContext,
|
|
8
|
+
import { FluidObject, IFluidHandle, IFluidHandleContext, IFluidRouter, IRequest, IResponse } from "@fluidframework/core-interfaces";
|
|
9
9
|
import { IAudience, IFluidTokenProvider, IContainerContext, IDeltaManager, IRuntime, ICriticalContainerError, AttachState, ILoaderOptions } from "@fluidframework/container-definitions";
|
|
10
10
|
import { IContainerRuntime, IContainerRuntimeEvents } from "@fluidframework/container-runtime-definitions";
|
|
11
11
|
import { TypedEventEmitter } from "@fluidframework/common-utils";
|
|
@@ -14,7 +14,7 @@ import { IClientDetails, IDocumentMessage, IQuorumClients, ISequencedDocumentMes
|
|
|
14
14
|
import { FlushMode, IFluidDataStoreContextDetached, IFluidDataStoreRegistry, IGarbageCollectionData, NamedFluidDataStoreRegistryEntries, ISummaryTreeWithStats, IDataStore } from "@fluidframework/runtime-definitions";
|
|
15
15
|
import { IPendingLocalState } from "./pendingStateManager";
|
|
16
16
|
import { SubmitSummaryResult, ISubmitSummaryOptions, ISummarizer, ISummarizerInternalsProvider, ISummarizerOptions, ISummarizerRuntime } from "./summarizerTypes";
|
|
17
|
-
import { IGarbageCollectionRuntime, IGCStats } from "./garbageCollection";
|
|
17
|
+
import { GCNodeType, IGarbageCollectionRuntime, IGCStats } from "./garbageCollection";
|
|
18
18
|
export declare enum ContainerMessageType {
|
|
19
19
|
FluidDataStoreOp = "component",
|
|
20
20
|
Attach = "attach",
|
|
@@ -205,7 +205,7 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
205
205
|
get reSubmitFn(): (type: ContainerMessageType, content: any, localOpMetadata: unknown, opMetadata: Record<string, unknown> | undefined) => void;
|
|
206
206
|
get closeFn(): (error?: ICriticalContainerError) => void;
|
|
207
207
|
get flushMode(): FlushMode;
|
|
208
|
-
get scope():
|
|
208
|
+
get scope(): FluidObject;
|
|
209
209
|
get IFluidDataStoreRegistry(): IFluidDataStoreRegistry;
|
|
210
210
|
get attachState(): AttachState;
|
|
211
211
|
get IFluidHandleContext(): IFluidHandleContext;
|
|
@@ -400,6 +400,30 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
400
400
|
* unreferenced as part of this GC run, this should be used to update the time when it happens.
|
|
401
401
|
*/
|
|
402
402
|
updateUsedRoutes(usedRoutes: string[], gcTimestamp?: number): void;
|
|
403
|
+
/**
|
|
404
|
+
* When running GC in test mode, this is called to delete objects whose routes are unused. This enables testing
|
|
405
|
+
* scenarios with accessing deleted content.
|
|
406
|
+
* @param unusedRoutes - The routes that are unused in all data stores in this Container.
|
|
407
|
+
*/
|
|
408
|
+
deleteUnusedRoutes(unusedRoutes: string[]): void;
|
|
409
|
+
/**
|
|
410
|
+
* Returns a server generated referenced timestamp to be used to track unreferenced nodes by GC.
|
|
411
|
+
*/
|
|
412
|
+
getCurrentReferenceTimestampMs(): number | undefined;
|
|
413
|
+
/**
|
|
414
|
+
* Returns the type of the GC node. Currently, there are nodes that belong to data store and nodes that belong
|
|
415
|
+
* to the blob manager.
|
|
416
|
+
*/
|
|
417
|
+
getNodeType(nodePath: string): GCNodeType;
|
|
418
|
+
/**
|
|
419
|
+
* Called by GC to retrieve the package path of the node with the given path. The node should belong to a
|
|
420
|
+
* data store or an attachment blob.
|
|
421
|
+
*/
|
|
422
|
+
getGCNodePackagePath(nodePath: string): readonly string[] | undefined;
|
|
423
|
+
/**
|
|
424
|
+
* Returns whether a given path is for attachment blobs that are in the format - "/BlobManager.basePath/...".
|
|
425
|
+
*/
|
|
426
|
+
private isBlobPath;
|
|
403
427
|
/**
|
|
404
428
|
* Runs garbage collection and updates the reference / used state of the nodes in the container.
|
|
405
429
|
* @returns the statistics of the garbage collection run.
|
|
@@ -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,
|
|
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,QAAQ,EACR,SAAS,EACZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EAEb,QAAQ,EACR,uBAAuB,EACvB,WAAW,EACX,cAAc,EAEjB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACH,iBAAiB,EACjB,uBAAuB,EAC1B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAGH,iBAAiB,EAGpB,MAAM,8BAA8B,CA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