@fluidframework/container-runtime 2.23.0-325054 → 2.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -0
- package/api-report/container-runtime.legacy.alpha.api.md +0 -246
- package/dist/blobManager/blobManager.d.ts +11 -9
- package/dist/blobManager/blobManager.d.ts.map +1 -1
- package/dist/blobManager/blobManager.js +38 -39
- package/dist/blobManager/blobManager.js.map +1 -1
- package/dist/blobManager/blobManagerSnapSum.d.ts +2 -4
- package/dist/blobManager/blobManagerSnapSum.d.ts.map +1 -1
- package/dist/blobManager/blobManagerSnapSum.js +6 -6
- package/dist/blobManager/blobManagerSnapSum.js.map +1 -1
- package/dist/channelCollection.d.ts +1 -7
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +1 -26
- package/dist/channelCollection.js.map +1 -1
- package/dist/connectionTelemetry.d.ts +0 -43
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +21 -141
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +49 -290
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +0 -13
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +2 -25
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +2 -20
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +0 -2
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +8 -24
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +1 -3
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +1 -4
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +0 -1
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +4 -16
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +0 -29
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/signalTelemetryProcessing.d.ts +33 -0
- package/dist/signalTelemetryProcessing.d.ts.map +1 -0
- package/dist/signalTelemetryProcessing.js +149 -0
- package/dist/signalTelemetryProcessing.js.map +1 -0
- package/dist/summary/documentSchema.d.ts +7 -31
- package/dist/summary/documentSchema.d.ts.map +1 -1
- package/dist/summary/documentSchema.js +2 -18
- package/dist/summary/documentSchema.js.map +1 -1
- package/dist/summary/index.d.ts +2 -1
- package/dist/summary/index.d.ts.map +1 -1
- package/dist/summary/index.js +7 -1
- package/dist/summary/index.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +1 -3
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts +1 -3
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js +2 -7
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +1 -2
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +4 -23
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +2 -5
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +3 -11
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts.map +1 -1
- package/dist/summary/summarizerClientElection.js +0 -1
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.d.ts +1 -1
- package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +109 -22
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +3 -9
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +3 -9
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryHelpers.d.ts +19 -0
- package/dist/summary/summaryHelpers.d.ts.map +1 -0
- package/dist/summary/summaryHelpers.js +90 -0
- package/dist/summary/summaryHelpers.js.map +1 -0
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +0 -2
- package/dist/summary/summaryManager.js.map +1 -1
- package/lib/blobManager/blobManager.d.ts +11 -9
- package/lib/blobManager/blobManager.d.ts.map +1 -1
- package/lib/blobManager/blobManager.js +37 -37
- package/lib/blobManager/blobManager.js.map +1 -1
- package/lib/blobManager/blobManagerSnapSum.d.ts +2 -4
- package/lib/blobManager/blobManagerSnapSum.d.ts.map +1 -1
- package/lib/blobManager/blobManagerSnapSum.js +6 -6
- package/lib/blobManager/blobManagerSnapSum.js.map +1 -1
- package/lib/channelCollection.d.ts +1 -7
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +2 -29
- package/lib/channelCollection.js.map +1 -1
- package/lib/connectionTelemetry.d.ts +0 -43
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +21 -141
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +51 -298
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +0 -13
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +2 -25
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +3 -23
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +0 -2
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +8 -24
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +1 -3
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +1 -4
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js +0 -1
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +5 -19
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +0 -29
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/signalTelemetryProcessing.d.ts +33 -0
- package/lib/signalTelemetryProcessing.d.ts.map +1 -0
- package/lib/signalTelemetryProcessing.js +145 -0
- package/lib/signalTelemetryProcessing.js.map +1 -0
- package/lib/summary/documentSchema.d.ts +7 -31
- package/lib/summary/documentSchema.d.ts.map +1 -1
- package/lib/summary/documentSchema.js +2 -18
- package/lib/summary/documentSchema.js.map +1 -1
- package/lib/summary/index.d.ts +2 -1
- package/lib/summary/index.d.ts.map +1 -1
- package/lib/summary/index.js +1 -0
- package/lib/summary/index.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +1 -3
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts +1 -3
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js +2 -7
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts +1 -2
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +4 -23
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +2 -5
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +3 -11
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts.map +1 -1
- package/lib/summary/summarizerClientElection.js +0 -1
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.d.ts +1 -1
- package/lib/summary/summarizerHeuristics.d.ts.map +1 -1
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +109 -22
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +3 -9
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +3 -9
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryHelpers.d.ts +19 -0
- package/lib/summary/summaryHelpers.d.ts.map +1 -0
- package/lib/summary/summaryHelpers.js +84 -0
- package/lib/summary/summaryHelpers.js.map +1 -0
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +0 -2
- package/lib/summary/summaryManager.js.map +1 -1
- package/package.json +27 -20
- package/src/blobManager/blobManager.ts +70 -62
- package/src/blobManager/blobManagerSnapSum.ts +7 -9
- package/src/channelCollection.ts +3 -31
- package/src/connectionTelemetry.ts +0 -51
- package/src/containerRuntime.ts +111 -522
- package/src/dataStoreContext.ts +2 -32
- package/src/gc/garbageCollection.ts +9 -26
- package/src/gc/gcConfigs.ts +3 -6
- package/src/gc/gcDefinitions.ts +10 -28
- package/src/gc/gcHelpers.ts +0 -5
- package/src/gc/gcSummaryStateTracker.ts +1 -2
- package/src/gc/gcTelemetry.ts +6 -13
- package/src/index.ts +6 -6
- package/src/messageTypes.ts +0 -2
- package/src/packageVersion.ts +1 -1
- package/src/signalTelemetryProcessing.ts +233 -0
- package/src/summary/documentSchema.ts +7 -38
- package/src/summary/index.ts +12 -0
- package/src/summary/orderedClientElection.ts +1 -3
- package/src/summary/runWhileConnectedCoordinator.ts +3 -8
- package/src/summary/runningSummarizer.ts +12 -20
- package/src/summary/summarizer.ts +6 -18
- package/src/summary/summarizerClientElection.ts +0 -2
- package/src/summary/summarizerHeuristics.ts +1 -2
- package/src/summary/summarizerTypes.ts +119 -23
- package/src/summary/summaryFormat.ts +4 -13
- package/src/summary/summaryGenerator.ts +1 -8
- package/src/summary/summaryHelpers.ts +118 -0
- package/src/summary/summaryManager.ts +0 -2
|
@@ -27,8 +27,6 @@ import {
|
|
|
27
27
|
ITelemetryLoggerPropertyBag,
|
|
28
28
|
} from "@fluidframework/telemetry-utils/internal";
|
|
29
29
|
|
|
30
|
-
import { ISummaryConfigurationHeuristics } from "../containerRuntime.js";
|
|
31
|
-
|
|
32
30
|
import {
|
|
33
31
|
ISummaryAckMessage,
|
|
34
32
|
ISummaryNackMessage,
|
|
@@ -39,9 +37,7 @@ import { SummarizeReason } from "./summaryGenerator.js";
|
|
|
39
37
|
/**
|
|
40
38
|
* Similar to AbortSignal, but using promise instead of events
|
|
41
39
|
* @param T - cancellation reason type
|
|
42
|
-
* @
|
|
43
|
-
* @alpha
|
|
44
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
40
|
+
* @internal
|
|
45
41
|
*/
|
|
46
42
|
export interface ICancellationToken<T> {
|
|
47
43
|
/**
|
|
@@ -57,17 +53,13 @@ export interface ICancellationToken<T> {
|
|
|
57
53
|
|
|
58
54
|
/**
|
|
59
55
|
* Similar to AbortSignal, but using promise instead of events
|
|
60
|
-
* @
|
|
61
|
-
* @alpha
|
|
62
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
56
|
+
* @internal
|
|
63
57
|
*/
|
|
64
58
|
export type ISummaryCancellationToken = ICancellationToken<SummarizerStopReason>;
|
|
65
59
|
|
|
66
60
|
/**
|
|
67
61
|
* Data required to update internal tracking state after receiving a Summary Ack.
|
|
68
|
-
* @
|
|
69
|
-
* @alpha
|
|
70
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
62
|
+
* @internal
|
|
71
63
|
*/
|
|
72
64
|
export interface IRefreshSummaryAckOptions {
|
|
73
65
|
/**
|
|
@@ -89,9 +81,7 @@ export interface IRefreshSummaryAckOptions {
|
|
|
89
81
|
}
|
|
90
82
|
|
|
91
83
|
/**
|
|
92
|
-
* @
|
|
93
|
-
* @alpha
|
|
94
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
84
|
+
* @internal
|
|
95
85
|
*/
|
|
96
86
|
export interface ISummarizerInternalsProvider {
|
|
97
87
|
/**
|
|
@@ -114,9 +104,7 @@ export interface ISummarizingWarning extends ContainerWarning {
|
|
|
114
104
|
}
|
|
115
105
|
|
|
116
106
|
/**
|
|
117
|
-
* @
|
|
118
|
-
* @alpha
|
|
119
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
107
|
+
* @internal
|
|
120
108
|
*/
|
|
121
109
|
export interface IConnectableRuntime {
|
|
122
110
|
readonly disposed: boolean;
|
|
@@ -126,9 +114,7 @@ export interface IConnectableRuntime {
|
|
|
126
114
|
}
|
|
127
115
|
|
|
128
116
|
/**
|
|
129
|
-
* @
|
|
130
|
-
* @alpha
|
|
131
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
117
|
+
* @internal
|
|
132
118
|
*/
|
|
133
119
|
export interface ISummarizerRuntime extends IConnectableRuntime {
|
|
134
120
|
readonly baseLogger: ITelemetryBaseLogger;
|
|
@@ -162,9 +148,7 @@ export interface ISummarizeOptions {
|
|
|
162
148
|
}
|
|
163
149
|
|
|
164
150
|
/**
|
|
165
|
-
* @
|
|
166
|
-
* @alpha
|
|
167
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
151
|
+
* @internal
|
|
168
152
|
*/
|
|
169
153
|
export interface ISubmitSummaryOptions extends ISummarizeOptions {
|
|
170
154
|
/**
|
|
@@ -773,3 +757,115 @@ export interface ISummarizeRunnerTelemetry extends ITelemetryLoggerPropertyBag {
|
|
|
773
757
|
*/
|
|
774
758
|
summarizerSuccessfulAttempts: () => number;
|
|
775
759
|
}
|
|
760
|
+
|
|
761
|
+
/**
|
|
762
|
+
* @legacy
|
|
763
|
+
* @alpha
|
|
764
|
+
*/
|
|
765
|
+
export interface ISummaryBaseConfiguration {
|
|
766
|
+
/**
|
|
767
|
+
* Delay before first attempt to spawn summarizing container.
|
|
768
|
+
*/
|
|
769
|
+
initialSummarizerDelayMs: number;
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Defines the maximum allowed time to wait for a pending summary ack.
|
|
773
|
+
* The maximum amount of time client will wait for a summarize is the minimum of
|
|
774
|
+
* maxSummarizeAckWaitTime (currently 3 * 60 * 1000) and maxAckWaitTime.
|
|
775
|
+
*/
|
|
776
|
+
maxAckWaitTime: number;
|
|
777
|
+
/**
|
|
778
|
+
* Defines the maximum number of Ops in between Summaries that can be
|
|
779
|
+
* allowed before forcibly electing a new summarizer client.
|
|
780
|
+
*/
|
|
781
|
+
maxOpsSinceLastSummary: number;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* @legacy
|
|
786
|
+
* @alpha
|
|
787
|
+
*/
|
|
788
|
+
export interface ISummaryConfigurationHeuristics extends ISummaryBaseConfiguration {
|
|
789
|
+
state: "enabled";
|
|
790
|
+
/**
|
|
791
|
+
* Defines the maximum allowed time, since the last received Ack, before running the summary
|
|
792
|
+
* with reason maxTime.
|
|
793
|
+
* For example, say we receive ops one by one just before the idle time is triggered.
|
|
794
|
+
* In this case, we still want to run a summary since it's been a while since the last summary.
|
|
795
|
+
*/
|
|
796
|
+
maxTime: number;
|
|
797
|
+
/**
|
|
798
|
+
* Defines the maximum number of Ops, since the last received Ack, that can be allowed
|
|
799
|
+
* before running the summary with reason maxOps.
|
|
800
|
+
*/
|
|
801
|
+
maxOps: number;
|
|
802
|
+
/**
|
|
803
|
+
* Defines the minimum number of Ops, since the last received Ack, that can be allowed
|
|
804
|
+
* before running the last summary.
|
|
805
|
+
*/
|
|
806
|
+
minOpsForLastSummaryAttempt: number;
|
|
807
|
+
/**
|
|
808
|
+
* Defines the lower boundary for the allowed time in between summarizations.
|
|
809
|
+
* Pairs with maxIdleTime to form a range.
|
|
810
|
+
* For example, if we only receive 1 op, we don't want to have the same idle time as say 100 ops.
|
|
811
|
+
* Based on the boundaries we set in minIdleTime and maxIdleTime, the idle time will change
|
|
812
|
+
* linearly depending on the number of ops we receive.
|
|
813
|
+
*/
|
|
814
|
+
minIdleTime: number;
|
|
815
|
+
/**
|
|
816
|
+
* Defines the upper boundary for the allowed time in between summarizations.
|
|
817
|
+
* Pairs with minIdleTime to form a range.
|
|
818
|
+
* For example, if we only receive 1 op, we don't want to have the same idle time as say 100 ops.
|
|
819
|
+
* Based on the boundaries we set in minIdleTime and maxIdleTime, the idle time will change
|
|
820
|
+
* linearly depending on the number of ops we receive.
|
|
821
|
+
*/
|
|
822
|
+
maxIdleTime: number;
|
|
823
|
+
/**
|
|
824
|
+
* Runtime op weight to use in heuristic summarizing.
|
|
825
|
+
* This number is a multiplier on the number of runtime ops we process when running summarize heuristics.
|
|
826
|
+
* For example: (multiplier) * (number of runtime ops) = weighted number of runtime ops
|
|
827
|
+
*/
|
|
828
|
+
runtimeOpWeight: number;
|
|
829
|
+
/**
|
|
830
|
+
* Non-runtime op weight to use in heuristic summarizing
|
|
831
|
+
* This number is a multiplier on the number of non-runtime ops we process when running summarize heuristics.
|
|
832
|
+
* For example: (multiplier) * (number of non-runtime ops) = weighted number of non-runtime ops
|
|
833
|
+
*/
|
|
834
|
+
nonRuntimeOpWeight: number;
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* Number of ops since last summary needed before a non-runtime op can trigger running summary heuristics.
|
|
838
|
+
*
|
|
839
|
+
* Note: Any runtime ops sent before the threshold is reached will trigger heuristics normally.
|
|
840
|
+
* This threshold ONLY applies to non-runtime ops triggering summaries.
|
|
841
|
+
*
|
|
842
|
+
* For example: Say the threshold is 20. Sending 19 non-runtime ops will not trigger any heuristic checks.
|
|
843
|
+
* Sending the 20th non-runtime op will trigger the heuristic checks for summarizing.
|
|
844
|
+
*/
|
|
845
|
+
nonRuntimeHeuristicThreshold?: number;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* @legacy
|
|
850
|
+
* @alpha
|
|
851
|
+
*/
|
|
852
|
+
export interface ISummaryConfigurationDisableSummarizer {
|
|
853
|
+
state: "disabled";
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* @legacy
|
|
858
|
+
* @alpha
|
|
859
|
+
*/
|
|
860
|
+
export interface ISummaryConfigurationDisableHeuristics extends ISummaryBaseConfiguration {
|
|
861
|
+
state: "disableHeuristics";
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* @legacy
|
|
866
|
+
* @alpha
|
|
867
|
+
*/
|
|
868
|
+
export type ISummaryConfiguration =
|
|
869
|
+
| ISummaryConfigurationDisableSummarizer
|
|
870
|
+
| ISummaryConfigurationDisableHeuristics
|
|
871
|
+
| ISummaryConfigurationHeuristics;
|
|
@@ -18,10 +18,8 @@ import {
|
|
|
18
18
|
} from "@fluidframework/runtime-definitions/internal";
|
|
19
19
|
|
|
20
20
|
import { blobsTreeName } from "../blobManager/index.js";
|
|
21
|
-
// eslint-disable-next-line import/no-deprecated
|
|
22
21
|
import { IGCMetadata } from "../gc/index.js";
|
|
23
22
|
|
|
24
|
-
// eslint-disable-next-line import/no-deprecated
|
|
25
23
|
import { IDocumentSchema } from "./documentSchema.js";
|
|
26
24
|
|
|
27
25
|
/**
|
|
@@ -127,11 +125,9 @@ export function hasIsolatedChannels(attributes: ReadFluidDataStoreAttributes): b
|
|
|
127
125
|
}
|
|
128
126
|
|
|
129
127
|
/**
|
|
130
|
-
* @
|
|
131
|
-
* @alpha
|
|
132
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
128
|
+
* @internal
|
|
133
129
|
*/
|
|
134
|
-
|
|
130
|
+
|
|
135
131
|
export interface IContainerRuntimeMetadata extends ICreateContainerMetadata, IGCMetadata {
|
|
136
132
|
readonly summaryFormatVersion: 1;
|
|
137
133
|
/**
|
|
@@ -155,14 +151,11 @@ export interface IContainerRuntimeMetadata extends ICreateContainerMetadata, IGC
|
|
|
155
151
|
*/
|
|
156
152
|
readonly telemetryDocumentId?: string;
|
|
157
153
|
|
|
158
|
-
// eslint-disable-next-line import/no-deprecated
|
|
159
154
|
readonly documentSchema?: IDocumentSchema;
|
|
160
155
|
}
|
|
161
156
|
|
|
162
157
|
/**
|
|
163
|
-
* @
|
|
164
|
-
* @alpha
|
|
165
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
158
|
+
* @internal
|
|
166
159
|
*/
|
|
167
160
|
export interface ICreateContainerMetadata {
|
|
168
161
|
/**
|
|
@@ -177,9 +170,7 @@ export interface ICreateContainerMetadata {
|
|
|
177
170
|
|
|
178
171
|
/**
|
|
179
172
|
* The properties of an ISequencedDocumentMessage to be stored in the metadata blob in summary.
|
|
180
|
-
* @
|
|
181
|
-
* @alpha
|
|
182
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
173
|
+
* @internal
|
|
183
174
|
*/
|
|
184
175
|
export type ISummaryMetadataMessage = Pick<
|
|
185
176
|
ISequencedDocumentMessage,
|
|
@@ -25,13 +25,10 @@ import {
|
|
|
25
25
|
IAckSummaryResult,
|
|
26
26
|
IBroadcastSummaryResult,
|
|
27
27
|
INackSummaryResult,
|
|
28
|
-
// eslint-disable-next-line import/no-deprecated
|
|
29
28
|
IRefreshSummaryAckOptions,
|
|
30
|
-
// eslint-disable-next-line import/no-deprecated
|
|
31
29
|
ISubmitSummaryOptions,
|
|
32
30
|
ISummarizeHeuristicData,
|
|
33
31
|
ISummarizeResults,
|
|
34
|
-
// eslint-disable-next-line import/no-deprecated
|
|
35
32
|
ISummaryCancellationToken,
|
|
36
33
|
SubmitSummaryFailureData,
|
|
37
34
|
SubmitSummaryResult,
|
|
@@ -52,7 +49,7 @@ export type raceTimerResult<T> =
|
|
|
52
49
|
export async function raceTimer<T>(
|
|
53
50
|
promise: Promise<T>,
|
|
54
51
|
timer: Promise<IPromiseTimerResult>,
|
|
55
|
-
|
|
52
|
+
|
|
56
53
|
cancellationToken?: ISummaryCancellationToken,
|
|
57
54
|
): Promise<raceTimerResult<T>> {
|
|
58
55
|
const promises: Promise<raceTimerResult<T>>[] = [
|
|
@@ -215,12 +212,10 @@ export class SummaryGenerator {
|
|
|
215
212
|
private readonly pendingAckTimer: IPromiseTimer,
|
|
216
213
|
private readonly heuristicData: ISummarizeHeuristicData,
|
|
217
214
|
private readonly submitSummaryCallback: (
|
|
218
|
-
// eslint-disable-next-line import/no-deprecated
|
|
219
215
|
options: ISubmitSummaryOptions,
|
|
220
216
|
) => Promise<SubmitSummaryResult>,
|
|
221
217
|
private readonly successfulSummaryCallback: () => void,
|
|
222
218
|
private readonly refreshLatestSummaryCallback: (
|
|
223
|
-
// eslint-disable-next-line import/no-deprecated
|
|
224
219
|
options: IRefreshSummaryAckOptions,
|
|
225
220
|
) => Promise<void>,
|
|
226
221
|
private readonly summaryWatcher: Pick<IClientSummaryWatcher, "watchSummary">,
|
|
@@ -238,7 +233,6 @@ export class SummaryGenerator {
|
|
|
238
233
|
* @param resultsBuilder - optional, result builder to use to build pass or fail result.
|
|
239
234
|
*/
|
|
240
235
|
public summarize(
|
|
241
|
-
// eslint-disable-next-line import/no-deprecated
|
|
242
236
|
summaryOptions: ISubmitSummaryOptions,
|
|
243
237
|
resultsBuilder = new SummarizeResultBuilder(),
|
|
244
238
|
): ISummarizeResults {
|
|
@@ -254,7 +248,6 @@ export class SummaryGenerator {
|
|
|
254
248
|
}
|
|
255
249
|
|
|
256
250
|
private async summarizeCore(
|
|
257
|
-
// eslint-disable-next-line import/no-deprecated
|
|
258
251
|
submitSummaryOptions: ISubmitSummaryOptions,
|
|
259
252
|
resultsBuilder: SummarizeResultBuilder,
|
|
260
253
|
): Promise<void> {
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { type ILoader, LoaderHeader } from "@fluidframework/container-definitions/internal";
|
|
7
|
+
import type { FluidObject, IRequest, IResponse } from "@fluidframework/core-interfaces";
|
|
8
|
+
import { DriverHeader } from "@fluidframework/driver-definitions/internal";
|
|
9
|
+
import { responseToException } from "@fluidframework/runtime-utils/internal";
|
|
10
|
+
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
11
|
+
|
|
12
|
+
import { summarizerClientType } from "./summarizerClientElection.js";
|
|
13
|
+
import type {
|
|
14
|
+
ISummarizer,
|
|
15
|
+
ISummaryConfiguration,
|
|
16
|
+
ISummaryConfigurationDisableSummarizer,
|
|
17
|
+
ISummaryConfigurationHeuristics,
|
|
18
|
+
} from "./summarizerTypes.js";
|
|
19
|
+
|
|
20
|
+
export const summarizerRequestUrl = "_summarizer";
|
|
21
|
+
|
|
22
|
+
export function isSummariesDisabled(
|
|
23
|
+
config: ISummaryConfiguration,
|
|
24
|
+
): config is ISummaryConfigurationDisableSummarizer {
|
|
25
|
+
return config.state === "disabled";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @legacy
|
|
30
|
+
* @alpha
|
|
31
|
+
*/
|
|
32
|
+
export const DefaultSummaryConfiguration: ISummaryConfiguration = {
|
|
33
|
+
state: "enabled",
|
|
34
|
+
|
|
35
|
+
minIdleTime: 0,
|
|
36
|
+
|
|
37
|
+
maxIdleTime: 30 * 1000, // 30 secs.
|
|
38
|
+
|
|
39
|
+
maxTime: 60 * 1000, // 1 min.
|
|
40
|
+
|
|
41
|
+
maxOps: 100, // Summarize if 100 weighted ops received since last snapshot.
|
|
42
|
+
|
|
43
|
+
minOpsForLastSummaryAttempt: 10,
|
|
44
|
+
|
|
45
|
+
maxAckWaitTime: 3 * 60 * 1000, // 3 mins.
|
|
46
|
+
|
|
47
|
+
maxOpsSinceLastSummary: 7000,
|
|
48
|
+
|
|
49
|
+
initialSummarizerDelayMs: 5 * 1000, // 5 secs.
|
|
50
|
+
|
|
51
|
+
nonRuntimeOpWeight: 0.1,
|
|
52
|
+
|
|
53
|
+
runtimeOpWeight: 1,
|
|
54
|
+
|
|
55
|
+
nonRuntimeHeuristicThreshold: 20,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Returns a function that will create and retrieve a Summarizer.
|
|
60
|
+
*/
|
|
61
|
+
export function formCreateSummarizerFn(loader: ILoader): () => Promise<ISummarizer> {
|
|
62
|
+
return async () => {
|
|
63
|
+
const request: IRequest = {
|
|
64
|
+
headers: {
|
|
65
|
+
[LoaderHeader.cache]: false,
|
|
66
|
+
[LoaderHeader.clientDetails]: {
|
|
67
|
+
capabilities: { interactive: false },
|
|
68
|
+
type: summarizerClientType,
|
|
69
|
+
},
|
|
70
|
+
[DriverHeader.summarizingClient]: true,
|
|
71
|
+
[LoaderHeader.reconnect]: false,
|
|
72
|
+
},
|
|
73
|
+
url: `/${summarizerRequestUrl}`,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const resolvedContainer = await loader.resolve(request);
|
|
77
|
+
let fluidObject: FluidObject<ISummarizer> | undefined;
|
|
78
|
+
|
|
79
|
+
// Older containers may not have the "getEntryPoint" API
|
|
80
|
+
// ! This check will need to stay until LTS of loader moves past 2.0.0-internal.7.0.0
|
|
81
|
+
if (resolvedContainer.getEntryPoint === undefined) {
|
|
82
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any
|
|
83
|
+
const response = (await (resolvedContainer as any).request({
|
|
84
|
+
url: `/${summarizerRequestUrl}`,
|
|
85
|
+
})) as IResponse;
|
|
86
|
+
if (response.status !== 200 || response.mimeType !== "fluid/object") {
|
|
87
|
+
throw responseToException(response, request);
|
|
88
|
+
}
|
|
89
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
90
|
+
fluidObject = response.value;
|
|
91
|
+
} else {
|
|
92
|
+
fluidObject = await resolvedContainer.getEntryPoint();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (fluidObject?.ISummarizer === undefined) {
|
|
96
|
+
throw new UsageError("Fluid object does not implement ISummarizer");
|
|
97
|
+
}
|
|
98
|
+
return fluidObject.ISummarizer;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function validateSummaryHeuristicConfiguration(
|
|
103
|
+
configuration: ISummaryConfigurationHeuristics,
|
|
104
|
+
): void {
|
|
105
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
106
|
+
for (const prop in configuration) {
|
|
107
|
+
if (typeof configuration[prop] === "number" && configuration[prop] < 0) {
|
|
108
|
+
throw new UsageError(
|
|
109
|
+
`Summary heuristic configuration property "${prop}" cannot be less than 0`,
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (configuration.minIdleTime > configuration.maxIdleTime) {
|
|
114
|
+
throw new UsageError(
|
|
115
|
+
`"minIdleTime" [${configuration.minIdleTime}] cannot be greater than "maxIdleTime" [${configuration.maxIdleTime}]`,
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -24,7 +24,6 @@ import {
|
|
|
24
24
|
|
|
25
25
|
import { IThrottler } from "../throttler.js";
|
|
26
26
|
|
|
27
|
-
// eslint-disable-next-line import/no-deprecated
|
|
28
27
|
import { Summarizer } from "./summarizer.js";
|
|
29
28
|
import { ISummarizerClientElection } from "./summarizerClientElection.js";
|
|
30
29
|
import {
|
|
@@ -285,7 +284,6 @@ export class SummaryManager
|
|
|
285
284
|
// which would happen when we have a high enough number of unsummarized ops.
|
|
286
285
|
if (
|
|
287
286
|
startWithInitialDelay ||
|
|
288
|
-
// eslint-disable-next-line import/no-deprecated
|
|
289
287
|
!Summarizer.stopReasonCanRunLastSummary(shouldSummarizeState.stopReason)
|
|
290
288
|
) {
|
|
291
289
|
this.state = SummaryManagerState.Starting;
|