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