@fluidframework/container-runtime 2.0.0-internal.3.0.5 → 2.0.0-internal.3.1.1
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 +11 -1
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +116 -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 -13
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +68 -55
- 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 +33 -14
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +178 -92
- package/dist/garbageCollection.js.map +1 -1
- package/dist/garbageCollectionConstants.d.ts +1 -0
- package/dist/garbageCollectionConstants.d.ts.map +1 -1
- package/dist/garbageCollectionConstants.js +4 -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 +0 -4
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +7 -43
- 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 +20 -19
- 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 +5 -2
- 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 +35 -16
- 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 +11 -1
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +122 -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 -13
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +71 -58
- 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 +33 -14
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +180 -94
- package/lib/garbageCollection.js.map +1 -1
- package/lib/garbageCollectionConstants.d.ts +1 -0
- package/lib/garbageCollectionConstants.d.ts.map +1 -1
- package/lib/garbageCollectionConstants.js +3 -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 +0 -4
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +7 -43
- 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 +20 -19
- 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 +5 -2
- 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 +35 -16
- 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 -115
- 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 -2988
- package/src/dataStore.ts +172 -159
- package/src/dataStoreContext.ts +1098 -1055
- 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 +1860 -1688
- package/src/garbageCollectionConstants.ts +3 -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 -128
- package/src/opLifecycle/opSplitter.ts +214 -188
- package/src/opLifecycle/outbox.ts +204 -195
- 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 +165 -143
- package/src/summaryGenerator.ts +465 -410
- 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
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,106 +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
|
-
|
|
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;
|
|
99
97
|
}
|
|
100
98
|
|
|
101
99
|
/** Options affecting summarize behavior. */
|
|
102
100
|
export interface ISummarizeOptions {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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;
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
/**
|
|
110
108
|
* Data required to update internal tracking state after receiving a Summary Ack.
|
|
111
109
|
*/
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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;
|
|
121
119
|
}
|
|
122
120
|
|
|
123
121
|
export interface ISubmitSummaryOptions extends ISummarizeOptions {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
/** Logger to use for correlated summary events */
|
|
123
|
+
readonly summaryLogger: ITelemetryLogger;
|
|
124
|
+
/** Tells when summary process should be cancelled */
|
|
125
|
+
readonly cancellationToken: ISummaryCancellationToken;
|
|
128
126
|
}
|
|
129
127
|
|
|
130
128
|
export interface IOnDemandSummarizeOptions extends ISummarizeOptions {
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
/** Reason for generating summary. */
|
|
130
|
+
readonly reason: string;
|
|
133
131
|
}
|
|
134
132
|
|
|
135
133
|
/** Options to use when enqueueing a summarize attempt. */
|
|
136
134
|
export interface IEnqueueSummarizeOptions extends IOnDemandSummarizeOptions {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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;
|
|
147
145
|
}
|
|
148
146
|
|
|
149
147
|
/**
|
|
@@ -151,59 +149,59 @@ export interface IEnqueueSummarizeOptions extends IOnDemandSummarizeOptions {
|
|
|
151
149
|
* only relevant at the root of the tree.
|
|
152
150
|
*/
|
|
153
151
|
export interface IGeneratedSummaryStats extends ISummaryStats {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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;
|
|
166
164
|
}
|
|
167
165
|
|
|
168
166
|
/** Base results for all submitSummary attempts. */
|
|
169
167
|
export interface IBaseSummarizeResult {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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;
|
|
176
174
|
}
|
|
177
175
|
|
|
178
176
|
/** Results of submitSummary after generating the summary tree. */
|
|
179
177
|
export interface IGenerateSummaryTreeResult extends Omit<IBaseSummarizeResult, "stage"> {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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;
|
|
189
187
|
}
|
|
190
188
|
|
|
191
189
|
/** Results of submitSummary after uploading the tree to storage. */
|
|
192
190
|
export interface IUploadSummaryResult extends Omit<IGenerateSummaryTreeResult, "stage"> {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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;
|
|
198
196
|
}
|
|
199
197
|
|
|
200
198
|
/** Results of submitSummary after submitting the summarize op. */
|
|
201
199
|
export interface ISubmitSummaryOpResult extends Omit<IUploadSummaryResult, "stage" | "error"> {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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;
|
|
207
205
|
}
|
|
208
206
|
|
|
209
207
|
/**
|
|
@@ -223,285 +221,301 @@ export interface ISubmitSummaryOpResult extends Omit<IUploadSummaryResult, "stag
|
|
|
223
221
|
* 4. "submit" - the summarize op was submitted, and the result contains the op client sequence number.
|
|
224
222
|
*/
|
|
225
223
|
export type SubmitSummaryResult =
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
224
|
+
| IBaseSummarizeResult
|
|
225
|
+
| IGenerateSummaryTreeResult
|
|
226
|
+
| IUploadSummaryResult
|
|
227
|
+
| ISubmitSummaryOpResult;
|
|
230
228
|
|
|
231
229
|
export interface IBroadcastSummaryResult {
|
|
232
|
-
|
|
233
|
-
|
|
230
|
+
readonly summarizeOp: ISummaryOpMessage;
|
|
231
|
+
readonly broadcastDuration: number;
|
|
234
232
|
}
|
|
235
233
|
|
|
236
234
|
export interface IAckSummaryResult {
|
|
237
|
-
|
|
238
|
-
|
|
235
|
+
readonly summaryAckOp: ISummaryAckMessage;
|
|
236
|
+
readonly ackNackDuration: number;
|
|
239
237
|
}
|
|
240
238
|
|
|
241
239
|
export interface INackSummaryResult {
|
|
242
|
-
|
|
243
|
-
|
|
240
|
+
readonly summaryNackOp: ISummaryNackMessage;
|
|
241
|
+
readonly ackNackDuration: number;
|
|
244
242
|
}
|
|
245
243
|
|
|
246
|
-
export type SummarizeResultPart<TSuccess, TFailure = undefined> =
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
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
|
+
};
|
|
256
256
|
|
|
257
257
|
export interface ISummarizeResults {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
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
|
+
>;
|
|
264
266
|
}
|
|
265
267
|
|
|
266
|
-
export type EnqueueSummarizeResult =
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
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
|
+
};
|
|
289
294
|
|
|
290
295
|
export type SummarizerStopReason =
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
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";
|
|
310
315
|
|
|
311
316
|
export interface ISummarizerEvents extends IEvent {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
317
|
+
/**
|
|
318
|
+
* An event indicating that the Summarizer is having problems summarizing
|
|
319
|
+
*/
|
|
320
|
+
(event: "summarizingError", listener: (error: ISummarizingWarning) => void);
|
|
316
321
|
}
|
|
317
322
|
|
|
318
|
-
export interface ISummarizer
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
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
|
-
|
|
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;
|
|
355
362
|
}
|
|
356
363
|
|
|
357
364
|
/** Data about an attempt to summarize used for heuristics. */
|
|
358
365
|
export interface ISummarizeAttempt {
|
|
359
|
-
|
|
360
|
-
|
|
366
|
+
/** Reference sequence number when summary was generated or attempted */
|
|
367
|
+
readonly refSequenceNumber: number;
|
|
361
368
|
|
|
362
|
-
|
|
363
|
-
|
|
369
|
+
/** Time of summary attempt after it was sent or attempted */
|
|
370
|
+
readonly summaryTime: number;
|
|
364
371
|
|
|
365
|
-
|
|
366
|
-
|
|
372
|
+
/** Sequence number of summary op */
|
|
373
|
+
summarySequenceNumber?: number;
|
|
367
374
|
}
|
|
368
375
|
|
|
369
376
|
/** Data relevant for summary heuristics. */
|
|
370
377
|
export interface ISummarizeHeuristicData {
|
|
371
|
-
|
|
372
|
-
|
|
378
|
+
/** Latest received op sequence number */
|
|
379
|
+
lastOpSequenceNumber: number;
|
|
373
380
|
|
|
374
|
-
|
|
375
|
-
|
|
381
|
+
/** Most recent summary attempt from this client */
|
|
382
|
+
readonly lastAttempt: ISummarizeAttempt;
|
|
376
383
|
|
|
377
|
-
|
|
378
|
-
|
|
384
|
+
/** Most recent summary that received an ack */
|
|
385
|
+
readonly lastSuccessfulSummary: Readonly<ISummarizeAttempt>;
|
|
379
386
|
|
|
380
|
-
|
|
381
|
-
|
|
387
|
+
/** Number of runtime ops since last summary */
|
|
388
|
+
numRuntimeOps: number;
|
|
382
389
|
|
|
383
|
-
|
|
384
|
-
|
|
390
|
+
/** Number of non-runtime ops since last summary */
|
|
391
|
+
numNonRuntimeOps: number;
|
|
385
392
|
|
|
386
|
-
|
|
387
|
-
|
|
393
|
+
/** Cumulative size in bytes of all the ops since the last summary */
|
|
394
|
+
totalOpsSize: number;
|
|
388
395
|
|
|
389
|
-
|
|
390
|
-
|
|
396
|
+
/** Wether or not this instance contains adjusted metrics due to missing op data */
|
|
397
|
+
hasMissingOpData: boolean;
|
|
391
398
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
399
|
+
/**
|
|
400
|
+
* Updates lastAttempt and lastSuccessfulAttempt based on the last summary.
|
|
401
|
+
* @param lastSummary - last ack summary
|
|
402
|
+
*/
|
|
403
|
+
updateWithLastSummaryAckInfo(lastSummary: ISummarizeAttempt): void;
|
|
397
404
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
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;
|
|
405
412
|
|
|
406
|
-
|
|
407
|
-
|
|
413
|
+
/** Mark that the last sent summary attempt has received an ack */
|
|
414
|
+
markLastAttemptAsSuccessful(): void;
|
|
408
415
|
}
|
|
409
416
|
|
|
410
417
|
/** Responsible for running heuristics determining when to summarize. */
|
|
411
418
|
export interface ISummarizeHeuristicRunner {
|
|
412
|
-
|
|
413
|
-
|
|
419
|
+
/** Start specific heuristic trackers (ex: idle timer) */
|
|
420
|
+
start(): void;
|
|
414
421
|
|
|
415
|
-
|
|
416
|
-
|
|
422
|
+
/** Runs the heuristics to determine if it should try to summarize */
|
|
423
|
+
run(): void;
|
|
417
424
|
|
|
418
|
-
|
|
419
|
-
|
|
425
|
+
/** Runs a different heuristic to check if it should summarize before closing */
|
|
426
|
+
shouldRunLastSummary(): boolean;
|
|
420
427
|
|
|
421
|
-
|
|
422
|
-
|
|
428
|
+
/** Disposes of resources */
|
|
429
|
+
dispose(): void;
|
|
423
430
|
}
|
|
424
431
|
|
|
425
432
|
type ISummarizeTelemetryRequiredProperties =
|
|
426
|
-
|
|
427
|
-
|
|
433
|
+
/** Reason code for attempting to summarize */
|
|
434
|
+
"reason";
|
|
428
435
|
|
|
429
436
|
type ISummarizeTelemetryOptionalProperties =
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
export type ISummarizeTelemetryProperties =
|
|
439
|
-
|
|
440
|
-
|
|
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>>;
|
|
441
450
|
|
|
442
451
|
/** Strategy used to heuristically determine when we should run a summary */
|
|
443
452
|
export interface ISummaryHeuristicStrategy {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
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;
|
|
453
465
|
}
|
|
454
466
|
|
|
455
467
|
type SummaryGeneratorRequiredTelemetryProperties =
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
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";
|
|
462
474
|
|
|
463
475
|
type SummaryGeneratorOptionalTelemetryProperties =
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
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
|
-
export type SummaryGeneratorTelemetry =
|
|
499
|
-
|
|
500
|
-
|
|
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>>;
|
|
501
515
|
|
|
502
516
|
export interface ISummarizeRunnerTelemetry extends ITelemetryLoggerPropertyBag {
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
517
|
+
/** Number of times the summarizer run. */
|
|
518
|
+
summarizeCount: () => number;
|
|
519
|
+
/** Number of successful attempts to summarize. */
|
|
520
|
+
summarizerSuccessfulAttempts: () => number;
|
|
507
521
|
}
|