@fluidframework/container-runtime 2.0.0-dev.2.2.0.111723 → 2.0.0-dev.3.1.0.125672

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