@fluidframework/container-runtime 2.0.0-internal.3.0.1 → 2.0.0-internal.3.1.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/.eslintrc.js +19 -19
- package/.mocharc.js +2 -2
- package/api-extractor.json +2 -2
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +2 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +9 -2
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +80 -33
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +11 -9
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerHandleContext.d.ts.map +1 -1
- package/dist/containerHandleContext.js +3 -1
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +10 -0
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +140 -72
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +11 -9
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +18 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +66 -15
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +7 -3
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js +3 -1
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/dataStores.d.ts +26 -1
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +103 -18
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +8 -3
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/garbageCollection.d.ts +34 -14
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +188 -93
- package/dist/garbageCollection.js.map +1 -1
- package/dist/garbageCollectionConstants.d.ts +3 -0
- package/dist/garbageCollectionConstants.d.ts.map +1 -1
- package/dist/garbageCollectionConstants.js +6 -1
- package/dist/garbageCollectionConstants.js.map +1 -1
- package/dist/garbageCollectionHelpers.d.ts +26 -0
- package/dist/garbageCollectionHelpers.d.ts.map +1 -0
- package/dist/garbageCollectionHelpers.js +45 -0
- package/dist/garbageCollectionHelpers.js.map +1 -0
- package/dist/gcSweepReadyUsageDetection.d.ts +5 -5
- package/dist/gcSweepReadyUsageDetection.d.ts.map +1 -1
- package/dist/gcSweepReadyUsageDetection.js +14 -10
- package/dist/gcSweepReadyUsageDetection.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +5 -5
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +19 -12
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/index.d.ts.map +1 -1
- package/dist/opLifecycle/index.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +5 -2
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +4 -1
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +19 -17
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/opProperties.d.ts.map +1 -1
- package/dist/opProperties.js +1 -3
- package/dist/opProperties.js.map +1 -1
- package/dist/orderedClientElection.d.ts.map +1 -1
- package/dist/orderedClientElection.js +10 -4
- package/dist/orderedClientElection.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts +7 -0
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +7 -4
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/dist/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/runningSummarizer.d.ts.map +1 -1
- package/dist/runningSummarizer.js +34 -21
- package/dist/runningSummarizer.js.map +1 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +3 -2
- package/dist/scheduleManager.js.map +1 -1
- package/dist/serializedSnapshotStorage.d.ts +2 -2
- package/dist/serializedSnapshotStorage.d.ts.map +1 -1
- package/dist/serializedSnapshotStorage.js +5 -3
- package/dist/serializedSnapshotStorage.js.map +1 -1
- package/dist/summarizer.d.ts +2 -2
- package/dist/summarizer.d.ts.map +1 -1
- package/dist/summarizer.js +37 -17
- package/dist/summarizer.js.map +1 -1
- package/dist/summarizerClientElection.d.ts.map +1 -1
- package/dist/summarizerClientElection.js.map +1 -1
- package/dist/summarizerHandle.d.ts.map +1 -1
- package/dist/summarizerHandle.js.map +1 -1
- package/dist/summarizerHeuristics.d.ts.map +1 -1
- package/dist/summarizerHeuristics.js +6 -9
- package/dist/summarizerHeuristics.js.map +1 -1
- package/dist/summarizerTypes.d.ts +21 -21
- package/dist/summarizerTypes.d.ts.map +1 -1
- package/dist/summarizerTypes.js.map +1 -1
- package/dist/summaryCollection.d.ts.map +1 -1
- package/dist/summaryCollection.js +18 -8
- package/dist/summaryCollection.js.map +1 -1
- package/dist/summaryFormat.d.ts +22 -0
- package/dist/summaryFormat.d.ts.map +1 -1
- package/dist/summaryFormat.js +18 -10
- package/dist/summaryFormat.js.map +1 -1
- package/dist/summaryGenerator.d.ts.map +1 -1
- package/dist/summaryGenerator.js +34 -15
- package/dist/summaryGenerator.js.map +1 -1
- package/dist/summaryManager.d.ts.map +1 -1
- package/dist/summaryManager.js +21 -9
- package/dist/summaryManager.js.map +1 -1
- package/dist/throttler.d.ts +2 -2
- package/dist/throttler.d.ts.map +1 -1
- package/dist/throttler.js +4 -4
- package/dist/throttler.js.map +1 -1
- package/garbageCollection.md +15 -2
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +2 -1
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +9 -2
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +82 -35
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +11 -9
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerHandleContext.d.ts.map +1 -1
- package/lib/containerHandleContext.js +3 -1
- package/lib/containerHandleContext.js.map +1 -1
- package/lib/containerRuntime.d.ts +10 -0
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +146 -78
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +11 -9
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +18 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +68 -17
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +7 -3
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStoreRegistry.d.ts.map +1 -1
- package/lib/dataStoreRegistry.js +3 -1
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/dataStores.d.ts +26 -1
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +109 -24
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +9 -4
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/garbageCollection.d.ts +34 -14
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +190 -95
- package/lib/garbageCollection.js.map +1 -1
- package/lib/garbageCollectionConstants.d.ts +3 -0
- package/lib/garbageCollectionConstants.d.ts.map +1 -1
- package/lib/garbageCollectionConstants.js +5 -0
- package/lib/garbageCollectionConstants.js.map +1 -1
- package/lib/garbageCollectionHelpers.d.ts +26 -0
- package/lib/garbageCollectionHelpers.d.ts.map +1 -0
- package/lib/garbageCollectionHelpers.js +40 -0
- package/lib/garbageCollectionHelpers.js.map +1 -0
- package/lib/gcSweepReadyUsageDetection.d.ts +5 -5
- package/lib/gcSweepReadyUsageDetection.d.ts.map +1 -1
- package/lib/gcSweepReadyUsageDetection.js +14 -10
- package/lib/gcSweepReadyUsageDetection.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts +5 -5
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +19 -12
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts.map +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -1
- package/lib/opLifecycle/index.d.ts.map +1 -1
- package/lib/opLifecycle/index.js.map +1 -1
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +5 -2
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +5 -2
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +19 -17
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/lib/opProperties.d.ts.map +1 -1
- package/lib/opProperties.js +1 -3
- package/lib/opProperties.js.map +1 -1
- package/lib/orderedClientElection.d.ts.map +1 -1
- package/lib/orderedClientElection.js +10 -4
- package/lib/orderedClientElection.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts +7 -0
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +7 -4
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/lib/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/runningSummarizer.d.ts.map +1 -1
- package/lib/runningSummarizer.js +35 -22
- package/lib/runningSummarizer.js.map +1 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +3 -2
- package/lib/scheduleManager.js.map +1 -1
- package/lib/serializedSnapshotStorage.d.ts +2 -2
- package/lib/serializedSnapshotStorage.d.ts.map +1 -1
- package/lib/serializedSnapshotStorage.js +5 -3
- package/lib/serializedSnapshotStorage.js.map +1 -1
- package/lib/summarizer.d.ts +2 -2
- package/lib/summarizer.d.ts.map +1 -1
- package/lib/summarizer.js +37 -17
- package/lib/summarizer.js.map +1 -1
- package/lib/summarizerClientElection.d.ts.map +1 -1
- package/lib/summarizerClientElection.js.map +1 -1
- package/lib/summarizerHandle.d.ts.map +1 -1
- package/lib/summarizerHandle.js.map +1 -1
- package/lib/summarizerHeuristics.d.ts.map +1 -1
- package/lib/summarizerHeuristics.js +6 -9
- package/lib/summarizerHeuristics.js.map +1 -1
- package/lib/summarizerTypes.d.ts +21 -21
- package/lib/summarizerTypes.d.ts.map +1 -1
- package/lib/summarizerTypes.js.map +1 -1
- package/lib/summaryCollection.d.ts.map +1 -1
- package/lib/summaryCollection.js +18 -8
- package/lib/summaryCollection.js.map +1 -1
- package/lib/summaryFormat.d.ts +22 -0
- package/lib/summaryFormat.d.ts.map +1 -1
- package/lib/summaryFormat.js +20 -12
- package/lib/summaryFormat.js.map +1 -1
- package/lib/summaryGenerator.d.ts.map +1 -1
- package/lib/summaryGenerator.js +34 -15
- package/lib/summaryGenerator.js.map +1 -1
- package/lib/summaryManager.d.ts.map +1 -1
- package/lib/summaryManager.js +21 -9
- package/lib/summaryManager.js.map +1 -1
- package/lib/throttler.d.ts +2 -2
- package/lib/throttler.d.ts.map +1 -1
- package/lib/throttler.js +4 -4
- package/lib/throttler.js.map +1 -1
- package/package.json +121 -149
- package/prettier.config.cjs +1 -1
- package/src/batchTracker.ts +54 -49
- package/src/blobManager.ts +793 -672
- package/src/connectionTelemetry.ts +280 -249
- package/src/containerHandleContext.ts +27 -29
- package/src/containerRuntime.ts +3168 -2940
- package/src/dataStore.ts +172 -159
- package/src/dataStoreContext.ts +1098 -996
- package/src/dataStoreContexts.ts +178 -161
- package/src/dataStoreRegistry.ts +25 -20
- package/src/dataStores.ts +884 -728
- package/src/deltaScheduler.ts +158 -150
- package/src/garbageCollection.ts +1883 -1692
- package/src/garbageCollectionConstants.ts +6 -0
- package/src/garbageCollectionHelpers.ts +61 -0
- package/src/gcSweepReadyUsageDetection.ts +89 -83
- package/src/index.ts +67 -66
- package/src/opLifecycle/README.md +152 -0
- package/src/opLifecycle/batchManager.ts +145 -141
- package/src/opLifecycle/definitions.ts +29 -29
- package/src/opLifecycle/index.ts +5 -5
- package/src/opLifecycle/opCompressor.ts +54 -53
- package/src/opLifecycle/opDecompressor.ts +100 -81
- package/src/opLifecycle/opSplitter.ts +214 -188
- package/src/opLifecycle/outbox.ts +204 -194
- package/src/opLifecycle/remoteMessageProcessor.ts +62 -62
- package/src/opProperties.ts +11 -9
- package/src/orderedClientElection.ts +489 -457
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +384 -338
- package/src/runWhileConnectedCoordinator.ts +78 -71
- package/src/runningSummarizer.ts +619 -581
- package/src/scheduleManager.ts +299 -269
- package/src/serializedSnapshotStorage.ts +126 -112
- package/src/summarizer.ts +417 -381
- package/src/summarizerClientElection.ts +107 -100
- package/src/summarizerHandle.ts +11 -9
- package/src/summarizerHeuristics.ts +183 -186
- package/src/summarizerTypes.ts +344 -330
- package/src/summaryCollection.ts +378 -349
- package/src/summaryFormat.ts +170 -126
- package/src/summaryGenerator.ts +465 -406
- package/src/summaryManager.ts +377 -348
- package/src/throttler.ts +131 -122
- package/tsconfig.esnext.json +6 -6
- package/tsconfig.json +9 -13
- package/dist/garbageCollectionTombstoneUtils.d.ts +0 -14
- package/dist/garbageCollectionTombstoneUtils.d.ts.map +0 -1
- package/dist/garbageCollectionTombstoneUtils.js +0 -23
- package/dist/garbageCollectionTombstoneUtils.js.map +0 -1
- package/lib/garbageCollectionTombstoneUtils.d.ts +0 -14
- package/lib/garbageCollectionTombstoneUtils.d.ts.map +0 -1
- package/lib/garbageCollectionTombstoneUtils.js +0 -19
- package/lib/garbageCollectionTombstoneUtils.js.map +0 -1
- package/src/garbageCollectionTombstoneUtils.ts +0 -28
|
@@ -7,9 +7,9 @@ import { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
|
7
7
|
import { ChildLogger, TelemetryLogger } from "@fluidframework/telemetry-utils";
|
|
8
8
|
import { IDeltaManager } from "@fluidframework/container-definitions";
|
|
9
9
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
IDocumentMessage,
|
|
11
|
+
ISequencedDocumentMessage,
|
|
12
|
+
MessageType,
|
|
13
13
|
} from "@fluidframework/protocol-definitions";
|
|
14
14
|
import { assert, performance } from "@fluidframework/common-utils";
|
|
15
15
|
|
|
@@ -26,263 +26,294 @@ export const latencyThreshold = 5000;
|
|
|
26
26
|
// 3. Op received from service back (pushed to inbound queue).
|
|
27
27
|
// 4. Op is processed.
|
|
28
28
|
interface IOpPerfTelemetryProperties {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
/** Measure time between (1) and (2) - Measure time outbound op is sitting in queue due to active batch */
|
|
30
|
+
durationOutboundBatching: number; // was durationOutboundQueue in previous versions
|
|
31
|
+
/** Measure time between (2) and (3) - Track how long it took for op to be acked by service */
|
|
32
|
+
durationNetwork: number; // was durationInboundQueue
|
|
33
|
+
/** Measure time between (3) and (4) - Time between DM's inbound "push" event until DM's "op" event */
|
|
34
|
+
durationInboundToProcessing: number;
|
|
35
|
+
/** Length of the DeltaManager's inbound queue at the time of the DM's inbound "push" event (3) */
|
|
36
|
+
lengthInboundQueue: number;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Timings collected at various moments during the op processing.
|
|
41
41
|
*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
interface IOpPerfTimings {
|
|
43
|
+
/** Starting time for (1) */
|
|
44
|
+
submitOpEventTime: number;
|
|
45
|
+
/** Starting time for (2) */
|
|
46
|
+
outboundPushEventTime: number;
|
|
47
|
+
/** Starting time for (3) */
|
|
48
|
+
inboundPushEventTime: number;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
class OpPerfTelemetry {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
52
|
+
private pongCount: number = 0;
|
|
53
|
+
private pingLatency: number | undefined;
|
|
54
|
+
|
|
55
|
+
// Collab window tracking. This is timestamp of %1000 message.
|
|
56
|
+
private sequenceNumberForMsnTracking: number | undefined;
|
|
57
|
+
private msnTrackingTimestamp: number = 0;
|
|
58
|
+
// To track round trip time for every %500 client message.
|
|
59
|
+
private clientSequenceNumberForLatencyStatistics: number | undefined;
|
|
60
|
+
|
|
61
|
+
private opProcessingTimes: Partial<IOpPerfTimings> = {};
|
|
62
|
+
|
|
63
|
+
// Performance Data to be reported for ops round trips and processing.
|
|
64
|
+
private opPerfData: Partial<IOpPerfTelemetryProperties> = {};
|
|
65
|
+
|
|
66
|
+
private firstConnection = true;
|
|
67
|
+
private connectionOpSeqNumber: number | undefined;
|
|
68
|
+
private readonly bootTime = performance.now();
|
|
69
|
+
private connectionStartTime = 0;
|
|
70
|
+
private gap = 0;
|
|
71
|
+
|
|
72
|
+
private readonly logger: ITelemetryLogger;
|
|
73
|
+
|
|
74
|
+
public constructor(
|
|
75
|
+
private clientId: string | undefined,
|
|
76
|
+
private readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,
|
|
77
|
+
logger: ITelemetryLogger,
|
|
78
|
+
) {
|
|
79
|
+
this.logger = ChildLogger.create(logger, "OpPerf");
|
|
80
|
+
|
|
81
|
+
this.deltaManager.on("pong", (latency) => this.recordPingTime(latency));
|
|
82
|
+
this.deltaManager.on("submitOp", (message) => this.beforeOpSubmit(message));
|
|
83
|
+
|
|
84
|
+
this.deltaManager.on("op", (message) => this.afterProcessingOp(message));
|
|
85
|
+
|
|
86
|
+
this.deltaManager.on("connect", (details, opsBehind) => {
|
|
87
|
+
this.clientId = details.clientId;
|
|
88
|
+
if (opsBehind !== undefined) {
|
|
89
|
+
this.connectionOpSeqNumber = this.deltaManager.lastKnownSeqNumber;
|
|
90
|
+
this.gap = opsBehind;
|
|
91
|
+
this.connectionStartTime = performance.now();
|
|
92
|
+
|
|
93
|
+
// We might be already up-today. If so, report it right away.
|
|
94
|
+
if (this.gap <= 0) {
|
|
95
|
+
this.reportGettingUpToDate();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
this.deltaManager.on("disconnect", () => {
|
|
100
|
+
this.sequenceNumberForMsnTracking = undefined;
|
|
101
|
+
this.clientSequenceNumberForLatencyStatistics = undefined;
|
|
102
|
+
this.opProcessingTimes = {};
|
|
103
|
+
this.opPerfData = {};
|
|
104
|
+
this.connectionOpSeqNumber = undefined;
|
|
105
|
+
this.firstConnection = false;
|
|
106
|
+
this.pongCount = 0;
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
this.deltaManager.outbound.on("push", (messages) => {
|
|
110
|
+
for (const msg of messages) {
|
|
111
|
+
if (
|
|
112
|
+
msg.type === MessageType.Operation &&
|
|
113
|
+
this.clientSequenceNumberForLatencyStatistics === msg.clientSequenceNumber
|
|
114
|
+
) {
|
|
115
|
+
assert(
|
|
116
|
+
this.opProcessingTimes.outboundPushEventTime === undefined,
|
|
117
|
+
0x2c8 /* "outboundPushEventTime should be undefined" */,
|
|
118
|
+
);
|
|
119
|
+
assert(
|
|
120
|
+
this.opPerfData.durationNetwork === undefined,
|
|
121
|
+
0x2c9 /* "durationNetwork should be undefined" */,
|
|
122
|
+
);
|
|
123
|
+
this.opProcessingTimes.outboundPushEventTime = Date.now();
|
|
124
|
+
|
|
125
|
+
assert(
|
|
126
|
+
this.opPerfData.durationOutboundBatching === undefined,
|
|
127
|
+
0x2ca /* "durationOutboundBatching should be undefined" */,
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
assert(
|
|
131
|
+
this.opProcessingTimes.submitOpEventTime !== undefined,
|
|
132
|
+
0x2cb /* "submitOpEventTime should be undefined" */,
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
this.opPerfData.durationOutboundBatching =
|
|
136
|
+
this.opProcessingTimes.outboundPushEventTime -
|
|
137
|
+
this.opProcessingTimes.submitOpEventTime;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
this.deltaManager.inbound.on("push", (message: ISequencedDocumentMessage) => {
|
|
143
|
+
if (
|
|
144
|
+
this.clientId === message.clientId &&
|
|
145
|
+
message.type === MessageType.Operation &&
|
|
146
|
+
this.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber &&
|
|
147
|
+
this.opProcessingTimes.outboundPushEventTime !== undefined
|
|
148
|
+
) {
|
|
149
|
+
this.opProcessingTimes.inboundPushEventTime = Date.now();
|
|
150
|
+
this.opPerfData.durationNetwork =
|
|
151
|
+
this.opProcessingTimes.inboundPushEventTime -
|
|
152
|
+
this.opProcessingTimes.outboundPushEventTime;
|
|
153
|
+
this.opProcessingTimes.outboundPushEventTime = undefined;
|
|
154
|
+
this.opPerfData.lengthInboundQueue = this.deltaManager.inbound.length;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
this.deltaManager.inbound.on("idle", (count: number, duration: number) => {
|
|
159
|
+
// Do not want to log zero for sure.
|
|
160
|
+
// We are more interested in aggregates, so logging only if we are processing some number of ops
|
|
161
|
+
// Cut-off is arbitrary - can be increased or decreased based on amount of data collected and questions we
|
|
162
|
+
// want to get answered
|
|
163
|
+
// back-compat: Once 0.36 loader version saturates (count & duration args were added there),
|
|
164
|
+
// we can remove typeof check.
|
|
165
|
+
if (typeof count === "number" && count >= 100) {
|
|
166
|
+
this.logger.sendPerformanceEvent({
|
|
167
|
+
eventName: "GetDeltas_OpProcessing",
|
|
168
|
+
count,
|
|
169
|
+
duration,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
private reportGettingUpToDate() {
|
|
176
|
+
this.connectionOpSeqNumber = undefined;
|
|
177
|
+
this.logger.sendPerformanceEvent({
|
|
178
|
+
eventName: "ConnectionSpeed",
|
|
179
|
+
duration: performance.now() - this.connectionStartTime,
|
|
180
|
+
ops: this.gap,
|
|
181
|
+
// track time to connect only for first connection.
|
|
182
|
+
timeToConnect: this.firstConnection
|
|
183
|
+
? TelemetryLogger.formatTick(this.connectionStartTime - this.bootTime)
|
|
184
|
+
: undefined,
|
|
185
|
+
firstConnection: this.firstConnection,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
private recordPingTime(latency: number) {
|
|
190
|
+
this.pingLatency = latency;
|
|
191
|
+
// logging one in every 1000 pongs, including the first time, if it is a "write" client.
|
|
192
|
+
if (this.pongCount % 100 === 0 && this.deltaManager.active) {
|
|
193
|
+
this.logger.sendPerformanceEvent({
|
|
194
|
+
eventName: "DeltaLatency",
|
|
195
|
+
duration: latency,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
this.pongCount++;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
private beforeOpSubmit(message: IDocumentMessage) {
|
|
202
|
+
// start with first client op and measure latency every 500 client ops
|
|
203
|
+
if (
|
|
204
|
+
this.clientSequenceNumberForLatencyStatistics === undefined &&
|
|
205
|
+
message.clientSequenceNumber % 500 === 1
|
|
206
|
+
) {
|
|
207
|
+
assert(
|
|
208
|
+
this.opProcessingTimes.outboundPushEventTime === undefined,
|
|
209
|
+
0x2cc /* "OpTimeSittingInboundQueue should be undefined" */,
|
|
210
|
+
);
|
|
211
|
+
assert(
|
|
212
|
+
this.opPerfData.durationNetwork === undefined,
|
|
213
|
+
0x2cd /* "durationNetwork should be undefined" */,
|
|
214
|
+
);
|
|
215
|
+
this.opProcessingTimes.submitOpEventTime = Date.now();
|
|
216
|
+
this.clientSequenceNumberForLatencyStatistics = message.clientSequenceNumber;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
private afterProcessingOp(message: ISequencedDocumentMessage) {
|
|
221
|
+
const sequenceNumber = message.sequenceNumber;
|
|
222
|
+
|
|
223
|
+
if (sequenceNumber === this.connectionOpSeqNumber) {
|
|
224
|
+
this.reportGettingUpToDate();
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Record collab window max size after every 1000th op.
|
|
228
|
+
if (this.sequenceNumberForMsnTracking === undefined && sequenceNumber % 1000 === 0) {
|
|
229
|
+
this.sequenceNumberForMsnTracking = sequenceNumber;
|
|
230
|
+
this.msnTrackingTimestamp = message.timestamp;
|
|
231
|
+
}
|
|
232
|
+
if (
|
|
233
|
+
this.sequenceNumberForMsnTracking !== undefined &&
|
|
234
|
+
message.minimumSequenceNumber >= this.sequenceNumberForMsnTracking
|
|
235
|
+
) {
|
|
236
|
+
assert(
|
|
237
|
+
this.msnTrackingTimestamp !== undefined,
|
|
238
|
+
0x2ce /* "msnTrackingTimestamp should not be undefined" */,
|
|
239
|
+
);
|
|
240
|
+
this.logger.sendPerformanceEvent({
|
|
241
|
+
eventName: "MsnStatistics",
|
|
242
|
+
sequenceNumber,
|
|
243
|
+
msnDistance: sequenceNumber - this.sequenceNumberForMsnTracking,
|
|
244
|
+
duration: message.timestamp - this.msnTrackingTimestamp,
|
|
245
|
+
});
|
|
246
|
+
this.sequenceNumberForMsnTracking = undefined;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (
|
|
250
|
+
this.clientId === message.clientId &&
|
|
251
|
+
this.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber
|
|
252
|
+
) {
|
|
253
|
+
assert(
|
|
254
|
+
this.opProcessingTimes.submitOpEventTime !== undefined,
|
|
255
|
+
0x120 /* "Undefined latency statistics (op send time)" */,
|
|
256
|
+
);
|
|
257
|
+
const currentTime = Date.now();
|
|
258
|
+
|
|
259
|
+
if (this.opProcessingTimes.inboundPushEventTime !== undefined) {
|
|
260
|
+
this.opPerfData.durationInboundToProcessing =
|
|
261
|
+
currentTime - this.opProcessingTimes.inboundPushEventTime;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
const duration = currentTime - this.opProcessingTimes.submitOpEventTime;
|
|
265
|
+
|
|
266
|
+
// One of the core expectations for Fluid service is to be fast.
|
|
267
|
+
// When it's not the case, we want to learn about it and be able to investigate, so
|
|
268
|
+
// raise awareness.
|
|
269
|
+
// This also helps identify cases where it's due to client behavior (sending too many ops)
|
|
270
|
+
// that results in overwhelming ordering service and thus starting to see long latencies.
|
|
271
|
+
// The threshold could be adjusted, but ideally it stays workload-agnostic, as service
|
|
272
|
+
// performance impacts all workloads relying on service.
|
|
273
|
+
const category = duration > latencyThreshold ? "error" : "performance";
|
|
274
|
+
|
|
275
|
+
this.logger.sendPerformanceEvent({
|
|
276
|
+
eventName: "OpRoundtripTime",
|
|
277
|
+
sequenceNumber,
|
|
278
|
+
referenceSequenceNumber: message.referenceSequenceNumber,
|
|
279
|
+
duration,
|
|
280
|
+
category,
|
|
281
|
+
pingLatency: this.pingLatency,
|
|
282
|
+
msnDistance:
|
|
283
|
+
this.deltaManager.lastSequenceNumber - this.deltaManager.minimumSequenceNumber,
|
|
284
|
+
...this.opPerfData,
|
|
285
|
+
});
|
|
286
|
+
this.clientSequenceNumberForLatencyStatistics = undefined;
|
|
287
|
+
this.opPerfData = {};
|
|
288
|
+
}
|
|
289
|
+
}
|
|
260
290
|
}
|
|
261
291
|
export interface IPerfSignalReport {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
292
|
+
/**
|
|
293
|
+
* Identifier for the signal being submitted in order to
|
|
294
|
+
* allow collection of data around the roundtrip of signal messages.
|
|
295
|
+
*/
|
|
296
|
+
signalSequenceNumber: number;
|
|
297
|
+
/**
|
|
298
|
+
* Number of signals that were expected but not received.
|
|
299
|
+
*/
|
|
300
|
+
signalsLost: number;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Timestamp before submitting the signal we will trace.
|
|
304
|
+
*/
|
|
305
|
+
signalTimestamp: number;
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Expected Signal Sequence to be received.
|
|
309
|
+
*/
|
|
310
|
+
trackingSignalSequenceNumber: number | undefined;
|
|
281
311
|
}
|
|
282
312
|
|
|
283
313
|
export function ReportOpPerfTelemetry(
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
314
|
+
clientId: string | undefined,
|
|
315
|
+
deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,
|
|
316
|
+
logger: ITelemetryLogger,
|
|
317
|
+
) {
|
|
318
|
+
new OpPerfTelemetry(clientId, deltaManager, logger);
|
|
288
319
|
}
|
|
@@ -3,42 +3,40 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
IFluidHandleContext,
|
|
8
|
-
IRequest,
|
|
9
|
-
IResponse,
|
|
10
|
-
} from "@fluidframework/core-interfaces";
|
|
6
|
+
import { IFluidHandleContext, IRequest, IResponse } from "@fluidframework/core-interfaces";
|
|
11
7
|
import { AttachState } from "@fluidframework/container-definitions";
|
|
12
8
|
import { generateHandleContextPath } from "@fluidframework/runtime-utils";
|
|
13
9
|
import { ContainerRuntime } from "./containerRuntime";
|
|
14
10
|
|
|
15
11
|
export class ContainerFluidHandleContext implements IFluidHandleContext {
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
public get IFluidHandleContext() {
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
public readonly absolutePath: string;
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Creates a new ContainerFluidHandleContext.
|
|
19
|
+
* @param path - The path to this handle relative to the routeContext.
|
|
20
|
+
* @param runtime - The IRuntime object this context represents.
|
|
21
|
+
* @param routeContext - The parent IFluidHandleContext that has a route to this handle.
|
|
22
|
+
*/
|
|
23
|
+
constructor(
|
|
24
|
+
public readonly path: string,
|
|
25
|
+
private readonly runtime: ContainerRuntime,
|
|
26
|
+
public readonly routeContext?: IFluidHandleContext,
|
|
27
|
+
) {
|
|
28
|
+
this.absolutePath = generateHandleContextPath(path, this.routeContext);
|
|
29
|
+
}
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
public attachGraph(): void {
|
|
32
|
+
throw new Error("can't attach container runtime form within container!");
|
|
33
|
+
}
|
|
36
34
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
public get isAttached() {
|
|
36
|
+
return this.runtime.attachState !== AttachState.Detached;
|
|
37
|
+
}
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
public async resolveHandle(request: IRequest): Promise<IResponse> {
|
|
40
|
+
return this.runtime.resolveHandle(request);
|
|
41
|
+
}
|
|
44
42
|
}
|