@fluidframework/container-runtime 2.0.0-dev.2.2.0.111723 → 2.0.0-dev.3.1.0.125672
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 +21 -10
- package/.mocharc.js +2 -2
- package/api-extractor.json +2 -2
- package/dist/batchTracker.d.ts +1 -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 +62 -28
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +256 -102
- 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 +110 -78
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +336 -331
- 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 +2 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +40 -23
- 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 +12 -9
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +69 -46
- 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 +57 -42
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +371 -239
- package/dist/garbageCollection.js.map +1 -1
- package/dist/garbageCollectionConstants.d.ts +23 -0
- package/dist/garbageCollectionConstants.d.ts.map +1 -0
- package/dist/garbageCollectionConstants.js +36 -0
- package/dist/garbageCollectionConstants.js.map +1 -0
- package/dist/garbageCollectionHelpers.d.ts +15 -0
- package/dist/garbageCollectionHelpers.d.ts.map +1 -0
- package/dist/garbageCollectionHelpers.js +27 -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 +15 -11
- package/dist/gcSweepReadyUsageDetection.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -6
- package/dist/index.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +42 -0
- package/dist/opLifecycle/batchManager.d.ts.map +1 -0
- package/dist/opLifecycle/batchManager.js +124 -0
- package/dist/opLifecycle/batchManager.js.map +1 -0
- package/dist/opLifecycle/definitions.d.ts +64 -0
- package/dist/opLifecycle/definitions.d.ts.map +1 -0
- package/dist/opLifecycle/definitions.js +7 -0
- package/dist/opLifecycle/definitions.js.map +1 -0
- package/dist/opLifecycle/index.d.ts +12 -0
- package/dist/opLifecycle/index.d.ts.map +1 -0
- package/dist/opLifecycle/index.js +22 -0
- package/dist/opLifecycle/index.js.map +1 -0
- package/dist/{opCompressor.d.ts → opLifecycle/opCompressor.d.ts} +3 -3
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -0
- package/dist/opLifecycle/opCompressor.js +67 -0
- package/dist/opLifecycle/opCompressor.js.map +1 -0
- package/dist/{opDecompressor.d.ts → opLifecycle/opDecompressor.d.ts} +2 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -0
- package/dist/{opDecompressor.js → opLifecycle/opDecompressor.js} +37 -21
- package/dist/opLifecycle/opDecompressor.js.map +1 -0
- package/dist/opLifecycle/opSplitter.d.ts +49 -0
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -0
- package/dist/opLifecycle/opSplitter.js +173 -0
- package/dist/opLifecycle/opSplitter.js.map +1 -0
- package/dist/opLifecycle/outbox.d.ts +52 -0
- package/dist/opLifecycle/outbox.d.ts.map +1 -0
- package/dist/opLifecycle/outbox.js +164 -0
- package/dist/opLifecycle/outbox.js.map +1 -0
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +26 -0
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -0
- package/dist/opLifecycle/remoteMessageProcessor.js +96 -0
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -0
- 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 +4 -13
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +134 -161
- 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 -22
- package/dist/runningSummarizer.js.map +1 -1
- package/dist/scheduleManager.d.ts +0 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +11 -21
- package/dist/scheduleManager.js.map +1 -1
- package/dist/serializedSnapshotStorage.d.ts.map +1 -1
- package/dist/serializedSnapshotStorage.js +3 -1
- package/dist/serializedSnapshotStorage.js.map +1 -1
- package/dist/summarizer.d.ts +2 -3
- package/dist/summarizer.d.ts.map +1 -1
- package/dist/summarizer.js +39 -18
- package/dist/summarizer.js.map +1 -1
- package/dist/summarizerClientElection.d.ts +1 -2
- package/dist/summarizerClientElection.d.ts.map +1 -1
- package/dist/summarizerClientElection.js +3 -30
- 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 +22 -25
- 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.map +1 -1
- package/dist/summaryFormat.js +18 -11
- package/dist/summaryFormat.js.map +1 -1
- package/dist/summaryGenerator.d.ts.map +1 -1
- package/dist/summaryGenerator.js +32 -14
- 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 +1 -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 +62 -28
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +259 -105
- 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 +110 -78
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +340 -334
- 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 +2 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +41 -24
- 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 +12 -9
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +75 -52
- 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 +57 -42
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +364 -232
- package/lib/garbageCollection.js.map +1 -1
- package/lib/garbageCollectionConstants.d.ts +23 -0
- package/lib/garbageCollectionConstants.d.ts.map +1 -0
- package/lib/garbageCollectionConstants.js +33 -0
- package/lib/garbageCollectionConstants.js.map +1 -0
- package/lib/garbageCollectionHelpers.d.ts +15 -0
- package/lib/garbageCollectionHelpers.d.ts.map +1 -0
- package/lib/garbageCollectionHelpers.js +23 -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 +15 -11
- package/lib/gcSweepReadyUsageDetection.js.map +1 -1
- package/lib/index.d.ts +4 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts +42 -0
- package/lib/opLifecycle/batchManager.d.ts.map +1 -0
- package/lib/opLifecycle/batchManager.js +120 -0
- package/lib/opLifecycle/batchManager.js.map +1 -0
- package/lib/opLifecycle/definitions.d.ts +64 -0
- package/lib/opLifecycle/definitions.d.ts.map +1 -0
- package/lib/opLifecycle/definitions.js +6 -0
- package/lib/opLifecycle/definitions.js.map +1 -0
- package/lib/opLifecycle/index.d.ts +12 -0
- package/lib/opLifecycle/index.d.ts.map +1 -0
- package/lib/opLifecycle/index.js +11 -0
- package/lib/opLifecycle/index.js.map +1 -0
- package/lib/{opCompressor.d.ts → opLifecycle/opCompressor.d.ts} +3 -3
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -0
- package/lib/opLifecycle/opCompressor.js +63 -0
- package/lib/opLifecycle/opCompressor.js.map +1 -0
- package/lib/{opDecompressor.d.ts → opLifecycle/opDecompressor.d.ts} +2 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -0
- package/lib/{opDecompressor.js → opLifecycle/opDecompressor.js} +37 -21
- package/lib/opLifecycle/opDecompressor.js.map +1 -0
- package/lib/opLifecycle/opSplitter.d.ts +49 -0
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -0
- package/lib/opLifecycle/opSplitter.js +168 -0
- package/lib/opLifecycle/opSplitter.js.map +1 -0
- package/lib/opLifecycle/outbox.d.ts +52 -0
- package/lib/opLifecycle/outbox.d.ts.map +1 -0
- package/lib/opLifecycle/outbox.js +160 -0
- package/lib/opLifecycle/outbox.js.map +1 -0
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +26 -0
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -0
- package/lib/opLifecycle/remoteMessageProcessor.js +91 -0
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -0
- 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 +4 -13
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +134 -161
- 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 -23
- package/lib/runningSummarizer.js.map +1 -1
- package/lib/scheduleManager.d.ts +0 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +11 -21
- package/lib/scheduleManager.js.map +1 -1
- package/lib/serializedSnapshotStorage.d.ts.map +1 -1
- package/lib/serializedSnapshotStorage.js +3 -1
- package/lib/serializedSnapshotStorage.js.map +1 -1
- package/lib/summarizer.d.ts +2 -3
- package/lib/summarizer.d.ts.map +1 -1
- package/lib/summarizer.js +39 -18
- package/lib/summarizer.js.map +1 -1
- package/lib/summarizerClientElection.d.ts +1 -2
- package/lib/summarizerClientElection.d.ts.map +1 -1
- package/lib/summarizerClientElection.js +3 -30
- 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 +22 -25
- 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.map +1 -1
- package/lib/summaryFormat.js +20 -13
- package/lib/summaryFormat.js.map +1 -1
- package/lib/summaryGenerator.d.ts.map +1 -1
- package/lib/summaryGenerator.js +32 -14
- 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 +28 -38
- package/prettier.config.cjs +1 -1
- package/src/batchTracker.ts +55 -50
- package/src/blobManager.ts +802 -541
- package/src/connectionTelemetry.ts +280 -249
- package/src/containerHandleContext.ts +27 -29
- package/src/containerRuntime.ts +3125 -2982
- package/src/dataStore.ts +172 -159
- package/src/dataStoreContext.ts +1049 -992
- package/src/dataStoreContexts.ts +178 -161
- package/src/dataStoreRegistry.ts +25 -20
- package/src/dataStores.ts +785 -711
- package/src/deltaScheduler.ts +158 -150
- package/src/garbageCollection.ts +1797 -1558
- package/src/garbageCollectionConstants.ts +38 -0
- package/src/garbageCollectionHelpers.ts +37 -0
- package/src/gcSweepReadyUsageDetection.ts +90 -84
- package/src/index.ts +68 -69
- package/src/opLifecycle/batchManager.ts +167 -0
- package/src/opLifecycle/definitions.ts +70 -0
- package/src/opLifecycle/index.ts +18 -0
- package/src/opLifecycle/opCompressor.ts +82 -0
- package/src/opLifecycle/opDecompressor.ts +124 -0
- package/src/opLifecycle/opSplitter.ts +238 -0
- package/src/opLifecycle/outbox.ts +228 -0
- package/src/opLifecycle/remoteMessageProcessor.ts +106 -0
- package/src/opProperties.ts +11 -9
- package/src/orderedClientElection.ts +489 -457
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +379 -381
- package/src/runWhileConnectedCoordinator.ts +78 -71
- package/src/runningSummarizer.ts +619 -582
- package/src/scheduleManager.ts +299 -280
- package/src/serializedSnapshotStorage.ts +116 -111
- package/src/summarizer.ts +417 -381
- package/src/summarizerClientElection.ts +107 -129
- package/src/summarizerHandle.ts +11 -9
- package/src/summarizerHeuristics.ts +183 -186
- package/src/summarizerTypes.ts +344 -333
- package/src/summaryCollection.ts +378 -349
- package/src/summaryFormat.ts +146 -127
- package/src/summaryGenerator.ts +464 -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/batchManager.d.ts +0 -42
- package/dist/batchManager.d.ts.map +0 -1
- package/dist/batchManager.js +0 -83
- package/dist/batchManager.js.map +0 -1
- package/dist/opCompressor.d.ts.map +0 -1
- package/dist/opCompressor.js +0 -50
- package/dist/opCompressor.js.map +0 -1
- package/dist/opDecompressor.d.ts.map +0 -1
- package/dist/opDecompressor.js.map +0 -1
- package/lib/batchManager.d.ts +0 -42
- package/lib/batchManager.d.ts.map +0 -1
- package/lib/batchManager.js +0 -79
- package/lib/batchManager.js.map +0 -1
- package/lib/opCompressor.d.ts.map +0 -1
- package/lib/opCompressor.js +0 -46
- package/lib/opCompressor.js.map +0 -1
- package/lib/opDecompressor.d.ts.map +0 -1
- package/lib/opDecompressor.js.map +0 -1
- package/src/batchManager.ts +0 -108
- package/src/opCompressor.ts +0 -59
- package/src/opDecompressor.ts +0 -82
package/src/summarizerTypes.ts
CHANGED
|
@@ -4,20 +4,18 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
IEvent,
|
|
8
|
+
IEventProvider,
|
|
9
|
+
ITelemetryLogger,
|
|
10
|
+
ITelemetryProperties,
|
|
11
11
|
} from "@fluidframework/common-definitions";
|
|
12
12
|
import { ITelemetryLoggerPropertyBag } from "@fluidframework/telemetry-utils";
|
|
13
|
-
import {
|
|
14
|
-
IFluidLoadable,
|
|
15
|
-
} from "@fluidframework/core-interfaces";
|
|
13
|
+
import { IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
16
14
|
import { ContainerWarning, IDeltaManager } from "@fluidframework/container-definitions";
|
|
17
15
|
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
ISequencedDocumentMessage,
|
|
17
|
+
ISummaryTree,
|
|
18
|
+
IDocumentMessage,
|
|
21
19
|
} from "@fluidframework/protocol-definitions";
|
|
22
20
|
import { ISummaryStats } from "@fluidframework/runtime-definitions";
|
|
23
21
|
import { ISummaryAckMessage, ISummaryNackMessage, ISummaryOpMessage } from "./summaryCollection";
|
|
@@ -33,10 +31,10 @@ export const ISummarizer: keyof IProvideSummarizer = "ISummarizer";
|
|
|
33
31
|
* @deprecated This will be removed in a later release.
|
|
34
32
|
*/
|
|
35
33
|
export interface IProvideSummarizer {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated This will be removed in a later release.
|
|
36
|
+
*/
|
|
37
|
+
readonly ISummarizer: ISummarizer;
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
/**
|
|
@@ -44,109 +42,106 @@ export interface IProvideSummarizer {
|
|
|
44
42
|
* @param T - cancellation reason type
|
|
45
43
|
*/
|
|
46
44
|
export interface ICancellationToken<T> {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
/** Tells if this cancellable token is cancelled */
|
|
46
|
+
readonly cancelled: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Promise that gets fulfilled when this cancellable token is cancelled
|
|
49
|
+
* @returns reason of cancellation
|
|
50
|
+
*/
|
|
51
|
+
readonly waitCancelled: Promise<T>;
|
|
54
52
|
}
|
|
55
53
|
|
|
56
54
|
/* Similar to AbortSignal, but using promise instead of events */
|
|
57
55
|
export type ISummaryCancellationToken = ICancellationToken<SummarizerStopReason>;
|
|
58
56
|
|
|
59
57
|
export interface ISummarizerInternalsProvider {
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
/** Encapsulates the work to walk the internals of the running container to generate a summary */
|
|
59
|
+
submitSummary(options: ISubmitSummaryOptions): Promise<SubmitSummaryResult>;
|
|
62
60
|
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
/** Callback whenever a new SummaryAck is received, to update internal tracking state */
|
|
62
|
+
refreshLatestSummaryAck(options: IRefreshSummaryAckOptions): Promise<void>;
|
|
65
63
|
}
|
|
66
64
|
|
|
67
65
|
/**
|
|
68
66
|
* @deprecated Options that control the behavior of a running summarizer.
|
|
69
67
|
* */
|
|
70
68
|
export interface ISummarizerOptions {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Set to true to disable the default heuristics from running; false by default.
|
|
71
|
+
* This affects only the heuristics around when a summarizer should
|
|
72
|
+
* submit summaries. So when it is disabled, summarizer clients should
|
|
73
|
+
* not be expected to summarize unless an on-demand summary is requested.
|
|
74
|
+
*/
|
|
75
|
+
disableHeuristics: boolean;
|
|
78
76
|
}
|
|
79
77
|
|
|
80
78
|
export interface ISummarizingWarning extends ContainerWarning {
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
readonly errorType: "summarizingError";
|
|
80
|
+
readonly logged: boolean;
|
|
83
81
|
}
|
|
84
82
|
|
|
85
83
|
export interface IConnectableRuntime {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
readonly disposed: boolean;
|
|
85
|
+
readonly connected: boolean;
|
|
86
|
+
readonly clientId: string | undefined;
|
|
87
|
+
readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
88
|
+
once(event: "connected" | "disconnected" | "dispose", listener: () => void): this;
|
|
91
89
|
}
|
|
92
90
|
|
|
93
91
|
export interface ISummarizerRuntime extends IConnectableRuntime {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
on(event: "batchEnd", listener: (error: any, op: ISequencedDocumentMessage) => void): this;
|
|
100
|
-
/** @deprecated 1.0, please remove all implementations and usage */
|
|
101
|
-
removeListener(event: "batchEnd", listener: (error: any, op: ISequencedDocumentMessage) => void): this;
|
|
92
|
+
readonly logger: ITelemetryLogger;
|
|
93
|
+
/** clientId of parent (non-summarizing) container that owns summarizer container */
|
|
94
|
+
readonly summarizerClientId: string | undefined;
|
|
95
|
+
disposeFn?(): void;
|
|
96
|
+
closeFn(): void;
|
|
102
97
|
}
|
|
103
98
|
|
|
104
99
|
/** Options affecting summarize behavior. */
|
|
105
100
|
export interface ISummarizeOptions {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
101
|
+
/** True to generate the full tree with no handle reuse optimizations; defaults to false */
|
|
102
|
+
readonly fullTree?: boolean;
|
|
103
|
+
/** True to ask the server what the latest summary is first; defaults to false */
|
|
104
|
+
readonly refreshLatestAck?: boolean;
|
|
110
105
|
}
|
|
111
106
|
|
|
112
107
|
/**
|
|
113
108
|
* Data required to update internal tracking state after receiving a Summary Ack.
|
|
114
109
|
*/
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
110
|
+
export interface IRefreshSummaryAckOptions {
|
|
111
|
+
/** Handle from the ack's summary op. */
|
|
112
|
+
readonly proposalHandle: string | undefined;
|
|
113
|
+
/** Handle from the summary ack just received */
|
|
114
|
+
readonly ackHandle: string;
|
|
115
|
+
/** Reference sequence number from the ack's summary op */
|
|
116
|
+
readonly summaryRefSeq: number;
|
|
117
|
+
/** Telemetry logger to which telemetry events will be forwarded. */
|
|
118
|
+
readonly summaryLogger: ITelemetryLogger;
|
|
124
119
|
}
|
|
125
120
|
|
|
126
121
|
export interface ISubmitSummaryOptions extends ISummarizeOptions {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
122
|
+
/** Logger to use for correlated summary events */
|
|
123
|
+
readonly summaryLogger: ITelemetryLogger;
|
|
124
|
+
/** Tells when summary process should be cancelled */
|
|
125
|
+
readonly cancellationToken: ISummaryCancellationToken;
|
|
131
126
|
}
|
|
132
127
|
|
|
133
128
|
export interface IOnDemandSummarizeOptions extends ISummarizeOptions {
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
/** Reason for generating summary. */
|
|
130
|
+
readonly reason: string;
|
|
136
131
|
}
|
|
137
132
|
|
|
138
133
|
/** Options to use when enqueueing a summarize attempt. */
|
|
139
134
|
export interface IEnqueueSummarizeOptions extends IOnDemandSummarizeOptions {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
135
|
+
/** If specified, The summarize attempt will not occur until after this sequence number. */
|
|
136
|
+
readonly afterSequenceNumber?: number;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* True to override the existing enqueued summarize attempt if there is one.
|
|
140
|
+
* This will guarantee that this attempt gets enqueued. If override is false,
|
|
141
|
+
* than an existing enqueued summarize attempt will block a new one from being
|
|
142
|
+
* enqueued. There can only be one enqueued at a time. Defaults to false.
|
|
143
|
+
*/
|
|
144
|
+
readonly override?: boolean;
|
|
150
145
|
}
|
|
151
146
|
|
|
152
147
|
/**
|
|
@@ -154,59 +149,59 @@ export interface IEnqueueSummarizeOptions extends IOnDemandSummarizeOptions {
|
|
|
154
149
|
* only relevant at the root of the tree.
|
|
155
150
|
*/
|
|
156
151
|
export interface IGeneratedSummaryStats extends ISummaryStats {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
152
|
+
/** The total number of data stores in the container. */
|
|
153
|
+
readonly dataStoreCount: number;
|
|
154
|
+
/** The number of data stores that were summarized in this summary. */
|
|
155
|
+
readonly summarizedDataStoreCount: number;
|
|
156
|
+
/** The number of data stores whose GC reference state was updated in this summary. */
|
|
157
|
+
readonly gcStateUpdatedDataStoreCount?: number;
|
|
158
|
+
/** The size of the gc blobs in this summary. */
|
|
159
|
+
readonly gcTotalBlobsSize?: number;
|
|
160
|
+
/** The number of gc blobs in this summary. */
|
|
161
|
+
readonly gcBlobNodeCount?: number;
|
|
162
|
+
/** The summary number for a container's summary. Incremented on summaries throughout its lifetime. */
|
|
163
|
+
readonly summaryNumber: number;
|
|
169
164
|
}
|
|
170
165
|
|
|
171
166
|
/** Base results for all submitSummary attempts. */
|
|
172
167
|
export interface IBaseSummarizeResult {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
168
|
+
readonly stage: "base";
|
|
169
|
+
/** Error object related to failed summarize attempt. */
|
|
170
|
+
readonly error: any;
|
|
171
|
+
/** Reference sequence number as of the generate summary attempt. */
|
|
172
|
+
readonly referenceSequenceNumber: number;
|
|
173
|
+
readonly minimumSequenceNumber: number;
|
|
179
174
|
}
|
|
180
175
|
|
|
181
176
|
/** Results of submitSummary after generating the summary tree. */
|
|
182
177
|
export interface IGenerateSummaryTreeResult extends Omit<IBaseSummarizeResult, "stage"> {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
178
|
+
readonly stage: "generate";
|
|
179
|
+
/** Generated summary tree. */
|
|
180
|
+
readonly summaryTree: ISummaryTree;
|
|
181
|
+
/** Stats for generated summary tree. */
|
|
182
|
+
readonly summaryStats: IGeneratedSummaryStats;
|
|
183
|
+
/** Time it took to generate the summary tree and stats. */
|
|
184
|
+
readonly generateDuration: number;
|
|
185
|
+
/** True if the full tree regeneration with no handle reuse optimizations was forced. */
|
|
186
|
+
readonly forcedFullTree: boolean;
|
|
192
187
|
}
|
|
193
188
|
|
|
194
189
|
/** Results of submitSummary after uploading the tree to storage. */
|
|
195
190
|
export interface IUploadSummaryResult extends Omit<IGenerateSummaryTreeResult, "stage"> {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
191
|
+
readonly stage: "upload";
|
|
192
|
+
/** The handle returned by storage pointing to the uploaded summary tree. */
|
|
193
|
+
readonly handle: string;
|
|
194
|
+
/** Time it took to upload the summary tree to storage. */
|
|
195
|
+
readonly uploadDuration: number;
|
|
201
196
|
}
|
|
202
197
|
|
|
203
198
|
/** Results of submitSummary after submitting the summarize op. */
|
|
204
199
|
export interface ISubmitSummaryOpResult extends Omit<IUploadSummaryResult, "stage" | "error"> {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
200
|
+
readonly stage: "submit";
|
|
201
|
+
/** The client sequence number of the summarize op submitted for the summary. */
|
|
202
|
+
readonly clientSequenceNumber: number;
|
|
203
|
+
/** Time it took to submit the summarize op to the broadcasting service. */
|
|
204
|
+
readonly submitOpDuration: number;
|
|
210
205
|
}
|
|
211
206
|
|
|
212
207
|
/**
|
|
@@ -226,285 +221,301 @@ export interface ISubmitSummaryOpResult extends Omit<IUploadSummaryResult, "stag
|
|
|
226
221
|
* 4. "submit" - the summarize op was submitted, and the result contains the op client sequence number.
|
|
227
222
|
*/
|
|
228
223
|
export type SubmitSummaryResult =
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
224
|
+
| IBaseSummarizeResult
|
|
225
|
+
| IGenerateSummaryTreeResult
|
|
226
|
+
| IUploadSummaryResult
|
|
227
|
+
| ISubmitSummaryOpResult;
|
|
233
228
|
|
|
234
229
|
export interface IBroadcastSummaryResult {
|
|
235
|
-
|
|
236
|
-
|
|
230
|
+
readonly summarizeOp: ISummaryOpMessage;
|
|
231
|
+
readonly broadcastDuration: number;
|
|
237
232
|
}
|
|
238
233
|
|
|
239
234
|
export interface IAckSummaryResult {
|
|
240
|
-
|
|
241
|
-
|
|
235
|
+
readonly summaryAckOp: ISummaryAckMessage;
|
|
236
|
+
readonly ackNackDuration: number;
|
|
242
237
|
}
|
|
243
238
|
|
|
244
239
|
export interface INackSummaryResult {
|
|
245
|
-
|
|
246
|
-
|
|
240
|
+
readonly summaryNackOp: ISummaryNackMessage;
|
|
241
|
+
readonly ackNackDuration: number;
|
|
247
242
|
}
|
|
248
243
|
|
|
249
|
-
export type SummarizeResultPart<TSuccess, TFailure = undefined> =
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
244
|
+
export type SummarizeResultPart<TSuccess, TFailure = undefined> =
|
|
245
|
+
| {
|
|
246
|
+
success: true;
|
|
247
|
+
data: TSuccess;
|
|
248
|
+
}
|
|
249
|
+
| {
|
|
250
|
+
success: false;
|
|
251
|
+
data: TFailure | undefined;
|
|
252
|
+
message: string;
|
|
253
|
+
error: any;
|
|
254
|
+
retryAfterSeconds?: number;
|
|
255
|
+
};
|
|
259
256
|
|
|
260
257
|
export interface ISummarizeResults {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
258
|
+
/** Resolves when we generate, upload, and submit the summary. */
|
|
259
|
+
readonly summarySubmitted: Promise<SummarizeResultPart<SubmitSummaryResult>>;
|
|
260
|
+
/** Resolves when we observe our summarize op broadcast. */
|
|
261
|
+
readonly summaryOpBroadcasted: Promise<SummarizeResultPart<IBroadcastSummaryResult>>;
|
|
262
|
+
/** Resolves when we receive a summaryAck or summaryNack. */
|
|
263
|
+
readonly receivedSummaryAckOrNack: Promise<
|
|
264
|
+
SummarizeResultPart<IAckSummaryResult, INackSummaryResult>
|
|
265
|
+
>;
|
|
267
266
|
}
|
|
268
267
|
|
|
269
|
-
export type EnqueueSummarizeResult =
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
268
|
+
export type EnqueueSummarizeResult =
|
|
269
|
+
| (ISummarizeResults & {
|
|
270
|
+
/**
|
|
271
|
+
* Indicates that another summarize attempt is not already enqueued,
|
|
272
|
+
* and this attempt has been enqueued.
|
|
273
|
+
*/
|
|
274
|
+
readonly alreadyEnqueued?: undefined;
|
|
275
|
+
})
|
|
276
|
+
| (ISummarizeResults & {
|
|
277
|
+
/** Indicates that another summarize attempt was already enqueued. */
|
|
278
|
+
readonly alreadyEnqueued: true;
|
|
279
|
+
/**
|
|
280
|
+
* Indicates that the other enqueued summarize attempt was abandoned,
|
|
281
|
+
* and this attempt has been enqueued enqueued.
|
|
282
|
+
*/
|
|
283
|
+
readonly overridden: true;
|
|
284
|
+
})
|
|
285
|
+
| {
|
|
286
|
+
/** Indicates that another summarize attempt was already enqueued. */
|
|
287
|
+
readonly alreadyEnqueued: true;
|
|
288
|
+
/**
|
|
289
|
+
* Indicates that the other enqueued summarize attempt remains enqueued,
|
|
290
|
+
* and this attempt has not been enqueued.
|
|
291
|
+
*/
|
|
292
|
+
readonly overridden?: undefined;
|
|
293
|
+
};
|
|
292
294
|
|
|
293
295
|
export type SummarizerStopReason =
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
296
|
+
/** Summarizer client failed to summarize in all 3 consecutive attempts. */
|
|
297
|
+
| "failToSummarize"
|
|
298
|
+
/** Parent client reported that it is no longer connected. */
|
|
299
|
+
| "parentNotConnected"
|
|
300
|
+
/**
|
|
301
|
+
* Parent client reported that it is no longer elected the summarizer.
|
|
302
|
+
* This is the normal flow; a disconnect will always trigger the parent
|
|
303
|
+
* client to no longer be elected as responsible for summaries. Then it
|
|
304
|
+
* tries to stop its spawned summarizer client.
|
|
305
|
+
*/
|
|
306
|
+
| "notElectedParent"
|
|
307
|
+
/**
|
|
308
|
+
* We are not already running the summarizer and we are not the current elected client id.
|
|
309
|
+
*/
|
|
310
|
+
| "notElectedClient"
|
|
311
|
+
/** Summarizer client was disconnected */
|
|
312
|
+
| "summarizerClientDisconnected"
|
|
313
|
+
/* running summarizer threw an exception */
|
|
314
|
+
| "summarizerException";
|
|
313
315
|
|
|
314
316
|
export interface ISummarizerEvents extends IEvent {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
317
|
+
/**
|
|
318
|
+
* An event indicating that the Summarizer is having problems summarizing
|
|
319
|
+
*/
|
|
320
|
+
(event: "summarizingError", listener: (error: ISummarizingWarning) => void);
|
|
319
321
|
}
|
|
320
322
|
|
|
321
|
-
export interface ISummarizer
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
323
|
+
export interface ISummarizer
|
|
324
|
+
extends IEventProvider<ISummarizerEvents>,
|
|
325
|
+
IFluidLoadable,
|
|
326
|
+
Partial<IProvideSummarizer> {
|
|
327
|
+
/*
|
|
328
|
+
* Asks summarizer to move to exit.
|
|
329
|
+
* Summarizer will finish current processes, which may take a while.
|
|
330
|
+
* For example, summarizer may complete last summary before exiting.
|
|
331
|
+
*/
|
|
332
|
+
stop(reason: SummarizerStopReason): void;
|
|
333
|
+
|
|
334
|
+
/* Closes summarizer. Any pending processes (summary in flight) are abandoned. */
|
|
335
|
+
close(): void;
|
|
336
|
+
|
|
337
|
+
run(onBehalfOf: string, disableHeuristics?: boolean): Promise<SummarizerStopReason>;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Attempts to generate a summary on demand. If already running, takes no action.
|
|
341
|
+
* @param options - options controlling the summarize attempt
|
|
342
|
+
* @returns an alreadyRunning promise if a summarize attempt is already in progress,
|
|
343
|
+
* which will resolve when the current attempt completes. At that point caller can
|
|
344
|
+
* decide to try again or not. Otherwise, it will return an object containing promises
|
|
345
|
+
* that resolve as the summarize attempt progresses. They will resolve with success
|
|
346
|
+
* false if a failure is encountered.
|
|
347
|
+
*/
|
|
348
|
+
summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults;
|
|
349
|
+
/**
|
|
350
|
+
* Enqueue an attempt to summarize after the specified sequence number.
|
|
351
|
+
* If afterSequenceNumber is provided, the summarize attempt is "enqueued"
|
|
352
|
+
* to run once an eligible op comes in with sequenceNumber \>= afterSequenceNumber.
|
|
353
|
+
* @param options - options controlling the summarize attempt
|
|
354
|
+
* @returns an object containing an alreadyEnqueued flag to indicate if another
|
|
355
|
+
* summarize attempt has already been enqueued. It also may contain an overridden flag
|
|
356
|
+
* when alreadyEnqueued is true, that indicates whether this attempt forced the
|
|
357
|
+
* previous attempt to abort. If this attempt becomes enqueued, it returns an object
|
|
358
|
+
* containing promises that resolve as the summarize attempt progresses. They will
|
|
359
|
+
* resolve with success false if a failure is encountered.
|
|
360
|
+
*/
|
|
361
|
+
enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult;
|
|
358
362
|
}
|
|
359
363
|
|
|
360
364
|
/** Data about an attempt to summarize used for heuristics. */
|
|
361
365
|
export interface ISummarizeAttempt {
|
|
362
|
-
|
|
363
|
-
|
|
366
|
+
/** Reference sequence number when summary was generated or attempted */
|
|
367
|
+
readonly refSequenceNumber: number;
|
|
364
368
|
|
|
365
|
-
|
|
366
|
-
|
|
369
|
+
/** Time of summary attempt after it was sent or attempted */
|
|
370
|
+
readonly summaryTime: number;
|
|
367
371
|
|
|
368
|
-
|
|
369
|
-
|
|
372
|
+
/** Sequence number of summary op */
|
|
373
|
+
summarySequenceNumber?: number;
|
|
370
374
|
}
|
|
371
375
|
|
|
372
376
|
/** Data relevant for summary heuristics. */
|
|
373
377
|
export interface ISummarizeHeuristicData {
|
|
374
|
-
|
|
375
|
-
|
|
378
|
+
/** Latest received op sequence number */
|
|
379
|
+
lastOpSequenceNumber: number;
|
|
376
380
|
|
|
377
|
-
|
|
378
|
-
|
|
381
|
+
/** Most recent summary attempt from this client */
|
|
382
|
+
readonly lastAttempt: ISummarizeAttempt;
|
|
379
383
|
|
|
380
|
-
|
|
381
|
-
|
|
384
|
+
/** Most recent summary that received an ack */
|
|
385
|
+
readonly lastSuccessfulSummary: Readonly<ISummarizeAttempt>;
|
|
382
386
|
|
|
383
|
-
|
|
384
|
-
|
|
387
|
+
/** Number of runtime ops since last summary */
|
|
388
|
+
numRuntimeOps: number;
|
|
385
389
|
|
|
386
|
-
|
|
387
|
-
|
|
390
|
+
/** Number of non-runtime ops since last summary */
|
|
391
|
+
numNonRuntimeOps: number;
|
|
388
392
|
|
|
389
|
-
|
|
390
|
-
|
|
393
|
+
/** Cumulative size in bytes of all the ops since the last summary */
|
|
394
|
+
totalOpsSize: number;
|
|
391
395
|
|
|
392
|
-
|
|
393
|
-
|
|
396
|
+
/** Wether or not this instance contains adjusted metrics due to missing op data */
|
|
397
|
+
hasMissingOpData: boolean;
|
|
394
398
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
399
|
+
/**
|
|
400
|
+
* Updates lastAttempt and lastSuccessfulAttempt based on the last summary.
|
|
401
|
+
* @param lastSummary - last ack summary
|
|
402
|
+
*/
|
|
403
|
+
updateWithLastSummaryAckInfo(lastSummary: ISummarizeAttempt): void;
|
|
400
404
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
405
|
+
/**
|
|
406
|
+
* Records a summary attempt. If the attempt was successfully sent,
|
|
407
|
+
* provide the reference sequence number, otherwise it will be set
|
|
408
|
+
* to the last seen op sequence number.
|
|
409
|
+
* @param referenceSequenceNumber - reference sequence number of sent summary
|
|
410
|
+
*/
|
|
411
|
+
recordAttempt(referenceSequenceNumber?: number): void;
|
|
408
412
|
|
|
409
|
-
|
|
410
|
-
|
|
413
|
+
/** Mark that the last sent summary attempt has received an ack */
|
|
414
|
+
markLastAttemptAsSuccessful(): void;
|
|
411
415
|
}
|
|
412
416
|
|
|
413
417
|
/** Responsible for running heuristics determining when to summarize. */
|
|
414
418
|
export interface ISummarizeHeuristicRunner {
|
|
415
|
-
|
|
416
|
-
|
|
419
|
+
/** Start specific heuristic trackers (ex: idle timer) */
|
|
420
|
+
start(): void;
|
|
417
421
|
|
|
418
|
-
|
|
419
|
-
|
|
422
|
+
/** Runs the heuristics to determine if it should try to summarize */
|
|
423
|
+
run(): void;
|
|
420
424
|
|
|
421
|
-
|
|
422
|
-
|
|
425
|
+
/** Runs a different heuristic to check if it should summarize before closing */
|
|
426
|
+
shouldRunLastSummary(): boolean;
|
|
423
427
|
|
|
424
|
-
|
|
425
|
-
|
|
428
|
+
/** Disposes of resources */
|
|
429
|
+
dispose(): void;
|
|
426
430
|
}
|
|
427
431
|
|
|
428
432
|
type ISummarizeTelemetryRequiredProperties =
|
|
429
|
-
|
|
430
|
-
|
|
433
|
+
/** Reason code for attempting to summarize */
|
|
434
|
+
"reason";
|
|
431
435
|
|
|
432
436
|
type ISummarizeTelemetryOptionalProperties =
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
export type ISummarizeTelemetryProperties =
|
|
442
|
-
|
|
443
|
-
|
|
437
|
+
/** Number of attempts within the last time window, used for calculating the throttle delay. */
|
|
438
|
+
| "summaryAttempts"
|
|
439
|
+
/** Number of attempts within the current phase (currently capped at 2 ) */
|
|
440
|
+
| "summaryAttemptsPerPhase"
|
|
441
|
+
/** One-based count of phases we've attempted (used to index into an array of ISummarizeOptions */
|
|
442
|
+
| "summaryAttemptPhase"
|
|
443
|
+
| keyof ISummarizeOptions;
|
|
444
|
+
|
|
445
|
+
export type ISummarizeTelemetryProperties = Pick<
|
|
446
|
+
ITelemetryProperties,
|
|
447
|
+
ISummarizeTelemetryRequiredProperties
|
|
448
|
+
> &
|
|
449
|
+
Partial<Pick<ITelemetryProperties, ISummarizeTelemetryOptionalProperties>>;
|
|
444
450
|
|
|
445
451
|
/** Strategy used to heuristically determine when we should run a summary */
|
|
446
452
|
export interface ISummaryHeuristicStrategy {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
453
|
+
/** Summarize reason for this summarize heuristic strategy (ex: "maxTime") */
|
|
454
|
+
summarizeReason: Readonly<SummarizeReason>;
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Determines if this strategy's summarize criteria been met
|
|
458
|
+
* @param configuration - summary configuration we are to check against
|
|
459
|
+
* @param heuristicData - heuristic data used to confirm conditions are met
|
|
460
|
+
*/
|
|
461
|
+
shouldRunSummary(
|
|
462
|
+
configuration: ISummaryConfigurationHeuristics,
|
|
463
|
+
heuristicData: ISummarizeHeuristicData,
|
|
464
|
+
): boolean;
|
|
456
465
|
}
|
|
457
466
|
|
|
458
467
|
type SummaryGeneratorRequiredTelemetryProperties =
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
468
|
+
/** True to generate the full tree with no handle reuse optimizations */
|
|
469
|
+
| "fullTree"
|
|
470
|
+
/** Time since we last attempted to generate a summary */
|
|
471
|
+
| "timeSinceLastAttempt"
|
|
472
|
+
/** Time since we last successfully generated a summary */
|
|
473
|
+
| "timeSinceLastSummary";
|
|
465
474
|
|
|
466
475
|
type SummaryGeneratorOptionalTelemetryProperties =
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
export type SummaryGeneratorTelemetry =
|
|
502
|
-
|
|
503
|
-
|
|
476
|
+
/** Reference sequence number as of the generate summary attempt. */
|
|
477
|
+
| "referenceSequenceNumber"
|
|
478
|
+
/** minimum sequence number (at the reference sequence number) */
|
|
479
|
+
| "minimumSequenceNumber"
|
|
480
|
+
/** Delta between the current reference sequence number and the reference sequence number of the last attempt */
|
|
481
|
+
| "opsSinceLastAttempt"
|
|
482
|
+
/** Delta between the current reference sequence number and the reference sequence number of the last summary */
|
|
483
|
+
| "opsSinceLastSummary"
|
|
484
|
+
/**
|
|
485
|
+
* Delta in sum of op sizes between the current reference sequence number and the reference
|
|
486
|
+
* sequence number of the last summary
|
|
487
|
+
*/
|
|
488
|
+
| "opsSizesSinceLastSummary"
|
|
489
|
+
/** Delta between the number of non-runtime ops since the last summary */
|
|
490
|
+
| "nonRuntimeOpsSinceLastSummary"
|
|
491
|
+
/** Wether or not this instance contains adjusted metrics due to missing op data */
|
|
492
|
+
| "hasMissingOpData"
|
|
493
|
+
/** Time it took to generate the summary tree and stats. */
|
|
494
|
+
| "generateDuration"
|
|
495
|
+
/** The handle returned by storage pointing to the uploaded summary tree. */
|
|
496
|
+
| "handle"
|
|
497
|
+
/** Time it took to upload the summary tree to storage. */
|
|
498
|
+
| "uploadDuration"
|
|
499
|
+
/** The client sequence number of the summarize op submitted for the summary. */
|
|
500
|
+
| "clientSequenceNumber"
|
|
501
|
+
/** Time it took for this summary to be acked after it was generated */
|
|
502
|
+
| "ackWaitDuration"
|
|
503
|
+
/** Reference sequence number of the ack/nack message */
|
|
504
|
+
| "ackNackSequenceNumber"
|
|
505
|
+
/** Actual sequence number of the summary op proposal. */
|
|
506
|
+
| "summarySequenceNumber"
|
|
507
|
+
/** Optional Retry-After time in seconds. If specified, the client should wait this many seconds before retrying. */
|
|
508
|
+
| "nackRetryAfter";
|
|
509
|
+
|
|
510
|
+
export type SummaryGeneratorTelemetry = Pick<
|
|
511
|
+
ITelemetryProperties,
|
|
512
|
+
SummaryGeneratorRequiredTelemetryProperties
|
|
513
|
+
> &
|
|
514
|
+
Partial<Pick<ITelemetryProperties, SummaryGeneratorOptionalTelemetryProperties>>;
|
|
504
515
|
|
|
505
516
|
export interface ISummarizeRunnerTelemetry extends ITelemetryLoggerPropertyBag {
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
517
|
+
/** Number of times the summarizer run. */
|
|
518
|
+
summarizeCount: () => number;
|
|
519
|
+
/** Number of successful attempts to summarize. */
|
|
520
|
+
summarizerSuccessfulAttempts: () => number;
|
|
510
521
|
}
|