@fluidframework/container-runtime 2.117.0 → 3.0.0
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/CHANGELOG.md +70 -2
- package/README.md +53 -50
- package/{api-extractor.json → api-extractor/api-extractor-model.json} +1 -1
- package/api-report/container-runtime.legacy.alpha.api.md +3 -1
- package/api-report/container-runtime.legacy.beta.api.md +3 -1
- package/container-runtime.test-files.tar +0 -0
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +5 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager/blobManager.d.ts +1 -1
- package/dist/blobManager/blobManager.d.ts.map +1 -1
- package/dist/blobManager/blobManager.js +264 -231
- package/dist/blobManager/blobManager.js.map +1 -1
- package/dist/blobManager/blobManagerSnapSum.d.ts.map +1 -1
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +70 -58
- package/dist/channelCollection.js.map +1 -1
- package/dist/connectionTelemetry.js +38 -20
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerCompatibility.d.ts +3 -3
- package/dist/containerCompatibility.d.ts.map +1 -1
- package/dist/containerCompatibility.js +36 -45
- package/dist/containerCompatibility.js.map +1 -1
- package/dist/containerHandleContext.d.ts.map +1 -1
- package/dist/containerHandleContext.js +4 -0
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +4 -4
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +346 -223
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +9 -1
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +184 -127
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.js +43 -42
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStoreRegistry.js +1 -0
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/deltaManagerProxies.js +5 -0
- package/dist/deltaManagerProxies.js.map +1 -1
- package/dist/deltaScheduler.js +104 -99
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/error.js +2 -1
- package/dist/error.js.map +1 -1
- package/dist/gc/garbageCollection.js +85 -55
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.js +2 -3
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcHelpers.js +12 -13
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcReferenceGraphAlgorithm.js +1 -2
- package/dist/gc/gcReferenceGraphAlgorithm.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +8 -3
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.js +12 -5
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +18 -1
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/dist/inboundBatchAggregator.js +122 -117
- package/dist/inboundBatchAggregator.js.map +1 -1
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +3 -3
- package/dist/metadata.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +11 -5
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/duplicateBatchDetector.js +18 -18
- package/dist/opLifecycle/duplicateBatchDetector.js.map +1 -1
- package/dist/opLifecycle/index.d.ts +2 -2
- package/dist/opLifecycle/index.d.ts.map +1 -1
- package/dist/opLifecycle/index.js +2 -1
- package/dist/opLifecycle/index.js.map +1 -1
- package/dist/opLifecycle/opCompressor.js +2 -1
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +10 -6
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +5 -3
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSerialization.d.ts +11 -1
- package/dist/opLifecycle/opSerialization.d.ts.map +1 -1
- package/dist/opLifecycle/opSerialization.js +22 -6
- package/dist/opLifecycle/opSerialization.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts +17 -1
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +46 -9
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +17 -13
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +6 -3
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/opProperties.d.ts.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/pendingStateManager.js +54 -47
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/runCounter.js +10 -30
- package/dist/runCounter.js.map +1 -1
- package/dist/runtimeLayerCompatState.d.ts +1 -1
- package/dist/runtimeLayerCompatState.d.ts.map +1 -1
- package/dist/runtimeLayerCompatState.js +31 -11
- package/dist/runtimeLayerCompatState.js.map +1 -1
- package/dist/signalTelemetryProcessing.js +15 -17
- package/dist/signalTelemetryProcessing.js.map +1 -1
- package/dist/storageServiceWithAttachBlobs.js +2 -0
- package/dist/storageServiceWithAttachBlobs.js.map +1 -1
- package/dist/summary/documentSchema.d.ts.map +1 -1
- package/dist/summary/documentSchema.js +51 -13
- package/dist/summary/documentSchema.js.map +1 -1
- package/dist/summary/orderedClientElection.js +25 -17
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts.map +1 -1
- package/dist/summary/summarizerClientElection.js +18 -7
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +22 -13
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +20 -6
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerUtils.d.ts.map +1 -1
- package/dist/summary/summarizerUtils.js +4 -3
- package/dist/summary/summarizerUtils.js.map +1 -1
- package/dist/summary/summaryCollection.js +23 -11
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/runWhileConnectedCoordinator.js +4 -2
- package/dist/summary/summaryDelayLoadedModule/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/runningSummarizer.js +65 -46
- package/dist/summary/summaryDelayLoadedModule/runningSummarizer.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/summarizer.d.ts.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/summarizer.js +15 -6
- package/dist/summary/summaryDelayLoadedModule/summarizer.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/summarizerHeuristics.js +30 -25
- package/dist/summary/summaryDelayLoadedModule/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/summaryGenerator.js +9 -0
- package/dist/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/summaryResultBuilder.js +3 -5
- package/dist/summary/summaryDelayLoadedModule/summaryResultBuilder.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js +7 -7
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryHelpers.js +5 -5
- package/dist/summary/summaryHelpers.js.map +1 -1
- package/dist/summary/summaryManager.js +66 -54
- package/dist/summary/summaryManager.js.map +1 -1
- package/dist/throttler.d.ts.map +1 -1
- package/dist/throttler.js +4 -1
- package/dist/throttler.js.map +1 -1
- package/dist/versionMarks/inboundBatch.d.ts +8 -6
- package/dist/versionMarks/inboundBatch.d.ts.map +1 -1
- package/dist/versionMarks/inboundBatch.js +11 -7
- package/dist/versionMarks/inboundBatch.js.map +1 -1
- package/dist/versionMarks/versionMarkResolver.d.ts +30 -23
- package/dist/versionMarks/versionMarkResolver.d.ts.map +1 -1
- package/dist/versionMarks/versionMarkResolver.js +112 -63
- package/dist/versionMarks/versionMarkResolver.js.map +1 -1
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +5 -1
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager/blobManager.d.ts +1 -1
- package/lib/blobManager/blobManager.d.ts.map +1 -1
- package/lib/blobManager/blobManager.js +264 -231
- package/lib/blobManager/blobManager.js.map +1 -1
- package/lib/blobManager/blobManagerSnapSum.d.ts.map +1 -1
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +65 -53
- package/lib/channelCollection.js.map +1 -1
- package/lib/connectionTelemetry.js +36 -18
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerCompatibility.d.ts +3 -3
- package/lib/containerCompatibility.d.ts.map +1 -1
- package/lib/containerCompatibility.js +33 -42
- package/lib/containerCompatibility.js.map +1 -1
- package/lib/containerHandleContext.d.ts.map +1 -1
- package/lib/containerHandleContext.js +4 -0
- package/lib/containerHandleContext.js.map +1 -1
- package/lib/containerRuntime.d.ts +4 -4
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +341 -218
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +9 -1
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +182 -125
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.js +43 -42
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStoreRegistry.js +1 -0
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/deltaManagerProxies.js +5 -0
- package/lib/deltaManagerProxies.js.map +1 -1
- package/lib/deltaScheduler.js +104 -99
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/error.js +2 -1
- package/lib/error.js.map +1 -1
- package/lib/gc/garbageCollection.js +85 -55
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js +8 -3
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.js +12 -5
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js +18 -1
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/lib/inboundBatchAggregator.js +122 -117
- package/lib/inboundBatchAggregator.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/legacyAlpha.d.ts +1 -1
- package/lib/metadata.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +8 -2
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/duplicateBatchDetector.js +18 -18
- package/lib/opLifecycle/duplicateBatchDetector.js.map +1 -1
- package/lib/opLifecycle/index.d.ts +2 -2
- package/lib/opLifecycle/index.d.ts.map +1 -1
- package/lib/opLifecycle/index.js +2 -2
- package/lib/opLifecycle/index.js.map +1 -1
- package/lib/opLifecycle/opCompressor.js +3 -2
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +10 -6
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +3 -1
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSerialization.d.ts +11 -1
- package/lib/opLifecycle/opSerialization.d.ts.map +1 -1
- package/lib/opLifecycle/opSerialization.js +16 -0
- package/lib/opLifecycle/opSerialization.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts +17 -1
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +44 -7
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +14 -10
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +4 -1
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/lib/opProperties.d.ts.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/pendingStateManager.js +52 -45
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/public.d.ts +1 -1
- package/lib/runCounter.js +10 -30
- package/lib/runCounter.js.map +1 -1
- package/lib/runtimeLayerCompatState.d.ts +1 -1
- package/lib/runtimeLayerCompatState.d.ts.map +1 -1
- package/lib/runtimeLayerCompatState.js +28 -8
- package/lib/runtimeLayerCompatState.js.map +1 -1
- package/lib/signalTelemetryProcessing.js +15 -17
- package/lib/signalTelemetryProcessing.js.map +1 -1
- package/lib/storageServiceWithAttachBlobs.js +2 -0
- package/lib/storageServiceWithAttachBlobs.js.map +1 -1
- package/lib/summary/documentSchema.d.ts.map +1 -1
- package/lib/summary/documentSchema.js +51 -13
- package/lib/summary/documentSchema.js.map +1 -1
- package/lib/summary/orderedClientElection.js +25 -17
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts.map +1 -1
- package/lib/summary/summarizerClientElection.js +18 -7
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +22 -13
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +20 -6
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerUtils.d.ts.map +1 -1
- package/lib/summary/summarizerUtils.js +1 -0
- package/lib/summary/summarizerUtils.js.map +1 -1
- package/lib/summary/summaryCollection.js +23 -11
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/runWhileConnectedCoordinator.js +4 -2
- package/lib/summary/summaryDelayLoadedModule/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/runningSummarizer.js +65 -46
- package/lib/summary/summaryDelayLoadedModule/runningSummarizer.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/summarizer.d.ts.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/summarizer.js +15 -6
- package/lib/summary/summaryDelayLoadedModule/summarizer.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/summarizerHeuristics.js +30 -25
- package/lib/summary/summaryDelayLoadedModule/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/summaryGenerator.js +9 -0
- package/lib/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/summaryResultBuilder.js +3 -5
- package/lib/summary/summaryDelayLoadedModule/summaryResultBuilder.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +66 -54
- package/lib/summary/summaryManager.js.map +1 -1
- package/lib/throttler.d.ts.map +1 -1
- package/lib/throttler.js +4 -1
- package/lib/throttler.js.map +1 -1
- package/lib/versionMarks/inboundBatch.d.ts +8 -6
- package/lib/versionMarks/inboundBatch.d.ts.map +1 -1
- package/lib/versionMarks/inboundBatch.js +10 -5
- package/lib/versionMarks/inboundBatch.js.map +1 -1
- package/lib/versionMarks/versionMarkResolver.d.ts +30 -23
- package/lib/versionMarks/versionMarkResolver.d.ts.map +1 -1
- package/lib/versionMarks/versionMarkResolver.js +112 -63
- package/lib/versionMarks/versionMarkResolver.js.map +1 -1
- package/package.json +60 -102
- package/src/containerCompatibility.ts +33 -42
- package/src/containerRuntime.ts +15 -12
- package/src/opLifecycle/index.ts +7 -1
- package/src/opLifecycle/opCompressor.ts +2 -2
- package/src/opLifecycle/opSerialization.ts +22 -1
- package/src/opLifecycle/opSplitter.ts +63 -6
- package/src/packageVersion.ts +1 -1
- package/src/runtimeLayerCompatState.ts +28 -21
- package/src/summary/documentSchema.ts +31 -6
- package/src/versionMarks/DEV.md +595 -158
- package/src/versionMarks/inboundBatch.ts +18 -8
- package/src/versionMarks/versionMarkResolver.ts +144 -75
- package/tsconfig.json +1 -1
- package/internal.d.ts +0 -11
- package/legacy/alpha.d.ts +0 -11
- package/legacy.d.ts +0 -11
- /package/api-extractor/{api-extractor.current.json → api-extractor-report.current.json} +0 -0
- /package/api-extractor/{api-extractor.legacy.json → api-extractor-report.legacy.json} +0 -0
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.latencyThreshold = void 0;
|
|
8
|
+
exports.ReportOpPerfTelemetry = ReportOpPerfTelemetry;
|
|
8
9
|
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
9
10
|
const core_interfaces_1 = require("@fluidframework/core-interfaces");
|
|
10
11
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
@@ -16,6 +17,42 @@ const internal_4 = require("@fluidframework/telemetry-utils/internal");
|
|
|
16
17
|
*/
|
|
17
18
|
exports.latencyThreshold = 5000;
|
|
18
19
|
class OpPerfTelemetry {
|
|
20
|
+
clientId;
|
|
21
|
+
deltaManager;
|
|
22
|
+
pingLatency;
|
|
23
|
+
// Collab window tracking. This is timestamp of %1000 message.
|
|
24
|
+
sequenceNumberForMsnTracking;
|
|
25
|
+
msnTrackingTimestamp = 0;
|
|
26
|
+
// To track round trip time for every %500 client message.
|
|
27
|
+
clientSequenceNumberForLatencyStatistics;
|
|
28
|
+
// Performance Data to be reported for ops round trips and processing.
|
|
29
|
+
latencyStatistics = new Map();
|
|
30
|
+
firstConnection = true;
|
|
31
|
+
connectionOpSeqNumber;
|
|
32
|
+
bootTime = (0, client_utils_1.performanceNow)();
|
|
33
|
+
connectionStartTime = 0;
|
|
34
|
+
gap = 0;
|
|
35
|
+
/**
|
|
36
|
+
* Count of no-ops sent by this client. This variable is reset everytime the OpStats sampled event is logged
|
|
37
|
+
*/
|
|
38
|
+
noOpCountForTelemetry = 0;
|
|
39
|
+
/**
|
|
40
|
+
* Cumulative size of the ops processed by this client. This variable is reset everytime the OpStats sampled event is logged
|
|
41
|
+
*/
|
|
42
|
+
processedOpSizeForTelemetry = 0;
|
|
43
|
+
logger;
|
|
44
|
+
static OP_LATENCY_SAMPLE_RATE = 500;
|
|
45
|
+
opLatencyLogger;
|
|
46
|
+
static DELTA_LATENCY_SAMPLE_RATE = 100;
|
|
47
|
+
deltaLatencyLogger;
|
|
48
|
+
static PROCESSED_OPS_SAMPLE_RATE = 500;
|
|
49
|
+
/**
|
|
50
|
+
* A sampled logger to log Ops that have been processed by the current client, the NoOp sent and the
|
|
51
|
+
* size of the ops processed within one sampling window of this log event.
|
|
52
|
+
* The data from this logger will be used to monitor the efficiency of NoOp-heuristics or to get approximate collab window size.
|
|
53
|
+
* Note: no log events are sent when sampling is disabled, because logging at every op will be too noisy.
|
|
54
|
+
*/
|
|
55
|
+
opsLogger;
|
|
19
56
|
/**
|
|
20
57
|
* Create an instance of OpPerfTelemetry which starts monitoring and generating telemetry related to op performance.
|
|
21
58
|
*
|
|
@@ -47,21 +84,6 @@ class OpPerfTelemetry {
|
|
|
47
84
|
logger) {
|
|
48
85
|
this.clientId = clientId;
|
|
49
86
|
this.deltaManager = deltaManager;
|
|
50
|
-
this.msnTrackingTimestamp = 0;
|
|
51
|
-
// Performance Data to be reported for ops round trips and processing.
|
|
52
|
-
this.latencyStatistics = new Map();
|
|
53
|
-
this.firstConnection = true;
|
|
54
|
-
this.bootTime = (0, client_utils_1.performanceNow)();
|
|
55
|
-
this.connectionStartTime = 0;
|
|
56
|
-
this.gap = 0;
|
|
57
|
-
/**
|
|
58
|
-
* Count of no-ops sent by this client. This variable is reset everytime the OpStats sampled event is logged
|
|
59
|
-
*/
|
|
60
|
-
this.noOpCountForTelemetry = 0;
|
|
61
|
-
/**
|
|
62
|
-
* Cumulative size of the ops processed by this client. This variable is reset everytime the OpStats sampled event is logged
|
|
63
|
-
*/
|
|
64
|
-
this.processedOpSizeForTelemetry = 0;
|
|
65
87
|
this.logger = (0, internal_4.createChildLogger)({ logger, namespace: "OpPerf" });
|
|
66
88
|
const deltaLatencyEventSampler = (() => {
|
|
67
89
|
let eventCount = -1;
|
|
@@ -305,9 +327,6 @@ class OpPerfTelemetry {
|
|
|
305
327
|
}
|
|
306
328
|
}
|
|
307
329
|
}
|
|
308
|
-
OpPerfTelemetry.OP_LATENCY_SAMPLE_RATE = 500;
|
|
309
|
-
OpPerfTelemetry.DELTA_LATENCY_SAMPLE_RATE = 100;
|
|
310
|
-
OpPerfTelemetry.PROCESSED_OPS_SAMPLE_RATE = 500;
|
|
311
330
|
/**
|
|
312
331
|
* Starts monitoring and generation of telemetry related to op performance.
|
|
313
332
|
*
|
|
@@ -319,5 +338,4 @@ OpPerfTelemetry.PROCESSED_OPS_SAMPLE_RATE = 500;
|
|
|
319
338
|
function ReportOpPerfTelemetry(clientId, deltaManager, containerRuntimeEvents, logger) {
|
|
320
339
|
new OpPerfTelemetry(clientId, deltaManager, containerRuntimeEvents, (0, internal_4.createChildLogger)({ logger }));
|
|
321
340
|
}
|
|
322
|
-
exports.ReportOpPerfTelemetry = ReportOpPerfTelemetry;
|
|
323
341
|
//# sourceMappingURL=connectionTelemetry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B,EAAC,EAAE,MAAM,EAAE,CAAC,CAC7B,CAAC;AACH,CAAC;AAZD,sDAYC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performanceNow } from \"@fluid-internal/client-utils\";\nimport type { IDeltaManagerFull } from \"@fluidframework/container-definitions/internal\";\nimport type { IContainerRuntimeEvents } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { ITelemetryBaseLogger, IEventProvider } from \"@fluidframework/core-interfaces\";\nimport { LogLevel } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype IDocumentMessage,\n\tMessageType,\n\ttype ISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { isRuntimeMessage } from \"@fluidframework/driver-utils/internal\";\nimport {\n\tcreateChildLogger,\n\tcreateSampledLogger,\n\tformatTick,\n\ttype IEventSampler,\n\ttype ISampledTelemetryLogger,\n\ttype TelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * We report various latency-related errors when waiting for op roundtrip takes longer than that amout of time.\n */\nexport const latencyThreshold = 5000;\n\n// Phases in OpPerfTelemetry:\n// 1.\tOp is added to DeltaManager (DM) buffer.\n// 2.\tOp is sent to service (op leaves outbound queue).\n// \t - Note: We do not know for sure when op is sent, we only track when it is added to outbound queue.\n// If outbound queue is paused, time queue is paused is counted as network time.\n// 3.\tOp received from service back (pushed to inbound queue).\n// 4.\tOp is processed.\ninterface IOpPerfTelemetryProperties {\n\t/**\n\t * Measure time between (1) and (2) - Measure time outbound op is sitting in queue due to active batch\n\t */\n\tdurationOutboundBatching: number; // was durationOutboundQueue in previous versions\n\t/**\n\t * Measure time between (2) and (3) - Track how long it took for op to be acked by service\n\t */\n\tdurationNetwork: number; // was durationInboundQueue\n\t/**\n\t * Measure time between (3) and (4) - Time between DM's inbound \"push\" event until DM's \"op\" event\n\t */\n\tdurationInboundToProcessing: number;\n\t/**\n\t * Length of the DeltaManager's inbound queue at the time of the DM's inbound \"push\" event (3)\n\t */\n\tlengthInboundQueue: number;\n}\n\n/**\n * Timings collected at various moments during the op processing.\n */\ninterface IOpPerfTimings {\n\t/**\n\t * Starting time for (1)\n\t */\n\tsubmitOpEventTime: number;\n\t/**\n\t * Starting time for (2)\n\t */\n\toutboundPushEventTime: number;\n\t/**\n\t * Starting time for (3)\n\t */\n\tinboundPushEventTime: number;\n}\n\nclass OpPerfTelemetry {\n\tprivate pingLatency: number | undefined;\n\n\t// Collab window tracking. This is timestamp of %1000 message.\n\tprivate sequenceNumberForMsnTracking: number | undefined;\n\tprivate msnTrackingTimestamp: number = 0;\n\t// To track round trip time for every %500 client message.\n\tprivate clientSequenceNumberForLatencyStatistics: number | undefined;\n\t// Performance Data to be reported for ops round trips and processing.\n\tprivate readonly latencyStatistics = new Map<\n\t\tnumber,\n\t\t{\n\t\t\topProcessingTimes: Partial<IOpPerfTimings>;\n\t\t\topPerfData: Partial<IOpPerfTelemetryProperties>;\n\t\t}\n\t>();\n\n\tprivate firstConnection = true;\n\tprivate connectionOpSeqNumber: number | undefined;\n\tprivate readonly bootTime = performanceNow();\n\tprivate connectionStartTime = 0;\n\tprivate gap = 0;\n\n\t/**\n\t * Count of no-ops sent by this client. This variable is reset everytime the OpStats sampled event is logged\n\t */\n\tprivate noOpCountForTelemetry = 0;\n\t/**\n\t * Cumulative size of the ops processed by this client. This variable is reset everytime the OpStats sampled event is logged\n\t */\n\tprivate processedOpSizeForTelemetry = 0;\n\n\tprivate readonly logger: TelemetryLoggerExt;\n\n\tprivate static readonly OP_LATENCY_SAMPLE_RATE = 500;\n\tprivate readonly opLatencyLogger: ISampledTelemetryLogger;\n\n\tprivate static readonly DELTA_LATENCY_SAMPLE_RATE = 100;\n\tprivate readonly deltaLatencyLogger: ISampledTelemetryLogger;\n\n\tprivate static readonly PROCESSED_OPS_SAMPLE_RATE = 500;\n\n\t/**\n\t * A sampled logger to log Ops that have been processed by the current client, the NoOp sent and the\n\t * size of the ops processed within one sampling window of this log event.\n\t * The data from this logger will be used to monitor the efficiency of NoOp-heuristics or to get approximate collab window size.\n\t * Note: no log events are sent when sampling is disabled, because logging at every op will be too noisy.\n\t */\n\tprivate readonly opsLogger: ISampledTelemetryLogger;\n\n\t/**\n\t * Create an instance of OpPerfTelemetry which starts monitoring and generating telemetry related to op performance.\n\t *\n\t * @param clientId - The clientId of the current container.\n\t * @param deltaManager - DeltaManager instance to monitor.\n\t * @param containerRuntimeEvents - Emitter of events for the container runtime.\n\t * @param logger - Telemetry logger to write events to.\n\t */\n\tpublic constructor(\n\t\t/**\n\t\t * The clientId of the current container.\n\t\t *\n\t\t * @remarks Until the container connects to the server and receives an ack for its own join op, this can be undefined.\n\t\t * It gets updated in response to event changes once the value provided by the server is available.\n\t\t * If the container loses its connection, this could be the last known clientId.\n\t\t */\n\t\tprivate clientId: string | undefined,\n\t\t/**\n\t\t * DeltaManager instance to monitor.\n\t\t */\n\t\tprivate readonly deltaManager: IDeltaManagerFull,\n\t\t/**\n\t\t * Emitter of events for the container runtime.\n\t\t */\n\t\tcontainerRuntimeEvents: IEventProvider<IContainerRuntimeEvents>,\n\t\t/**\n\t\t * Telemetry logger to write events to.\n\t\t */\n\t\tlogger: TelemetryLoggerExt,\n\t) {\n\t\tthis.logger = createChildLogger({ logger, namespace: \"OpPerf\" });\n\n\t\tconst deltaLatencyEventSampler: IEventSampler = (() => {\n\t\t\tlet eventCount = -1;\n\t\t\treturn {\n\t\t\t\tsample: () => {\n\t\t\t\t\teventCount++;\n\t\t\t\t\tconst shouldSample = eventCount % OpPerfTelemetry.DELTA_LATENCY_SAMPLE_RATE === 0;\n\t\t\t\t\tif (shouldSample) {\n\t\t\t\t\t\teventCount = 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn shouldSample;\n\t\t\t\t},\n\t\t\t};\n\t\t})();\n\n\t\tthis.deltaLatencyLogger = createSampledLogger(logger, deltaLatencyEventSampler);\n\n\t\t// The SampledLogger here is used get access to the isSamplingDisabled property derived from\n\t\t// telemetry config properties. The actual sampling logic for op messages happens outside this SampledLogger\n\t\t// due to complexity of the different asynchronus scenarios of the op message lifecycle.\n\t\tthis.opLatencyLogger = createSampledLogger(logger);\n\n\t\tconst opsEventSampler: IEventSampler = (() => {\n\t\t\tlet eventCount = 0;\n\t\t\treturn {\n\t\t\t\tsample: () => {\n\t\t\t\t\teventCount++;\n\t\t\t\t\tconst shouldSample = eventCount % OpPerfTelemetry.PROCESSED_OPS_SAMPLE_RATE === 0;\n\t\t\t\t\tif (shouldSample) {\n\t\t\t\t\t\teventCount = 0;\n\t\t\t\t\t\tthis.noOpCountForTelemetry = 0;\n\t\t\t\t\t\tthis.processedOpSizeForTelemetry = 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn shouldSample;\n\t\t\t\t},\n\t\t\t};\n\t\t})();\n\t\tthis.opsLogger = createSampledLogger(\n\t\t\tlogger,\n\t\t\topsEventSampler,\n\t\t\ttrue /* skipLoggingWhenSamplingIsDisabled */,\n\t\t);\n\n\t\tthis.deltaManager.on(\"pong\", (latency) => this.recordPingTime(latency));\n\t\tthis.deltaManager.on(\"submitOp\", (message) => this.beforeOpSubmit(message));\n\t\tthis.deltaManager.on(\"op\", (message) => this.afterProcessingOp(message));\n\t\tthis.deltaManager.on(\"connect\", (details, opsBehind) => {\n\t\t\tif (opsBehind !== undefined) {\n\t\t\t\tthis.connectionOpSeqNumber = this.deltaManager.lastKnownSeqNumber;\n\t\t\t\tthis.gap = opsBehind;\n\t\t\t\tthis.connectionStartTime = performanceNow();\n\n\t\t\t\t// We might be already up-today. If so, report it right away.\n\t\t\t\tif (this.gap <= 0) {\n\t\t\t\t\tthis.reportGettingUpToDate();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.deltaManager.on(\"disconnect\", () => {\n\t\t\tthis.sequenceNumberForMsnTracking = undefined;\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = undefined;\n\t\t\tthis.connectionOpSeqNumber = undefined;\n\t\t\tthis.firstConnection = false;\n\t\t\tthis.latencyStatistics.clear();\n\t\t});\n\n\t\tthis.deltaManager.outbound.on(\"push\", (messages) => {\n\t\t\tfor (const msg of messages) {\n\t\t\t\tif (\n\t\t\t\t\tmsg.type === MessageType.Operation &&\n\t\t\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === msg.clientSequenceNumber)\n\t\t\t\t) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tconst latencyStats = this.latencyStatistics.get(msg.clientSequenceNumber)!;\n\t\t\t\t\tassert(latencyStats !== undefined, 0x7c2 /* Latency stats for op should exist */);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime === undefined,\n\t\t\t\t\t\t0x2c8 /* \"outboundPushEventTime should be undefined\" */,\n\t\t\t\t\t);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opPerfData.durationNetwork === undefined,\n\t\t\t\t\t\t0x2c9 /* \"durationNetwork should be undefined\" */,\n\t\t\t\t\t);\n\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime = Date.now();\n\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opPerfData.durationOutboundBatching === undefined,\n\t\t\t\t\t\t0x2ca /* \"durationOutboundBatching should be undefined\" */,\n\t\t\t\t\t);\n\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.submitOpEventTime !== undefined,\n\t\t\t\t\t\t0x2cb /* \"submitOpEventTime should be undefined\" */,\n\t\t\t\t\t);\n\n\t\t\t\t\tlatencyStats.opPerfData.durationOutboundBatching =\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime -\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.submitOpEventTime;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tthis.deltaManager.inbound.on(\"push\", (message: ISequencedDocumentMessage) => {\n\t\t\tif (\n\t\t\t\tthis.clientId === message.clientId &&\n\t\t\t\tmessage.type === MessageType.Operation &&\n\t\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber)\n\t\t\t) {\n\t\t\t\t// We do an explicit check for undefined right after this\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tconst latencyStats = this.latencyStatistics.get(message.clientSequenceNumber)!;\n\t\t\t\tassert(latencyStats !== undefined, 0x7c3 /* Latency stats for op should exist */);\n\t\t\t\tif (latencyStats.opProcessingTimes.outboundPushEventTime !== undefined) {\n\t\t\t\t\tlatencyStats.opProcessingTimes.inboundPushEventTime = Date.now();\n\t\t\t\t\tlatencyStats.opPerfData.durationNetwork =\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.inboundPushEventTime -\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime;\n\t\t\t\t\tlatencyStats.opPerfData.lengthInboundQueue = this.deltaManager.inbound.length;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isRuntimeMessage(message) && typeof message.contents === \"string\") {\n\t\t\t\tthis.processedOpSizeForTelemetry += message.contents.length;\n\t\t\t}\n\t\t});\n\n\t\tthis.deltaManager.inbound.on(\"idle\", (count: number, duration: number) => {\n\t\t\t// Do not want to log zero for sure.\n\t\t\t// We are more interested in aggregates, so logging only if we are processing some number of ops\n\t\t\t// Cut-off is arbitrary - can be increased or decreased based on amount of data collected and questions we\n\t\t\t// want to get answered\n\t\t\t// back-compat: Once 0.36 loader version saturates (count & duration args were added there),\n\t\t\t// we can remove typeof check.\n\t\t\tif (typeof count === \"number\" && count >= 100) {\n\t\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\t\teventName: \"GetDeltas_OpProcessing\",\n\t\t\t\t\tcount,\n\t\t\t\t\tduration,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tcontainerRuntimeEvents.on(\"connected\", (newClientId) => {\n\t\t\tthis.clientId = newClientId;\n\t\t});\n\t}\n\n\tprivate reportGettingUpToDate(): void {\n\t\tthis.connectionOpSeqNumber = undefined;\n\t\tthis.logger.sendPerformanceEvent(\n\t\t\t{\n\t\t\t\teventName: \"ConnectionSpeed\",\n\t\t\t\tduration: performanceNow() - this.connectionStartTime,\n\t\t\t\tops: this.gap,\n\t\t\t\t// track time to connect only for first connection.\n\t\t\t\ttimeToConnect: this.firstConnection\n\t\t\t\t\t? formatTick(this.connectionStartTime - this.bootTime)\n\t\t\t\t\t: undefined,\n\t\t\t\tfirstConnection: this.firstConnection,\n\t\t\t},\n\t\t\tundefined, // error\n\t\t\tLogLevel.info,\n\t\t);\n\t}\n\n\tprivate recordPingTime(latency: number): void {\n\t\tthis.pingLatency = latency;\n\n\t\t// Log if latency is longer than 1 min\n\t\tif (latency > 1000 * 60) {\n\t\t\tthis.logger.sendErrorEvent({\n\t\t\t\teventName: \"LatencyTooLong\",\n\t\t\t\tduration: latency,\n\t\t\t});\n\t\t}\n\n\t\t// logging one in every DELTA_LATENCY_SAMPLE_RATE pongs, including the first time, if it is a \"write\" client.\n\t\tif (this.deltaManager.active) {\n\t\t\tthis.deltaLatencyLogger.sendPerformanceEvent({\n\t\t\t\teventName: \"DeltaLatency\",\n\t\t\t\tduration: latency,\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate beforeOpSubmit(message: IDocumentMessage): void {\n\t\t// start with first client op and measure latency every 500 client ops\n\t\tif (\n\t\t\tthis.opLatencyLogger.isSamplingDisabled ||\n\t\t\t(this.clientSequenceNumberForLatencyStatistics === undefined &&\n\t\t\t\tmessage.clientSequenceNumber % OpPerfTelemetry.OP_LATENCY_SAMPLE_RATE === 1)\n\t\t) {\n\t\t\tassert(\n\t\t\t\tthis.latencyStatistics.get(message.clientSequenceNumber) === undefined,\n\t\t\t\t0x7c4 /* Existing op perf data for client sequence number */,\n\t\t\t);\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = message.clientSequenceNumber;\n\t\t\tthis.latencyStatistics.set(message.clientSequenceNumber, {\n\t\t\t\topProcessingTimes: {\n\t\t\t\t\tsubmitOpEventTime: Date.now(),\n\t\t\t\t},\n\t\t\t\topPerfData: {},\n\t\t\t});\n\t\t}\n\n\t\tif (message.type === MessageType.NoOp) {\n\t\t\t// Count the number of no-ops submitted by this client.\n\t\t\t// The value is reset when we log the OpStats sampled event.\n\t\t\tthis.noOpCountForTelemetry++;\n\t\t}\n\t}\n\n\tprivate afterProcessingOp(message: ISequencedDocumentMessage): void {\n\t\tconst sequenceNumber = message.sequenceNumber;\n\n\t\tif (sequenceNumber === this.connectionOpSeqNumber) {\n\t\t\tthis.reportGettingUpToDate();\n\t\t}\n\n\t\t// Record collab window max size after every 1000th op.\n\t\tif (this.sequenceNumberForMsnTracking === undefined && sequenceNumber % 1000 === 0) {\n\t\t\tthis.sequenceNumberForMsnTracking = sequenceNumber;\n\t\t\tthis.msnTrackingTimestamp = message.timestamp;\n\t\t}\n\t\tif (\n\t\t\tthis.sequenceNumberForMsnTracking !== undefined &&\n\t\t\tmessage.minimumSequenceNumber >= this.sequenceNumberForMsnTracking\n\t\t) {\n\t\t\tassert(\n\t\t\t\tthis.msnTrackingTimestamp !== undefined,\n\t\t\t\t0x2ce /* \"msnTrackingTimestamp should not be undefined\" */,\n\t\t\t);\n\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\teventName: \"MsnStatistics\",\n\t\t\t\tsequenceNumber,\n\t\t\t\tmsnDistance: sequenceNumber - this.sequenceNumberForMsnTracking,\n\t\t\t\tduration: message.timestamp - this.msnTrackingTimestamp,\n\t\t\t});\n\t\t\tthis.sequenceNumberForMsnTracking = undefined;\n\t\t}\n\n\t\tif (\n\t\t\tthis.clientId === message.clientId &&\n\t\t\tmessage.type === MessageType.Operation &&\n\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber)\n\t\t) {\n\t\t\t// We do an explicit check for undefined right after this\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst latencyData = this.latencyStatistics.get(message.clientSequenceNumber)!;\n\t\t\tassert(latencyData !== undefined, 0x7c5 /* Undefined latency statistics for op */);\n\t\t\tassert(\n\t\t\t\tlatencyData.opProcessingTimes.submitOpEventTime !== undefined,\n\t\t\t\t0x120 /* \"Undefined latency statistics for op (op send time)\" */,\n\t\t\t);\n\t\t\tconst currentTime = Date.now();\n\t\t\tif (latencyData.opProcessingTimes.inboundPushEventTime !== undefined) {\n\t\t\t\tlatencyData.opPerfData.durationInboundToProcessing =\n\t\t\t\t\tcurrentTime - latencyData.opProcessingTimes.inboundPushEventTime;\n\t\t\t}\n\t\t\tconst duration = currentTime - latencyData.opProcessingTimes.submitOpEventTime;\n\n\t\t\t// One of the core expectations for Fluid service is to be fast.\n\t\t\t// When it's not the case, we want to learn about it and be able to investigate, so\n\t\t\t// raise awareness.\n\t\t\t// This also helps identify cases where it's due to client behavior (sending too many ops)\n\t\t\t// that results in overwhelming ordering service and thus starting to see long latencies.\n\t\t\t// The threshold could be adjusted, but ideally it stays workload-agnostic, as service\n\t\t\t// performance impacts all workloads relying on service.\n\t\t\tconst category = duration > latencyThreshold ? \"error\" : \"performance\";\n\t\t\tthis.opLatencyLogger.sendPerformanceEvent({\n\t\t\t\teventName: \"OpRoundtripTime\",\n\t\t\t\tsequenceNumber,\n\t\t\t\treferenceSequenceNumber: message.referenceSequenceNumber,\n\t\t\t\tduration,\n\t\t\t\tcategory,\n\t\t\t\tpingLatency: this.pingLatency,\n\t\t\t\tmsnDistance:\n\t\t\t\t\tthis.deltaManager.lastSequenceNumber - this.deltaManager.minimumSequenceNumber,\n\t\t\t\t...latencyData.opPerfData,\n\t\t\t});\n\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = undefined;\n\t\t\tthis.latencyStatistics.delete(message.clientSequenceNumber);\n\t\t}\n\n\t\tif (isRuntimeMessage(message)) {\n\t\t\t// Sampled logging of Ops that have been processed by the current client, the NoOp sent and the\n\t\t\t// size of the ops processed within one sampling window of this log event.\n\t\t\t// This data will be used to monitor the efficiency of NoOp-heuristics or to get approximate collab window size.\n\t\t\tthis.opsLogger.sendPerformanceEvent({\n\t\t\t\teventName: \"OpStats\",\n\t\t\t\t// Logging as 'details' property to avoid adding new column name to the log tables */\n\t\t\t\tdetails: {\n\t\t\t\t\t// Count of the ops processed by the current client. Note: these counts are after\n\t\t\t\t\t// compression/grouping/chunking (if enabled) of the ops.\n\t\t\t\t\tprocessedOpCount: OpPerfTelemetry.PROCESSED_OPS_SAMPLE_RATE,\n\t\t\t\t\t// Cumulative size of all the ops processed by the current client since the last OpStats event log\n\t\t\t\t\tprocessedOpSize: this.processedOpSizeForTelemetry,\n\t\t\t\t\t// Count of all the NoOp sent by the current client since the last OpStats event log\n\t\t\t\t\tsubmitedNoOpCount: this.noOpCountForTelemetry,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n}\n\n/**\n * Starts monitoring and generation of telemetry related to op performance.\n *\n * @param clientId - The clientId of the current container.\n * @param deltaManager - DeltaManager instance to monitor.\n * @param containerRuntimeEvents - Emitter of events for the container runtime.\n * @param logger - Telemetry logger to write events to.\n */\nexport function ReportOpPerfTelemetry(\n\tclientId: string | undefined,\n\tdeltaManager: IDeltaManagerFull,\n\tcontainerRuntimeEvents: IEventProvider<IContainerRuntimeEvents>,\n\tlogger: ITelemetryBaseLogger,\n): void {\n\tnew OpPerfTelemetry(\n\t\tclientId,\n\t\tdeltaManager,\n\t\tcontainerRuntimeEvents,\n\t\tcreateChildLogger({ logger }),\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"connectionTelemetry.js","sourceRoot":"","sources":["../src/connectionTelemetry.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAqdH,sDAYC;AA/dD,+DAA8D;AAI9D,qEAA2D;AAC3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eAAe,CAClB,QAAQ,EACR,YAAY,EACZ,sBAAsB,EACtB,IAAA,4BAAiB,EAAC,EAAE,MAAM,EAAE,CAAC,CAC7B,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performanceNow } from \"@fluid-internal/client-utils\";\nimport type { IDeltaManagerFull } from \"@fluidframework/container-definitions/internal\";\nimport type { IContainerRuntimeEvents } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { ITelemetryBaseLogger, IEventProvider } from \"@fluidframework/core-interfaces\";\nimport { LogLevel } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype IDocumentMessage,\n\tMessageType,\n\ttype ISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { isRuntimeMessage } from \"@fluidframework/driver-utils/internal\";\nimport {\n\tcreateChildLogger,\n\tcreateSampledLogger,\n\tformatTick,\n\ttype IEventSampler,\n\ttype ISampledTelemetryLogger,\n\ttype TelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * We report various latency-related errors when waiting for op roundtrip takes longer than that amout of time.\n */\nexport const latencyThreshold = 5000;\n\n// Phases in OpPerfTelemetry:\n// 1.\tOp is added to DeltaManager (DM) buffer.\n// 2.\tOp is sent to service (op leaves outbound queue).\n// \t - Note: We do not know for sure when op is sent, we only track when it is added to outbound queue.\n// If outbound queue is paused, time queue is paused is counted as network time.\n// 3.\tOp received from service back (pushed to inbound queue).\n// 4.\tOp is processed.\ninterface IOpPerfTelemetryProperties {\n\t/**\n\t * Measure time between (1) and (2) - Measure time outbound op is sitting in queue due to active batch\n\t */\n\tdurationOutboundBatching: number; // was durationOutboundQueue in previous versions\n\t/**\n\t * Measure time between (2) and (3) - Track how long it took for op to be acked by service\n\t */\n\tdurationNetwork: number; // was durationInboundQueue\n\t/**\n\t * Measure time between (3) and (4) - Time between DM's inbound \"push\" event until DM's \"op\" event\n\t */\n\tdurationInboundToProcessing: number;\n\t/**\n\t * Length of the DeltaManager's inbound queue at the time of the DM's inbound \"push\" event (3)\n\t */\n\tlengthInboundQueue: number;\n}\n\n/**\n * Timings collected at various moments during the op processing.\n */\ninterface IOpPerfTimings {\n\t/**\n\t * Starting time for (1)\n\t */\n\tsubmitOpEventTime: number;\n\t/**\n\t * Starting time for (2)\n\t */\n\toutboundPushEventTime: number;\n\t/**\n\t * Starting time for (3)\n\t */\n\tinboundPushEventTime: number;\n}\n\nclass OpPerfTelemetry {\n\tprivate pingLatency: number | undefined;\n\n\t// Collab window tracking. This is timestamp of %1000 message.\n\tprivate sequenceNumberForMsnTracking: number | undefined;\n\tprivate msnTrackingTimestamp: number = 0;\n\t// To track round trip time for every %500 client message.\n\tprivate clientSequenceNumberForLatencyStatistics: number | undefined;\n\t// Performance Data to be reported for ops round trips and processing.\n\tprivate readonly latencyStatistics = new Map<\n\t\tnumber,\n\t\t{\n\t\t\topProcessingTimes: Partial<IOpPerfTimings>;\n\t\t\topPerfData: Partial<IOpPerfTelemetryProperties>;\n\t\t}\n\t>();\n\n\tprivate firstConnection = true;\n\tprivate connectionOpSeqNumber: number | undefined;\n\tprivate readonly bootTime = performanceNow();\n\tprivate connectionStartTime = 0;\n\tprivate gap = 0;\n\n\t/**\n\t * Count of no-ops sent by this client. This variable is reset everytime the OpStats sampled event is logged\n\t */\n\tprivate noOpCountForTelemetry = 0;\n\t/**\n\t * Cumulative size of the ops processed by this client. This variable is reset everytime the OpStats sampled event is logged\n\t */\n\tprivate processedOpSizeForTelemetry = 0;\n\n\tprivate readonly logger: TelemetryLoggerExt;\n\n\tprivate static readonly OP_LATENCY_SAMPLE_RATE = 500;\n\tprivate readonly opLatencyLogger: ISampledTelemetryLogger;\n\n\tprivate static readonly DELTA_LATENCY_SAMPLE_RATE = 100;\n\tprivate readonly deltaLatencyLogger: ISampledTelemetryLogger;\n\n\tprivate static readonly PROCESSED_OPS_SAMPLE_RATE = 500;\n\n\t/**\n\t * A sampled logger to log Ops that have been processed by the current client, the NoOp sent and the\n\t * size of the ops processed within one sampling window of this log event.\n\t * The data from this logger will be used to monitor the efficiency of NoOp-heuristics or to get approximate collab window size.\n\t * Note: no log events are sent when sampling is disabled, because logging at every op will be too noisy.\n\t */\n\tprivate readonly opsLogger: ISampledTelemetryLogger;\n\n\t/**\n\t * Create an instance of OpPerfTelemetry which starts monitoring and generating telemetry related to op performance.\n\t *\n\t * @param clientId - The clientId of the current container.\n\t * @param deltaManager - DeltaManager instance to monitor.\n\t * @param containerRuntimeEvents - Emitter of events for the container runtime.\n\t * @param logger - Telemetry logger to write events to.\n\t */\n\tpublic constructor(\n\t\t/**\n\t\t * The clientId of the current container.\n\t\t *\n\t\t * @remarks Until the container connects to the server and receives an ack for its own join op, this can be undefined.\n\t\t * It gets updated in response to event changes once the value provided by the server is available.\n\t\t * If the container loses its connection, this could be the last known clientId.\n\t\t */\n\t\tprivate clientId: string | undefined,\n\t\t/**\n\t\t * DeltaManager instance to monitor.\n\t\t */\n\t\tprivate readonly deltaManager: IDeltaManagerFull,\n\t\t/**\n\t\t * Emitter of events for the container runtime.\n\t\t */\n\t\tcontainerRuntimeEvents: IEventProvider<IContainerRuntimeEvents>,\n\t\t/**\n\t\t * Telemetry logger to write events to.\n\t\t */\n\t\tlogger: TelemetryLoggerExt,\n\t) {\n\t\tthis.logger = createChildLogger({ logger, namespace: \"OpPerf\" });\n\n\t\tconst deltaLatencyEventSampler: IEventSampler = (() => {\n\t\t\tlet eventCount = -1;\n\t\t\treturn {\n\t\t\t\tsample: () => {\n\t\t\t\t\teventCount++;\n\t\t\t\t\tconst shouldSample = eventCount % OpPerfTelemetry.DELTA_LATENCY_SAMPLE_RATE === 0;\n\t\t\t\t\tif (shouldSample) {\n\t\t\t\t\t\teventCount = 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn shouldSample;\n\t\t\t\t},\n\t\t\t};\n\t\t})();\n\n\t\tthis.deltaLatencyLogger = createSampledLogger(logger, deltaLatencyEventSampler);\n\n\t\t// The SampledLogger here is used get access to the isSamplingDisabled property derived from\n\t\t// telemetry config properties. The actual sampling logic for op messages happens outside this SampledLogger\n\t\t// due to complexity of the different asynchronus scenarios of the op message lifecycle.\n\t\tthis.opLatencyLogger = createSampledLogger(logger);\n\n\t\tconst opsEventSampler: IEventSampler = (() => {\n\t\t\tlet eventCount = 0;\n\t\t\treturn {\n\t\t\t\tsample: () => {\n\t\t\t\t\teventCount++;\n\t\t\t\t\tconst shouldSample = eventCount % OpPerfTelemetry.PROCESSED_OPS_SAMPLE_RATE === 0;\n\t\t\t\t\tif (shouldSample) {\n\t\t\t\t\t\teventCount = 0;\n\t\t\t\t\t\tthis.noOpCountForTelemetry = 0;\n\t\t\t\t\t\tthis.processedOpSizeForTelemetry = 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn shouldSample;\n\t\t\t\t},\n\t\t\t};\n\t\t})();\n\t\tthis.opsLogger = createSampledLogger(\n\t\t\tlogger,\n\t\t\topsEventSampler,\n\t\t\ttrue /* skipLoggingWhenSamplingIsDisabled */,\n\t\t);\n\n\t\tthis.deltaManager.on(\"pong\", (latency) => this.recordPingTime(latency));\n\t\tthis.deltaManager.on(\"submitOp\", (message) => this.beforeOpSubmit(message));\n\t\tthis.deltaManager.on(\"op\", (message) => this.afterProcessingOp(message));\n\t\tthis.deltaManager.on(\"connect\", (details, opsBehind) => {\n\t\t\tif (opsBehind !== undefined) {\n\t\t\t\tthis.connectionOpSeqNumber = this.deltaManager.lastKnownSeqNumber;\n\t\t\t\tthis.gap = opsBehind;\n\t\t\t\tthis.connectionStartTime = performanceNow();\n\n\t\t\t\t// We might be already up-today. If so, report it right away.\n\t\t\t\tif (this.gap <= 0) {\n\t\t\t\t\tthis.reportGettingUpToDate();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.deltaManager.on(\"disconnect\", () => {\n\t\t\tthis.sequenceNumberForMsnTracking = undefined;\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = undefined;\n\t\t\tthis.connectionOpSeqNumber = undefined;\n\t\t\tthis.firstConnection = false;\n\t\t\tthis.latencyStatistics.clear();\n\t\t});\n\n\t\tthis.deltaManager.outbound.on(\"push\", (messages) => {\n\t\t\tfor (const msg of messages) {\n\t\t\t\tif (\n\t\t\t\t\tmsg.type === MessageType.Operation &&\n\t\t\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === msg.clientSequenceNumber)\n\t\t\t\t) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tconst latencyStats = this.latencyStatistics.get(msg.clientSequenceNumber)!;\n\t\t\t\t\tassert(latencyStats !== undefined, 0x7c2 /* Latency stats for op should exist */);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime === undefined,\n\t\t\t\t\t\t0x2c8 /* \"outboundPushEventTime should be undefined\" */,\n\t\t\t\t\t);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opPerfData.durationNetwork === undefined,\n\t\t\t\t\t\t0x2c9 /* \"durationNetwork should be undefined\" */,\n\t\t\t\t\t);\n\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime = Date.now();\n\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opPerfData.durationOutboundBatching === undefined,\n\t\t\t\t\t\t0x2ca /* \"durationOutboundBatching should be undefined\" */,\n\t\t\t\t\t);\n\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.submitOpEventTime !== undefined,\n\t\t\t\t\t\t0x2cb /* \"submitOpEventTime should be undefined\" */,\n\t\t\t\t\t);\n\n\t\t\t\t\tlatencyStats.opPerfData.durationOutboundBatching =\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime -\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.submitOpEventTime;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tthis.deltaManager.inbound.on(\"push\", (message: ISequencedDocumentMessage) => {\n\t\t\tif (\n\t\t\t\tthis.clientId === message.clientId &&\n\t\t\t\tmessage.type === MessageType.Operation &&\n\t\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber)\n\t\t\t) {\n\t\t\t\t// We do an explicit check for undefined right after this\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tconst latencyStats = this.latencyStatistics.get(message.clientSequenceNumber)!;\n\t\t\t\tassert(latencyStats !== undefined, 0x7c3 /* Latency stats for op should exist */);\n\t\t\t\tif (latencyStats.opProcessingTimes.outboundPushEventTime !== undefined) {\n\t\t\t\t\tlatencyStats.opProcessingTimes.inboundPushEventTime = Date.now();\n\t\t\t\t\tlatencyStats.opPerfData.durationNetwork =\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.inboundPushEventTime -\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime;\n\t\t\t\t\tlatencyStats.opPerfData.lengthInboundQueue = this.deltaManager.inbound.length;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isRuntimeMessage(message) && typeof message.contents === \"string\") {\n\t\t\t\tthis.processedOpSizeForTelemetry += message.contents.length;\n\t\t\t}\n\t\t});\n\n\t\tthis.deltaManager.inbound.on(\"idle\", (count: number, duration: number) => {\n\t\t\t// Do not want to log zero for sure.\n\t\t\t// We are more interested in aggregates, so logging only if we are processing some number of ops\n\t\t\t// Cut-off is arbitrary - can be increased or decreased based on amount of data collected and questions we\n\t\t\t// want to get answered\n\t\t\t// back-compat: Once 0.36 loader version saturates (count & duration args were added there),\n\t\t\t// we can remove typeof check.\n\t\t\tif (typeof count === \"number\" && count >= 100) {\n\t\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\t\teventName: \"GetDeltas_OpProcessing\",\n\t\t\t\t\tcount,\n\t\t\t\t\tduration,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tcontainerRuntimeEvents.on(\"connected\", (newClientId) => {\n\t\t\tthis.clientId = newClientId;\n\t\t});\n\t}\n\n\tprivate reportGettingUpToDate(): void {\n\t\tthis.connectionOpSeqNumber = undefined;\n\t\tthis.logger.sendPerformanceEvent(\n\t\t\t{\n\t\t\t\teventName: \"ConnectionSpeed\",\n\t\t\t\tduration: performanceNow() - this.connectionStartTime,\n\t\t\t\tops: this.gap,\n\t\t\t\t// track time to connect only for first connection.\n\t\t\t\ttimeToConnect: this.firstConnection\n\t\t\t\t\t? formatTick(this.connectionStartTime - this.bootTime)\n\t\t\t\t\t: undefined,\n\t\t\t\tfirstConnection: this.firstConnection,\n\t\t\t},\n\t\t\tundefined, // error\n\t\t\tLogLevel.info,\n\t\t);\n\t}\n\n\tprivate recordPingTime(latency: number): void {\n\t\tthis.pingLatency = latency;\n\n\t\t// Log if latency is longer than 1 min\n\t\tif (latency > 1000 * 60) {\n\t\t\tthis.logger.sendErrorEvent({\n\t\t\t\teventName: \"LatencyTooLong\",\n\t\t\t\tduration: latency,\n\t\t\t});\n\t\t}\n\n\t\t// logging one in every DELTA_LATENCY_SAMPLE_RATE pongs, including the first time, if it is a \"write\" client.\n\t\tif (this.deltaManager.active) {\n\t\t\tthis.deltaLatencyLogger.sendPerformanceEvent({\n\t\t\t\teventName: \"DeltaLatency\",\n\t\t\t\tduration: latency,\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate beforeOpSubmit(message: IDocumentMessage): void {\n\t\t// start with first client op and measure latency every 500 client ops\n\t\tif (\n\t\t\tthis.opLatencyLogger.isSamplingDisabled ||\n\t\t\t(this.clientSequenceNumberForLatencyStatistics === undefined &&\n\t\t\t\tmessage.clientSequenceNumber % OpPerfTelemetry.OP_LATENCY_SAMPLE_RATE === 1)\n\t\t) {\n\t\t\tassert(\n\t\t\t\tthis.latencyStatistics.get(message.clientSequenceNumber) === undefined,\n\t\t\t\t0x7c4 /* Existing op perf data for client sequence number */,\n\t\t\t);\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = message.clientSequenceNumber;\n\t\t\tthis.latencyStatistics.set(message.clientSequenceNumber, {\n\t\t\t\topProcessingTimes: {\n\t\t\t\t\tsubmitOpEventTime: Date.now(),\n\t\t\t\t},\n\t\t\t\topPerfData: {},\n\t\t\t});\n\t\t}\n\n\t\tif (message.type === MessageType.NoOp) {\n\t\t\t// Count the number of no-ops submitted by this client.\n\t\t\t// The value is reset when we log the OpStats sampled event.\n\t\t\tthis.noOpCountForTelemetry++;\n\t\t}\n\t}\n\n\tprivate afterProcessingOp(message: ISequencedDocumentMessage): void {\n\t\tconst sequenceNumber = message.sequenceNumber;\n\n\t\tif (sequenceNumber === this.connectionOpSeqNumber) {\n\t\t\tthis.reportGettingUpToDate();\n\t\t}\n\n\t\t// Record collab window max size after every 1000th op.\n\t\tif (this.sequenceNumberForMsnTracking === undefined && sequenceNumber % 1000 === 0) {\n\t\t\tthis.sequenceNumberForMsnTracking = sequenceNumber;\n\t\t\tthis.msnTrackingTimestamp = message.timestamp;\n\t\t}\n\t\tif (\n\t\t\tthis.sequenceNumberForMsnTracking !== undefined &&\n\t\t\tmessage.minimumSequenceNumber >= this.sequenceNumberForMsnTracking\n\t\t) {\n\t\t\tassert(\n\t\t\t\tthis.msnTrackingTimestamp !== undefined,\n\t\t\t\t0x2ce /* \"msnTrackingTimestamp should not be undefined\" */,\n\t\t\t);\n\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\teventName: \"MsnStatistics\",\n\t\t\t\tsequenceNumber,\n\t\t\t\tmsnDistance: sequenceNumber - this.sequenceNumberForMsnTracking,\n\t\t\t\tduration: message.timestamp - this.msnTrackingTimestamp,\n\t\t\t});\n\t\t\tthis.sequenceNumberForMsnTracking = undefined;\n\t\t}\n\n\t\tif (\n\t\t\tthis.clientId === message.clientId &&\n\t\t\tmessage.type === MessageType.Operation &&\n\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber)\n\t\t) {\n\t\t\t// We do an explicit check for undefined right after this\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst latencyData = this.latencyStatistics.get(message.clientSequenceNumber)!;\n\t\t\tassert(latencyData !== undefined, 0x7c5 /* Undefined latency statistics for op */);\n\t\t\tassert(\n\t\t\t\tlatencyData.opProcessingTimes.submitOpEventTime !== undefined,\n\t\t\t\t0x120 /* \"Undefined latency statistics for op (op send time)\" */,\n\t\t\t);\n\t\t\tconst currentTime = Date.now();\n\t\t\tif (latencyData.opProcessingTimes.inboundPushEventTime !== undefined) {\n\t\t\t\tlatencyData.opPerfData.durationInboundToProcessing =\n\t\t\t\t\tcurrentTime - latencyData.opProcessingTimes.inboundPushEventTime;\n\t\t\t}\n\t\t\tconst duration = currentTime - latencyData.opProcessingTimes.submitOpEventTime;\n\n\t\t\t// One of the core expectations for Fluid service is to be fast.\n\t\t\t// When it's not the case, we want to learn about it and be able to investigate, so\n\t\t\t// raise awareness.\n\t\t\t// This also helps identify cases where it's due to client behavior (sending too many ops)\n\t\t\t// that results in overwhelming ordering service and thus starting to see long latencies.\n\t\t\t// The threshold could be adjusted, but ideally it stays workload-agnostic, as service\n\t\t\t// performance impacts all workloads relying on service.\n\t\t\tconst category = duration > latencyThreshold ? \"error\" : \"performance\";\n\t\t\tthis.opLatencyLogger.sendPerformanceEvent({\n\t\t\t\teventName: \"OpRoundtripTime\",\n\t\t\t\tsequenceNumber,\n\t\t\t\treferenceSequenceNumber: message.referenceSequenceNumber,\n\t\t\t\tduration,\n\t\t\t\tcategory,\n\t\t\t\tpingLatency: this.pingLatency,\n\t\t\t\tmsnDistance:\n\t\t\t\t\tthis.deltaManager.lastSequenceNumber - this.deltaManager.minimumSequenceNumber,\n\t\t\t\t...latencyData.opPerfData,\n\t\t\t});\n\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = undefined;\n\t\t\tthis.latencyStatistics.delete(message.clientSequenceNumber);\n\t\t}\n\n\t\tif (isRuntimeMessage(message)) {\n\t\t\t// Sampled logging of Ops that have been processed by the current client, the NoOp sent and the\n\t\t\t// size of the ops processed within one sampling window of this log event.\n\t\t\t// This data will be used to monitor the efficiency of NoOp-heuristics or to get approximate collab window size.\n\t\t\tthis.opsLogger.sendPerformanceEvent({\n\t\t\t\teventName: \"OpStats\",\n\t\t\t\t// Logging as 'details' property to avoid adding new column name to the log tables */\n\t\t\t\tdetails: {\n\t\t\t\t\t// Count of the ops processed by the current client. Note: these counts are after\n\t\t\t\t\t// compression/grouping/chunking (if enabled) of the ops.\n\t\t\t\t\tprocessedOpCount: OpPerfTelemetry.PROCESSED_OPS_SAMPLE_RATE,\n\t\t\t\t\t// Cumulative size of all the ops processed by the current client since the last OpStats event log\n\t\t\t\t\tprocessedOpSize: this.processedOpSizeForTelemetry,\n\t\t\t\t\t// Count of all the NoOp sent by the current client since the last OpStats event log\n\t\t\t\t\tsubmitedNoOpCount: this.noOpCountForTelemetry,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n}\n\n/**\n * Starts monitoring and generation of telemetry related to op performance.\n *\n * @param clientId - The clientId of the current container.\n * @param deltaManager - DeltaManager instance to monitor.\n * @param containerRuntimeEvents - Emitter of events for the container runtime.\n * @param logger - Telemetry logger to write events to.\n */\nexport function ReportOpPerfTelemetry(\n\tclientId: string | undefined,\n\tdeltaManager: IDeltaManagerFull,\n\tcontainerRuntimeEvents: IEventProvider<IContainerRuntimeEvents>,\n\tlogger: ITelemetryBaseLogger,\n): void {\n\tnew OpPerfTelemetry(\n\t\tclientId,\n\t\tdeltaManager,\n\t\tcontainerRuntimeEvents,\n\t\tcreateChildLogger({ logger }),\n\t);\n}\n"]}
|
|
@@ -37,15 +37,15 @@ export type RuntimeOptionKeysThatRequireExplicitSchemaControl = keyof Omit<Runti
|
|
|
37
37
|
/**
|
|
38
38
|
* Keys of {@link ContainerRuntimeOptionsInternal} that require explicitSchemaControl to be enabled.
|
|
39
39
|
*/
|
|
40
|
-
export declare const runtimeOptionKeysThatRequireExplicitSchemaControl:
|
|
40
|
+
export declare const runtimeOptionKeysThatRequireExplicitSchemaControl: RuntimeOptionKeysThatRequireExplicitSchemaControl[];
|
|
41
41
|
/**
|
|
42
42
|
* Returns the default RuntimeOptionsAffectingDocSchema configuration for a given minVersionForCollab.
|
|
43
43
|
*/
|
|
44
44
|
export declare function getMinVersionForCollabDefaults(minVersionForCollab: OldestSupportedClientVersion): RuntimeOptionsAffectingDocSchema;
|
|
45
45
|
/**
|
|
46
46
|
* Validates if the runtime options passed in from the user are compatible with the minVersionForCollab.
|
|
47
|
-
* For example, if a user
|
|
48
|
-
* is set to "
|
|
47
|
+
* For example, if a user enables an option introduced in 2.40.0 while the
|
|
48
|
+
* minVersionForCollab is set to "2.0.0", then we should throw a UsageError.
|
|
49
49
|
* */
|
|
50
50
|
export declare function validateRuntimeOptions(minVersionForCollab: OldestSupportedClientVersion, runtimeOptions: Partial<ContainerRuntimeOptionsInternal>): void;
|
|
51
51
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerCompatibility.d.ts","sourceRoot":"","sources":["../src/containerCompatibility.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,KAAK,4BAA4B,EACjC,MAAM,8CAA8C,CAAC;AAatD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAE7E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,gCAAgC,GAAG,IAAI,CAClD,+BAA+B,EAC7B,kBAAkB,GAClB,qBAAqB,GACrB,gCAAgC,GAChC,gBAAgB,GAChB,+BAA+B,GAC/B,sBAAsB,CACxB,CAAC;AAEF;;;;;;;GAOG;AACH,KAAK,+CAA+C,GAAG,MAAM,IAAI,CAChE,gCAAgC,EAC9B,uBAAuB,GACvB,oBAAoB,GACpB,2BAA2B,GAC3B,WAAW,GACX,WAAW,GACX,uBAAuB,CACzB,CAAC;AAmBF;;GAEG;AACH,MAAM,MAAM,iDAAiD,GAAG,MAAM,IAAI,CACzE,gCAAgC,EAChC,+CAA+C,CAC/C,CAAC;
|
|
1
|
+
{"version":3,"file":"containerCompatibility.d.ts","sourceRoot":"","sources":["../src/containerCompatibility.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,KAAK,4BAA4B,EACjC,MAAM,8CAA8C,CAAC;AAatD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAE7E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,gCAAgC,GAAG,IAAI,CAClD,+BAA+B,EAC7B,kBAAkB,GAClB,qBAAqB,GACrB,gCAAgC,GAChC,gBAAgB,GAChB,+BAA+B,GAC/B,sBAAsB,CACxB,CAAC;AAEF;;;;;;;GAOG;AACH,KAAK,+CAA+C,GAAG,MAAM,IAAI,CAChE,gCAAgC,EAC9B,uBAAuB,GACvB,oBAAoB,GACpB,2BAA2B,GAC3B,WAAW,GACX,WAAW,GACX,uBAAuB,CACzB,CAAC;AAmBF;;GAEG;AACH,MAAM,MAAM,iDAAiD,GAAG,MAAM,IAAI,CACzE,gCAAgC,EAChC,+CAA+C,CAC/C,CAAC;AAmEF;;GAEG;AACH,eAAO,MAAM,iDAAiD,EAQxD,iDAAiD,EAAE,CAAC;AAoC1D;;GAEG;AACH,wBAAgB,8BAA8B,CAC7C,mBAAmB,EAAE,4BAA4B,GAC/C,gCAAgC,CAKlC;AAED;;;;KAIK;AACL,wBAAgB,sBAAsB,CACrC,mBAAmB,EAAE,4BAA4B,EACjD,cAAc,EAAE,OAAO,CAAC,+BAA+B,CAAC,GACtD,IAAI,CAMN"}
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.runtimeOptionKeysThatRequireExplicitSchemaControl = void 0;
|
|
8
|
+
exports.getMinVersionForCollabDefaults = getMinVersionForCollabDefaults;
|
|
9
|
+
exports.validateRuntimeOptions = validateRuntimeOptions;
|
|
8
10
|
const internal_1 = require("@fluidframework/runtime-definitions/internal");
|
|
9
11
|
const internal_2 = require("@fluidframework/runtime-utils/internal");
|
|
10
12
|
const compressionDefinitions_js_1 = require("./compressionDefinitions.js");
|
|
@@ -32,26 +34,27 @@ const keysOfOptionsPredatingExplicitSchemaControl = new Set([
|
|
|
32
34
|
* the format changes introduced by the property, then the default value for that OldestSupportedClientVersion will enable the feature associated with the property.
|
|
33
35
|
* Otherwise, the feature will be disabled.
|
|
34
36
|
*
|
|
35
|
-
* For example
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* with the batching feature.
|
|
37
|
+
* For example, the default value for `enableGroupedBatching` is true at the supported
|
|
38
|
+
* floor of 2.0.0 because clients running 2.0.0 or later understand the associated
|
|
39
|
+
* document format.
|
|
39
40
|
*/
|
|
40
41
|
const runtimeOptionsAffectingDocSchemaConfigMap = {
|
|
41
42
|
enableGroupedBatching: {
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
// Grouped batching was already enabled by default before callers explicitly selected
|
|
44
|
+
// a compatibility version. All supported 2.x clients understand this format.
|
|
45
|
+
"2.0.0": true,
|
|
44
46
|
},
|
|
45
47
|
compressionOptions: {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
// Compression was already enabled by default before callers explicitly selected a
|
|
49
|
+
// compatibility version. All supported 2.x clients understand this format.
|
|
50
|
+
"2.0.0": compressionDefinitions_js_1.enabledCompressionConfig,
|
|
48
51
|
},
|
|
49
52
|
enableRuntimeIdCompressor: {
|
|
50
53
|
// For IdCompressorMode, `undefined` represents a logical state (off).
|
|
51
54
|
// However, to satisfy the Required<> constraint while
|
|
52
55
|
// `exactOptionalPropertyTypes` is `false` (TODO: AB#8215), we need
|
|
53
56
|
// to have it defined, so we trick the type checker here.
|
|
54
|
-
"
|
|
57
|
+
"2.0.0": undefined,
|
|
55
58
|
// We do not yet want to enable idCompressor by default since it will
|
|
56
59
|
// increase bundle sizes, and not all customers will benefit from it.
|
|
57
60
|
// Therefore, we will require customers to explicitly enable it. We
|
|
@@ -59,28 +62,18 @@ const runtimeOptionsAffectingDocSchemaConfigMap = {
|
|
|
59
62
|
// change in the future.
|
|
60
63
|
},
|
|
61
64
|
explicitSchemaControl: {
|
|
62
|
-
"1.0.0": false,
|
|
63
65
|
// This option's intention is to prevent 1.x clients from joining sessions
|
|
64
|
-
// when enabled.
|
|
65
|
-
//
|
|
66
|
-
// because it was not enabled by default prior to the implementation of
|
|
67
|
-
// `minVersionForCollab`.
|
|
68
|
-
// `defaultMinVersionForCollab` is set to "2.0.0-defaults" which "2.0.0"
|
|
69
|
-
// does not satisfy to avoiding enabling this option by default as of
|
|
70
|
-
// `minVersionForCollab` introduction, which could be unexpected.
|
|
71
|
-
// Only enable as a default when `minVersionForCollab` is specified at
|
|
72
|
-
// 2.0.0+.
|
|
66
|
+
// when enabled. Before Client 3.0, this became true only when callers explicitly
|
|
67
|
+
// selected 2.0.0 or later. Client 3.0 also uses 2.0.0 when the setting is omitted.
|
|
73
68
|
"2.0.0": true,
|
|
74
69
|
},
|
|
75
70
|
flushMode: {
|
|
76
|
-
//
|
|
77
|
-
//
|
|
78
|
-
|
|
79
|
-
"1.0.0": internal_1.FlushMode.Immediate,
|
|
80
|
-
"2.0.0-defaults": internal_1.FlushMode.TurnBased,
|
|
71
|
+
// TurnBased flushing was already the default before callers explicitly selected a
|
|
72
|
+
// compatibility version.
|
|
73
|
+
"2.0.0": internal_1.FlushMode.TurnBased,
|
|
81
74
|
},
|
|
82
75
|
gcOptions: {
|
|
83
|
-
"
|
|
76
|
+
"2.0.0": {},
|
|
84
77
|
// Although sweep is supported in 2.x, it is disabled by default until minVersionForCollab>=3.0.0 to be extra safe.
|
|
85
78
|
// Note that enabling this is a significant change, that should likely be announced in the relevant version:
|
|
86
79
|
// It would be bad if this simple caused the enablement when when the current package version passed this point without anyone being aware.
|
|
@@ -93,7 +86,7 @@ const runtimeOptionsAffectingDocSchemaConfigMap = {
|
|
|
93
86
|
// This feature is new and disabled by default. In the future we will enable it by default, but we have not
|
|
94
87
|
// closed on the version where that will happen yet. Probably a .10 release since blob functionality is not
|
|
95
88
|
// exposed on the `@public` API surface.
|
|
96
|
-
"
|
|
89
|
+
"2.0.0": undefined,
|
|
97
90
|
},
|
|
98
91
|
};
|
|
99
92
|
/**
|
|
@@ -105,32 +98,32 @@ exports.runtimeOptionKeysThatRequireExplicitSchemaControl = Object.keys(runtimeO
|
|
|
105
98
|
// A lot of the information in this seems redundant with whats defined above. Might be nice to combine them somehow.
|
|
106
99
|
const runtimeOptionsAffectingDocSchemaConfigValidationMap = {
|
|
107
100
|
enableGroupedBatching: (0, internal_2.configValueToMinVersionForCollab)([
|
|
108
|
-
[false, "
|
|
109
|
-
[true, "2.0.0
|
|
101
|
+
[false, "2.0.0"],
|
|
102
|
+
[true, "2.0.0"],
|
|
110
103
|
]),
|
|
111
104
|
compressionOptions: (0, internal_2.configValueToMinVersionForCollab)([
|
|
112
|
-
[{ ...compressionDefinitions_js_1.disabledCompressionConfig }, "
|
|
113
|
-
[{ ...compressionDefinitions_js_1.enabledCompressionConfig }, "2.0.0
|
|
105
|
+
[{ ...compressionDefinitions_js_1.disabledCompressionConfig }, "2.0.0"],
|
|
106
|
+
[{ ...compressionDefinitions_js_1.enabledCompressionConfig }, "2.0.0"],
|
|
114
107
|
]),
|
|
115
108
|
enableRuntimeIdCompressor: (0, internal_2.configValueToMinVersionForCollab)([
|
|
116
|
-
[undefined, "
|
|
117
|
-
["on", "2.0.0
|
|
118
|
-
["delayed", "2.0.0
|
|
109
|
+
[undefined, "2.0.0"],
|
|
110
|
+
["on", "2.0.0"],
|
|
111
|
+
["delayed", "2.0.0"],
|
|
119
112
|
]),
|
|
120
113
|
explicitSchemaControl: (0, internal_2.configValueToMinVersionForCollab)([
|
|
121
|
-
[false, "
|
|
122
|
-
[true, "2.0.0
|
|
114
|
+
[false, "2.0.0"],
|
|
115
|
+
[true, "2.0.0"],
|
|
123
116
|
]),
|
|
124
117
|
flushMode: (0, internal_2.configValueToMinVersionForCollab)([
|
|
125
|
-
[internal_1.FlushMode.Immediate, "
|
|
126
|
-
[internal_1.FlushMode.TurnBased, "2.0.0
|
|
118
|
+
[internal_1.FlushMode.Immediate, "2.0.0"],
|
|
119
|
+
[internal_1.FlushMode.TurnBased, "2.0.0"],
|
|
127
120
|
]),
|
|
128
121
|
gcOptions: (0, internal_2.configValueToMinVersionForCollab)([
|
|
129
|
-
[{ enableGCSweep: undefined }, "
|
|
130
|
-
[{ enableGCSweep: true }, "2.0.0
|
|
122
|
+
[{ enableGCSweep: undefined }, "2.0.0"],
|
|
123
|
+
[{ enableGCSweep: true }, "2.0.0"],
|
|
131
124
|
]),
|
|
132
125
|
createBlobPayloadPending: (0, internal_2.configValueToMinVersionForCollab)([
|
|
133
|
-
[undefined, "
|
|
126
|
+
[undefined, "2.0.0"],
|
|
134
127
|
[true, "2.40.0"],
|
|
135
128
|
]),
|
|
136
129
|
};
|
|
@@ -140,14 +133,12 @@ const runtimeOptionsAffectingDocSchemaConfigValidationMap = {
|
|
|
140
133
|
function getMinVersionForCollabDefaults(minVersionForCollab) {
|
|
141
134
|
return (0, internal_2.getConfigsForMinVersionForCollab)(minVersionForCollab, runtimeOptionsAffectingDocSchemaConfigMap);
|
|
142
135
|
}
|
|
143
|
-
exports.getMinVersionForCollabDefaults = getMinVersionForCollabDefaults;
|
|
144
136
|
/**
|
|
145
137
|
* Validates if the runtime options passed in from the user are compatible with the minVersionForCollab.
|
|
146
|
-
* For example, if a user
|
|
147
|
-
* is set to "
|
|
138
|
+
* For example, if a user enables an option introduced in 2.40.0 while the
|
|
139
|
+
* minVersionForCollab is set to "2.0.0", then we should throw a UsageError.
|
|
148
140
|
* */
|
|
149
141
|
function validateRuntimeOptions(minVersionForCollab, runtimeOptions) {
|
|
150
142
|
(0, internal_2.validateConfigMapOverrides)(minVersionForCollab, runtimeOptions, runtimeOptionsAffectingDocSchemaConfigValidationMap);
|
|
151
143
|
}
|
|
152
|
-
exports.validateRuntimeOptions = validateRuntimeOptions;
|
|
153
144
|
//# sourceMappingURL=containerCompatibility.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerCompatibility.js","sourceRoot":"","sources":["../src/containerCompatibility.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2EAGsD;AACtD,qEAMgD;AAEhD,2EAGqC;AA+CrC;;;;;;;GAOG;AACH,MAAM,2CAA2C,GAAG,IAAI,GAAG,CAAC;IAC3D,uBAAuB;IACvB,oBAAoB;IACpB,2BAA2B;IAC3B,WAAW;IACX,WAAW;IACX,uBAAuB;CACvB,CAAgE,CAAC;AAUlE;;;;;;;;;;;;GAYG;AACH,MAAM,yCAAyC,GAC9C;IACC,qBAAqB,EAAE;QACtB,OAAO,EAAE,KAAK;QACd,gBAAgB,EAAE,IAAI;KACtB;IACD,kBAAkB,EAAE;QACnB,OAAO,EAAE,qDAAyB;QAClC,gBAAgB,EAAE,oDAAwB;KAC1C;IACD,yBAAyB,EAAE;QAC1B,sEAAsE;QACtE,sDAAsD;QACtD,mEAAmE;QACnE,yDAAyD;QACzD,OAAO,EAAE,SAAS;QAClB,qEAAqE;QACrE,qEAAqE;QACrE,mEAAmE;QACnE,qEAAqE;QACrE,wBAAwB;KACxB;IACD,qBAAqB,EAAE;QACtB,OAAO,EAAE,KAAK;QACd,0EAA0E;QAC1E,wEAAwE;QACxE,qEAAqE;QACrE,uEAAuE;QACvE,yBAAyB;QACzB,wEAAwE;QACxE,qEAAqE;QACrE,iEAAiE;QACjE,sEAAsE;QACtE,UAAU;QACV,OAAO,EAAE,IAAI;KACb;IACD,SAAS,EAAE;QACV,gHAAgH;QAChH,8GAA8G;QAC9G,6CAA6C;QAC7C,OAAO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AAS,EAAE,OAAO,CAAC;QAC9B,CAAC,oBAAS,CAAC,SAAS,EAAE,gBAAgB,CAAC;KACvC,CAAC;IACF,SAAS,EAAE,IAAA,2CAAgC,EAAC;QAC3C,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,OAAO,CAAC;QACvC,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,EAAE,gBAAgB,CAAC;KAC3C,CAAC;IACF,wBAAwB,EAAE,IAAA,2CAAgC,EAAC;QAC1D,CAAC,SAAS,EAAE,OAAO,CAAC;QACpB,CAAC,IAAI,EAAE,QAAQ,CAAC;KAChB,CAAC;CACF,CAAC;AAEH;;GAEG;AACH,SAAgB,8BAA8B,CAC7C,mBAAiD;IAEjD,OAAO,IAAA,2CAAgC,EACtC,mBAAmB,EACnB,yCAAyC,CACzC,CAAC;AACH,CAAC;AAPD,wEAOC;AAED;;;;KAIK;AACL,SAAgB,sBAAsB,CACrC,mBAAiD,EACjD,cAAwD;IAExD,IAAA,qCAA0B,EACzB,mBAAmB,EACnB,cAAc,EACd,mDAAmD,CACnD,CAAC;AACH,CAAC;AATD,wDASC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tFlushMode,\n\ttype OldestSupportedClientVersion,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tconfigValueToMinVersionForCollab,\n\tgetConfigsForMinVersionForCollab,\n\tvalidateConfigMapOverrides,\n\ttype ConfigMap,\n\ttype ConfigValidationMap,\n} from \"@fluidframework/runtime-utils/internal\";\n\nimport {\n\tdisabledCompressionConfig,\n\tenabledCompressionConfig,\n} from \"./compressionDefinitions.js\";\nimport type { ContainerRuntimeOptionsInternal } from \"./containerRuntime.js\";\n\n/**\n * Subset of the {@link ContainerRuntimeOptionsInternal} properties which\n * affect {@link IDocumentSchemaFeatures}.\n *\n * @remarks\n * When a new option is added to {@link ContainerRuntimeOptionsInternal}, we\n * must consider if it changes the DocumentSchema. If so, then a corresponding\n * entry must be added to {@link runtimeOptionsAffectingDocSchemaConfigMap}\n * below. If not, then it must be omitted from this type.\n *\n * Note: `Omit` is used instead of `Pick` to ensure that all new options are\n * included in this type by default. If any new properties are added to\n * {@link ContainerRuntimeOptionsInternal}, they will be included in this\n * type unless explicitly omitted. This will prevent us from forgetting to\n * account for any new properties in the future.\n */\nexport type RuntimeOptionsAffectingDocSchema = Omit<\n\tContainerRuntimeOptionsInternal,\n\t| \"chunkSizeInBytes\"\n\t| \"maxBatchSizeInBytes\"\n\t| \"loadSequenceNumberVerification\"\n\t| \"summaryOptions\"\n\t| \"stagingModeAutoFlushThreshold\"\n\t| \"disableSchemaUpgrade\"\n>;\n\n/**\n * Subset of {@link RuntimeOptionsAffectingDocSchema} which existed prior to the introduction of explicitSchemaControl.\n *\n * @remarks\n * Runtime options that affect document schema should generally require explicitSchemaControl to be enabled.\n * However, to prevent disruption to existing customers, options that existed prior to explicitSchemaControl\n * do not explicity require explicitSchemaControl to be enabled. Do not add new options to this list.\n */\ntype RuntimeOptionKeysPredatingExplicitSchemaControl = keyof Pick<\n\tRuntimeOptionsAffectingDocSchema,\n\t| \"explicitSchemaControl\"\n\t| \"compressionOptions\"\n\t| \"enableRuntimeIdCompressor\"\n\t| \"flushMode\"\n\t| \"gcOptions\"\n\t| \"enableGroupedBatching\"\n>;\n\n/**\n * List of keys of {@link RuntimeOptionsAffectingDocSchema} which existed prior to the introduction of explicitSchemaControl.\n *\n * @remarks\n * Runtime options that affect document schema should generally require explicitSchemaControl to be enabled.\n * However, to prevent disruption to existing customers, options that existed prior to explicitSchemaControl\n * do not explicity require explicitSchemaControl to be enabled. Do not add new keys to this list.\n */\nconst keysOfOptionsPredatingExplicitSchemaControl = new Set([\n\t\"explicitSchemaControl\",\n\t\"compressionOptions\",\n\t\"enableRuntimeIdCompressor\",\n\t\"flushMode\",\n\t\"gcOptions\",\n\t\"enableGroupedBatching\",\n]) satisfies Set<RuntimeOptionKeysPredatingExplicitSchemaControl>;\n\n/**\n * Subset of {@link RuntimeOptionsAffectingDocSchema} which require explicitSchemaControl to be enabled.\n */\nexport type RuntimeOptionKeysThatRequireExplicitSchemaControl = keyof Omit<\n\tRuntimeOptionsAffectingDocSchema,\n\tRuntimeOptionKeysPredatingExplicitSchemaControl\n>;\n\n/**\n * Mapping of RuntimeOptionsAffectingDocSchema to their compatibility related configs.\n *\n * Each key in this map corresponds to a property in RuntimeOptionsAffectingDocSchema. The value is an object that maps OldestSupportedClientVersion\n * to the appropriate default value for that property to supporting that OldestSupportedClientVersion. If clients running OldestSupportedClientVersion X are able to understand\n * the format changes introduced by the property, then the default value for that OldestSupportedClientVersion will enable the feature associated with the property.\n * Otherwise, the feature will be disabled.\n *\n * For example if the minVersionForCollab is a 1.x version (i.e. \"1.5.0\"), then the default value for `enableGroupedBatching` will be false since 1.x\n * clients do not understand the document format when batching is enabled. If the minVersionForCollab is a 2.x client (i.e. \"2.0.0\" or later), then the\n * default value for `enableGroupedBatching` will be true because clients running 2.0 or later will be able to understand the format changes associated\n * with the batching feature.\n */\nconst runtimeOptionsAffectingDocSchemaConfigMap: ConfigMap<RuntimeOptionsAffectingDocSchema> =\n\t{\n\t\tenableGroupedBatching: {\n\t\t\t\"1.0.0\": false,\n\t\t\t\"2.0.0-defaults\": true,\n\t\t},\n\t\tcompressionOptions: {\n\t\t\t\"1.0.0\": disabledCompressionConfig,\n\t\t\t\"2.0.0-defaults\": enabledCompressionConfig,\n\t\t},\n\t\tenableRuntimeIdCompressor: {\n\t\t\t// For IdCompressorMode, `undefined` represents a logical state (off).\n\t\t\t// However, to satisfy the Required<> constraint while\n\t\t\t// `exactOptionalPropertyTypes` is `false` (TODO: AB#8215), we need\n\t\t\t// to have it defined, so we trick the type checker here.\n\t\t\t\"1.0.0\": undefined,\n\t\t\t// We do not yet want to enable idCompressor by default since it will\n\t\t\t// increase bundle sizes, and not all customers will benefit from it.\n\t\t\t// Therefore, we will require customers to explicitly enable it. We\n\t\t\t// are keeping it as a DocSchema affecting option for now as this may\n\t\t\t// change in the future.\n\t\t},\n\t\texplicitSchemaControl: {\n\t\t\t\"1.0.0\": false,\n\t\t\t// This option's intention is to prevent 1.x clients from joining sessions\n\t\t\t// when enabled. This is set to true when the minVersionForCollab is set\n\t\t\t// to >=2.0.0 (explicitly). This is different than other 2.0 defaults\n\t\t\t// because it was not enabled by default prior to the implementation of\n\t\t\t// `minVersionForCollab`.\n\t\t\t// `defaultMinVersionForCollab` is set to \"2.0.0-defaults\" which \"2.0.0\"\n\t\t\t// does not satisfy to avoiding enabling this option by default as of\n\t\t\t// `minVersionForCollab` introduction, which could be unexpected.\n\t\t\t// Only enable as a default when `minVersionForCollab` is specified at\n\t\t\t// 2.0.0+.\n\t\t\t\"2.0.0\": true,\n\t\t},\n\t\tflushMode: {\n\t\t\t// Note: 1.x clients are compatible with TurnBased flushing, but here we elect to remain on Immediate flush mode\n\t\t\t// as a work-around for inability to send batches larger than 1Mb. Immediate flushing keeps batches smaller as\n\t\t\t// fewer messages will be included per flush.\n\t\t\t\"1.0.0\": FlushMode.Immediate,\n\t\t\t\"2.0.0-defaults\": FlushMode.TurnBased,\n\t\t},\n\t\tgcOptions: {\n\t\t\t\"1.0.0\": {},\n\t\t\t// Although sweep is supported in 2.x, it is disabled by default until minVersionForCollab>=3.0.0 to be extra safe.\n\t\t\t// Note that enabling this is a significant change, that should likely be announced in the relevant version:\n\t\t\t// It would be bad if this simple caused the enablement when when the current package version passed this point without anyone being aware.\n\t\t\t// This is configuration targeting a future versions, which is not supported.\n\t\t\t// TODO: when preparing 3.0 (or at some later point), consider enabling this by default for clients 3.0 or newer\n\t\t\t// (and add user facing documentation indicating this is enabled by that version).\n\t\t\t// \"3.0.0\": { enableGCSweep: true },\n\t\t},\n\t\tcreateBlobPayloadPending: {\n\t\t\t// This feature is new and disabled by default. In the future we will enable it by default, but we have not\n\t\t\t// closed on the version where that will happen yet. Probably a .10 release since blob functionality is not\n\t\t\t// exposed on the `@public` API surface.\n\t\t\t\"1.0.0\": undefined,\n\t\t},\n\t};\n\n/**\n * Keys of {@link ContainerRuntimeOptionsInternal} that require explicitSchemaControl to be enabled.\n */\nexport const runtimeOptionKeysThatRequireExplicitSchemaControl = (\n\tObject.keys(\n\t\truntimeOptionsAffectingDocSchemaConfigMap,\n\t) as (keyof RuntimeOptionsAffectingDocSchema)[]\n).filter((key) => {\n\treturn !keysOfOptionsPredatingExplicitSchemaControl.has(\n\t\tkey as RuntimeOptionKeysPredatingExplicitSchemaControl,\n\t);\n}) as RuntimeOptionKeysThatRequireExplicitSchemaControl[];\n\n// A lot of the information in this seems redundant with whats defined above. Might be nice to combine them somehow.\nconst runtimeOptionsAffectingDocSchemaConfigValidationMap: ConfigValidationMap<RuntimeOptionsAffectingDocSchema> =\n\t{\n\t\tenableGroupedBatching: configValueToMinVersionForCollab([\n\t\t\t[false, \"1.0.0\"],\n\t\t\t[true, \"2.0.0-defaults\"],\n\t\t]),\n\t\tcompressionOptions: configValueToMinVersionForCollab([\n\t\t\t[{ ...disabledCompressionConfig }, \"1.0.0\"],\n\t\t\t[{ ...enabledCompressionConfig }, \"2.0.0-defaults\"],\n\t\t]),\n\t\tenableRuntimeIdCompressor: configValueToMinVersionForCollab([\n\t\t\t[undefined, \"1.0.0\"],\n\t\t\t[\"on\", \"2.0.0-defaults\"],\n\t\t\t[\"delayed\", \"2.0.0-defaults\"],\n\t\t]),\n\t\texplicitSchemaControl: configValueToMinVersionForCollab([\n\t\t\t[false, \"1.0.0\"],\n\t\t\t[true, \"2.0.0-defaults\"],\n\t\t]),\n\t\tflushMode: configValueToMinVersionForCollab([\n\t\t\t[FlushMode.Immediate, \"1.0.0\"],\n\t\t\t[FlushMode.TurnBased, \"2.0.0-defaults\"],\n\t\t]),\n\t\tgcOptions: configValueToMinVersionForCollab([\n\t\t\t[{ enableGCSweep: undefined }, \"1.0.0\"],\n\t\t\t[{ enableGCSweep: true }, \"2.0.0-defaults\"],\n\t\t]),\n\t\tcreateBlobPayloadPending: configValueToMinVersionForCollab([\n\t\t\t[undefined, \"1.0.0\"],\n\t\t\t[true, \"2.40.0\"],\n\t\t]),\n\t};\n\n/**\n * Returns the default RuntimeOptionsAffectingDocSchema configuration for a given minVersionForCollab.\n */\nexport function getMinVersionForCollabDefaults(\n\tminVersionForCollab: OldestSupportedClientVersion,\n): RuntimeOptionsAffectingDocSchema {\n\treturn getConfigsForMinVersionForCollab(\n\t\tminVersionForCollab,\n\t\truntimeOptionsAffectingDocSchemaConfigMap,\n\t);\n}\n\n/**\n * Validates if the runtime options passed in from the user are compatible with the minVersionForCollab.\n * For example, if a user sets the `enableGroupedBatching` option to true, but the minVersionForCollab\n * is set to \"1.0.0\", then we should throw a UsageError since 1.x clients do not support batching.\n * */\nexport function validateRuntimeOptions(\n\tminVersionForCollab: OldestSupportedClientVersion,\n\truntimeOptions: Partial<ContainerRuntimeOptionsInternal>,\n): void {\n\tvalidateConfigMapOverrides<RuntimeOptionsAffectingDocSchema>(\n\t\tminVersionForCollab,\n\t\truntimeOptions,\n\t\truntimeOptionsAffectingDocSchemaConfigValidationMap,\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"containerCompatibility.js","sourceRoot":"","sources":["../src/containerCompatibility.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA4MH,wEAOC;AAOD,wDASC;AAjOD,2EAGsD;AACtD,qEAMgD;AAEhD,2EAGqC;AA+CrC;;;;;;;GAOG;AACH,MAAM,2CAA2C,GAAG,IAAI,GAAG,CAAC;IAC3D,uBAAuB;IACvB,oBAAoB;IACpB,2BAA2B;IAC3B,WAAW;IACX,WAAW;IACX,uBAAuB;CACvB,CAAgE,CAAC;AAUlE;;;;;;;;;;;GAWG;AACH,MAAM,yCAAyC,GAC9C;IACC,qBAAqB,EAAE;QACtB,qFAAqF;QACrF,6EAA6E;QAC7E,OAAO,EAAE,IAAI;KACb;IACD,kBAAkB,EAAE;QACnB,kFAAkF;QAClF,2EAA2E;QAC3E,OAAO,EAAE,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AAE,OAAO,CAAC;QACpB,CAAC,IAAI,EAAE,OAAO,CAAC;QACf,CAAC,SAAS,EAAE,OAAO,CAAC;KACpB,CAAC;IACF,qBAAqB,EAAE,IAAA,2CAAgC,EAAC;QACvD,CAAC,KAAK,EAAE,OAAO,CAAC;QAChB,CAAC,IAAI,EAAE,OAAO,CAAC;KACf,CAAC;IACF,SAAS,EAAE,IAAA,2CAAgC,EAAC;QAC3C,CAAC,oBAAS,CAAC,SAAS,EAAE,OAAO,CAAC;QAC9B,CAAC,oBAAS,CAAC,SAAS,EAAE,OAAO,CAAC;KAC9B,CAAC;IACF,SAAS,EAAE,IAAA,2CAAgC,EAAC;QAC3C,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,OAAO,CAAC;QACvC,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC;KAClC,CAAC;IACF,wBAAwB,EAAE,IAAA,2CAAgC,EAAC;QAC1D,CAAC,SAAS,EAAE,OAAO,CAAC;QACpB,CAAC,IAAI,EAAE,QAAQ,CAAC;KAChB,CAAC;CACF,CAAC;AAEH;;GAEG;AACH,SAAgB,8BAA8B,CAC7C,mBAAiD;IAEjD,OAAO,IAAA,2CAAgC,EACtC,mBAAmB,EACnB,yCAAyC,CACzC,CAAC;AACH,CAAC;AAED;;;;KAIK;AACL,SAAgB,sBAAsB,CACrC,mBAAiD,EACjD,cAAwD;IAExD,IAAA,qCAA0B,EACzB,mBAAmB,EACnB,cAAc,EACd,mDAAmD,CACnD,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tFlushMode,\n\ttype OldestSupportedClientVersion,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tconfigValueToMinVersionForCollab,\n\tgetConfigsForMinVersionForCollab,\n\tvalidateConfigMapOverrides,\n\ttype ConfigMap,\n\ttype ConfigValidationMap,\n} from \"@fluidframework/runtime-utils/internal\";\n\nimport {\n\tdisabledCompressionConfig,\n\tenabledCompressionConfig,\n} from \"./compressionDefinitions.js\";\nimport type { ContainerRuntimeOptionsInternal } from \"./containerRuntime.js\";\n\n/**\n * Subset of the {@link ContainerRuntimeOptionsInternal} properties which\n * affect {@link IDocumentSchemaFeatures}.\n *\n * @remarks\n * When a new option is added to {@link ContainerRuntimeOptionsInternal}, we\n * must consider if it changes the DocumentSchema. If so, then a corresponding\n * entry must be added to {@link runtimeOptionsAffectingDocSchemaConfigMap}\n * below. If not, then it must be omitted from this type.\n *\n * Note: `Omit` is used instead of `Pick` to ensure that all new options are\n * included in this type by default. If any new properties are added to\n * {@link ContainerRuntimeOptionsInternal}, they will be included in this\n * type unless explicitly omitted. This will prevent us from forgetting to\n * account for any new properties in the future.\n */\nexport type RuntimeOptionsAffectingDocSchema = Omit<\n\tContainerRuntimeOptionsInternal,\n\t| \"chunkSizeInBytes\"\n\t| \"maxBatchSizeInBytes\"\n\t| \"loadSequenceNumberVerification\"\n\t| \"summaryOptions\"\n\t| \"stagingModeAutoFlushThreshold\"\n\t| \"disableSchemaUpgrade\"\n>;\n\n/**\n * Subset of {@link RuntimeOptionsAffectingDocSchema} which existed prior to the introduction of explicitSchemaControl.\n *\n * @remarks\n * Runtime options that affect document schema should generally require explicitSchemaControl to be enabled.\n * However, to prevent disruption to existing customers, options that existed prior to explicitSchemaControl\n * do not explicity require explicitSchemaControl to be enabled. Do not add new options to this list.\n */\ntype RuntimeOptionKeysPredatingExplicitSchemaControl = keyof Pick<\n\tRuntimeOptionsAffectingDocSchema,\n\t| \"explicitSchemaControl\"\n\t| \"compressionOptions\"\n\t| \"enableRuntimeIdCompressor\"\n\t| \"flushMode\"\n\t| \"gcOptions\"\n\t| \"enableGroupedBatching\"\n>;\n\n/**\n * List of keys of {@link RuntimeOptionsAffectingDocSchema} which existed prior to the introduction of explicitSchemaControl.\n *\n * @remarks\n * Runtime options that affect document schema should generally require explicitSchemaControl to be enabled.\n * However, to prevent disruption to existing customers, options that existed prior to explicitSchemaControl\n * do not explicity require explicitSchemaControl to be enabled. Do not add new keys to this list.\n */\nconst keysOfOptionsPredatingExplicitSchemaControl = new Set([\n\t\"explicitSchemaControl\",\n\t\"compressionOptions\",\n\t\"enableRuntimeIdCompressor\",\n\t\"flushMode\",\n\t\"gcOptions\",\n\t\"enableGroupedBatching\",\n]) satisfies Set<RuntimeOptionKeysPredatingExplicitSchemaControl>;\n\n/**\n * Subset of {@link RuntimeOptionsAffectingDocSchema} which require explicitSchemaControl to be enabled.\n */\nexport type RuntimeOptionKeysThatRequireExplicitSchemaControl = keyof Omit<\n\tRuntimeOptionsAffectingDocSchema,\n\tRuntimeOptionKeysPredatingExplicitSchemaControl\n>;\n\n/**\n * Mapping of RuntimeOptionsAffectingDocSchema to their compatibility related configs.\n *\n * Each key in this map corresponds to a property in RuntimeOptionsAffectingDocSchema. The value is an object that maps OldestSupportedClientVersion\n * to the appropriate default value for that property to supporting that OldestSupportedClientVersion. If clients running OldestSupportedClientVersion X are able to understand\n * the format changes introduced by the property, then the default value for that OldestSupportedClientVersion will enable the feature associated with the property.\n * Otherwise, the feature will be disabled.\n *\n * For example, the default value for `enableGroupedBatching` is true at the supported\n * floor of 2.0.0 because clients running 2.0.0 or later understand the associated\n * document format.\n */\nconst runtimeOptionsAffectingDocSchemaConfigMap: ConfigMap<RuntimeOptionsAffectingDocSchema> =\n\t{\n\t\tenableGroupedBatching: {\n\t\t\t// Grouped batching was already enabled by default before callers explicitly selected\n\t\t\t// a compatibility version. All supported 2.x clients understand this format.\n\t\t\t\"2.0.0\": true,\n\t\t},\n\t\tcompressionOptions: {\n\t\t\t// Compression was already enabled by default before callers explicitly selected a\n\t\t\t// compatibility version. All supported 2.x clients understand this format.\n\t\t\t\"2.0.0\": enabledCompressionConfig,\n\t\t},\n\t\tenableRuntimeIdCompressor: {\n\t\t\t// For IdCompressorMode, `undefined` represents a logical state (off).\n\t\t\t// However, to satisfy the Required<> constraint while\n\t\t\t// `exactOptionalPropertyTypes` is `false` (TODO: AB#8215), we need\n\t\t\t// to have it defined, so we trick the type checker here.\n\t\t\t\"2.0.0\": undefined,\n\t\t\t// We do not yet want to enable idCompressor by default since it will\n\t\t\t// increase bundle sizes, and not all customers will benefit from it.\n\t\t\t// Therefore, we will require customers to explicitly enable it. We\n\t\t\t// are keeping it as a DocSchema affecting option for now as this may\n\t\t\t// change in the future.\n\t\t},\n\t\texplicitSchemaControl: {\n\t\t\t// This option's intention is to prevent 1.x clients from joining sessions\n\t\t\t// when enabled. Before Client 3.0, this became true only when callers explicitly\n\t\t\t// selected 2.0.0 or later. Client 3.0 also uses 2.0.0 when the setting is omitted.\n\t\t\t\"2.0.0\": true,\n\t\t},\n\t\tflushMode: {\n\t\t\t// TurnBased flushing was already the default before callers explicitly selected a\n\t\t\t// compatibility version.\n\t\t\t\"2.0.0\": FlushMode.TurnBased,\n\t\t},\n\t\tgcOptions: {\n\t\t\t\"2.0.0\": {},\n\t\t\t// Although sweep is supported in 2.x, it is disabled by default until minVersionForCollab>=3.0.0 to be extra safe.\n\t\t\t// Note that enabling this is a significant change, that should likely be announced in the relevant version:\n\t\t\t// It would be bad if this simple caused the enablement when when the current package version passed this point without anyone being aware.\n\t\t\t// This is configuration targeting a future versions, which is not supported.\n\t\t\t// TODO: when preparing 3.0 (or at some later point), consider enabling this by default for clients 3.0 or newer\n\t\t\t// (and add user facing documentation indicating this is enabled by that version).\n\t\t\t// \"3.0.0\": { enableGCSweep: true },\n\t\t},\n\t\tcreateBlobPayloadPending: {\n\t\t\t// This feature is new and disabled by default. In the future we will enable it by default, but we have not\n\t\t\t// closed on the version where that will happen yet. Probably a .10 release since blob functionality is not\n\t\t\t// exposed on the `@public` API surface.\n\t\t\t\"2.0.0\": undefined,\n\t\t},\n\t};\n\n/**\n * Keys of {@link ContainerRuntimeOptionsInternal} that require explicitSchemaControl to be enabled.\n */\nexport const runtimeOptionKeysThatRequireExplicitSchemaControl = (\n\tObject.keys(\n\t\truntimeOptionsAffectingDocSchemaConfigMap,\n\t) as (keyof RuntimeOptionsAffectingDocSchema)[]\n).filter((key) => {\n\treturn !keysOfOptionsPredatingExplicitSchemaControl.has(\n\t\tkey as RuntimeOptionKeysPredatingExplicitSchemaControl,\n\t);\n}) as RuntimeOptionKeysThatRequireExplicitSchemaControl[];\n\n// A lot of the information in this seems redundant with whats defined above. Might be nice to combine them somehow.\nconst runtimeOptionsAffectingDocSchemaConfigValidationMap: ConfigValidationMap<RuntimeOptionsAffectingDocSchema> =\n\t{\n\t\tenableGroupedBatching: configValueToMinVersionForCollab([\n\t\t\t[false, \"2.0.0\"],\n\t\t\t[true, \"2.0.0\"],\n\t\t]),\n\t\tcompressionOptions: configValueToMinVersionForCollab([\n\t\t\t[{ ...disabledCompressionConfig }, \"2.0.0\"],\n\t\t\t[{ ...enabledCompressionConfig }, \"2.0.0\"],\n\t\t]),\n\t\tenableRuntimeIdCompressor: configValueToMinVersionForCollab([\n\t\t\t[undefined, \"2.0.0\"],\n\t\t\t[\"on\", \"2.0.0\"],\n\t\t\t[\"delayed\", \"2.0.0\"],\n\t\t]),\n\t\texplicitSchemaControl: configValueToMinVersionForCollab([\n\t\t\t[false, \"2.0.0\"],\n\t\t\t[true, \"2.0.0\"],\n\t\t]),\n\t\tflushMode: configValueToMinVersionForCollab([\n\t\t\t[FlushMode.Immediate, \"2.0.0\"],\n\t\t\t[FlushMode.TurnBased, \"2.0.0\"],\n\t\t]),\n\t\tgcOptions: configValueToMinVersionForCollab([\n\t\t\t[{ enableGCSweep: undefined }, \"2.0.0\"],\n\t\t\t[{ enableGCSweep: true }, \"2.0.0\"],\n\t\t]),\n\t\tcreateBlobPayloadPending: configValueToMinVersionForCollab([\n\t\t\t[undefined, \"2.0.0\"],\n\t\t\t[true, \"2.40.0\"],\n\t\t]),\n\t};\n\n/**\n * Returns the default RuntimeOptionsAffectingDocSchema configuration for a given minVersionForCollab.\n */\nexport function getMinVersionForCollabDefaults(\n\tminVersionForCollab: OldestSupportedClientVersion,\n): RuntimeOptionsAffectingDocSchema {\n\treturn getConfigsForMinVersionForCollab(\n\t\tminVersionForCollab,\n\t\truntimeOptionsAffectingDocSchemaConfigMap,\n\t);\n}\n\n/**\n * Validates if the runtime options passed in from the user are compatible with the minVersionForCollab.\n * For example, if a user enables an option introduced in 2.40.0 while the\n * minVersionForCollab is set to \"2.0.0\", then we should throw a UsageError.\n * */\nexport function validateRuntimeOptions(\n\tminVersionForCollab: OldestSupportedClientVersion,\n\truntimeOptions: Partial<ContainerRuntimeOptionsInternal>,\n): void {\n\tvalidateConfigMapOverrides<RuntimeOptionsAffectingDocSchema>(\n\t\tminVersionForCollab,\n\t\truntimeOptions,\n\t\truntimeOptionsAffectingDocSchemaConfigValidationMap,\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerHandleContext.d.ts","sourceRoot":"","sources":["../src/containerHandleContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAGpF,MAAM,WAAW,8BAA8B;IAC9C,WAAW,EAAE,WAAW,CAAC;IACzB,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CACrD;AAED,qBAAa,2BAA4B,YAAW,mBAAmB;aAarD,IAAI,EAAE,MAAM;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO;aACR,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"containerHandleContext.d.ts","sourceRoot":"","sources":["../src/containerHandleContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAGpF,MAAM,WAAW,8BAA8B;IAC9C,WAAW,EAAE,WAAW,CAAC;IACzB,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CACrD;AAED,qBAAa,2BAA4B,YAAW,mBAAmB;aAarD,IAAI,EAAE,MAAM;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO;aACR,YAAY,CAAC,EAAE,mBAAmB;IAdnD,IAAW,mBAAmB,IAAI,mBAAmB,CAEpD;IACD,SAAgB,YAAY,EAAE,MAAM,CAAC;IAErC;;;;;OAKG;gBAEc,IAAI,EAAE,MAAM,EACX,OAAO,EAAE,8BAA8B,EACxC,YAAY,CAAC,EAAE,mBAAmB,YAAA;IAK5C,WAAW,IAAI,IAAI;IAI1B,IAAW,UAAU,IAAI,OAAO,CAE/B;IAEY,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;CAGjE"}
|
|
@@ -8,9 +8,13 @@ exports.ContainerFluidHandleContext = void 0;
|
|
|
8
8
|
const container_definitions_1 = require("@fluidframework/container-definitions");
|
|
9
9
|
const internal_1 = require("@fluidframework/runtime-utils/internal");
|
|
10
10
|
class ContainerFluidHandleContext {
|
|
11
|
+
path;
|
|
12
|
+
runtime;
|
|
13
|
+
routeContext;
|
|
11
14
|
get IFluidHandleContext() {
|
|
12
15
|
return this;
|
|
13
16
|
}
|
|
17
|
+
absolutePath;
|
|
14
18
|
/**
|
|
15
19
|
* Creates a new ContainerFluidHandleContext.
|
|
16
20
|
* @param path - The path to this handle relative to the routeContext.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerHandleContext.js","sourceRoot":"","sources":["../src/containerHandleContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iFAAoE;AAGpE,qEAAmF;AAOnF,MAAa,2BAA2B;
|
|
1
|
+
{"version":3,"file":"containerHandleContext.js","sourceRoot":"","sources":["../src/containerHandleContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iFAAoE;AAGpE,qEAAmF;AAOnF,MAAa,2BAA2B;IAatB;IACC;IACD;IAdjB,IAAW,mBAAmB;QAC7B,OAAO,IAAI,CAAC;IACb,CAAC;IACe,YAAY,CAAS;IAErC;;;;;OAKG;IACH,YACiB,IAAY,EACX,OAAuC,EACxC,YAAkC;QAFlC,SAAI,GAAJ,IAAI,CAAQ;QACX,YAAO,GAAP,OAAO,CAAgC;QACxC,iBAAY,GAAZ,YAAY,CAAsB;QAElD,IAAI,CAAC,YAAY,GAAG,IAAA,oCAAyB,EAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACxE,CAAC;IAEM,WAAW;QACjB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC1E,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,KAAK,mCAAW,CAAC,QAAQ,CAAC;IAC1D,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,OAAiB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;CACD;AA/BD,kEA+BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport type { IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport type { IFluidHandleContext } from \"@fluidframework/core-interfaces/internal\";\nimport { generateHandleContextPath } from \"@fluidframework/runtime-utils/internal\";\n\nexport interface IContainerHandleContextRuntime {\n\tattachState: AttachState;\n\tresolveHandle(request: IRequest): Promise<IResponse>;\n}\n\nexport class ContainerFluidHandleContext implements IFluidHandleContext {\n\tpublic get IFluidHandleContext(): IFluidHandleContext {\n\t\treturn this;\n\t}\n\tpublic readonly absolutePath: string;\n\n\t/**\n\t * Creates a new ContainerFluidHandleContext.\n\t * @param path - The path to this handle relative to the routeContext.\n\t * @param runtime - The IRuntime object this context represents.\n\t * @param routeContext - The parent IFluidHandleContext that has a route to this handle.\n\t */\n\tconstructor(\n\t\tpublic readonly path: string,\n\t\tprivate readonly runtime: IContainerHandleContextRuntime,\n\t\tpublic readonly routeContext?: IFluidHandleContext,\n\t) {\n\t\tthis.absolutePath = generateHandleContextPath(path, this.routeContext);\n\t}\n\n\tpublic attachGraph(): void {\n\t\tthrow new Error(\"can't attach container runtime form within container!\");\n\t}\n\n\tpublic get isAttached(): boolean {\n\t\treturn this.runtime.attachState !== AttachState.Detached;\n\t}\n\n\tpublic async resolveHandle(request: IRequest): Promise<IResponse> {\n\t\treturn this.runtime.resolveHandle(request);\n\t}\n}\n"]}
|
|
@@ -335,10 +335,10 @@ export interface LoadContainerRuntimeParams {
|
|
|
335
335
|
*
|
|
336
336
|
* @privateRemarks
|
|
337
337
|
* Used to determine the default configuration for {@link IContainerRuntimeOptionsInternal} that affect the document schema.
|
|
338
|
-
* For example, let's say that feature `foo` was added in 2.
|
|
339
|
-
* was added to `IContainerRuntimeOptionsInternal` in 2.
|
|
340
|
-
* understand the new op type. If a customer were to set oldestSupportedClient to 2.
|
|
341
|
-
* enable `foo` by default. If a customer were to set oldestSupportedClient to
|
|
338
|
+
* For example, let's say that feature `foo` was added in 2.40 which introduces a new op type. Additionally, option `bar`
|
|
339
|
+
* was added to `IContainerRuntimeOptionsInternal` in 2.40 to enable/disable `foo` since clients prior to 2.40 would not
|
|
340
|
+
* understand the new op type. If a customer were to set oldestSupportedClient to 2.40.0, then `bar` would be set to
|
|
341
|
+
* enable `foo` by default. If a customer were to set oldestSupportedClient to 2.0.0, then `bar` would be set to
|
|
342
342
|
* disable `foo` by default.
|
|
343
343
|
*/
|
|
344
344
|
oldestSupportedClient?: OldestSupportedClientVersion;
|