@fluidframework/container-runtime 2.0.0-dev-rc.2.0.0.246488 → 2.0.0-dev-rc.3.0.0.250606

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 (456) hide show
  1. package/api-report/container-runtime.api.md +78 -25
  2. package/dist/batchTracker.d.ts +1 -1
  3. package/dist/batchTracker.d.ts.map +1 -1
  4. package/dist/batchTracker.js +2 -2
  5. package/dist/batchTracker.js.map +1 -1
  6. package/dist/blobManager.d.ts +3 -3
  7. package/dist/blobManager.d.ts.map +1 -1
  8. package/dist/blobManager.js +3 -3
  9. package/dist/blobManager.js.map +1 -1
  10. package/dist/channelCollection.d.ts +5 -5
  11. package/dist/channelCollection.d.ts.map +1 -1
  12. package/dist/channelCollection.js +44 -11
  13. package/dist/channelCollection.js.map +1 -1
  14. package/dist/connectionTelemetry.d.ts +2 -2
  15. package/dist/connectionTelemetry.d.ts.map +1 -1
  16. package/dist/connectionTelemetry.js +3 -3
  17. package/dist/connectionTelemetry.js.map +1 -1
  18. package/dist/container-runtime-alpha.d.ts +205 -11
  19. package/dist/container-runtime-beta.d.ts +16 -2
  20. package/dist/container-runtime-public.d.ts +16 -2
  21. package/dist/container-runtime-untrimmed.d.ts +205 -24
  22. package/dist/containerHandleContext.d.ts.map +1 -1
  23. package/dist/containerHandleContext.js.map +1 -1
  24. package/dist/containerRuntime.d.ts +32 -26
  25. package/dist/containerRuntime.d.ts.map +1 -1
  26. package/dist/containerRuntime.js +213 -119
  27. package/dist/containerRuntime.js.map +1 -1
  28. package/dist/dataStore.d.ts +1 -1
  29. package/dist/dataStore.d.ts.map +1 -1
  30. package/dist/dataStore.js +2 -2
  31. package/dist/dataStore.js.map +1 -1
  32. package/dist/dataStoreContext.d.ts +4 -4
  33. package/dist/dataStoreContext.d.ts.map +1 -1
  34. package/dist/dataStoreContext.js +18 -18
  35. package/dist/dataStoreContext.js.map +1 -1
  36. package/dist/dataStoreContexts.d.ts.map +1 -1
  37. package/dist/dataStoreContexts.js.map +1 -1
  38. package/dist/dataStoreRegistry.d.ts.map +1 -1
  39. package/dist/dataStoreRegistry.js.map +1 -1
  40. package/dist/deltaScheduler.d.ts +1 -1
  41. package/dist/deltaScheduler.d.ts.map +1 -1
  42. package/dist/deltaScheduler.js +1 -1
  43. package/dist/deltaScheduler.js.map +1 -1
  44. package/dist/gc/garbageCollection.d.ts +1 -1
  45. package/dist/gc/garbageCollection.d.ts.map +1 -1
  46. package/dist/gc/garbageCollection.js +1 -1
  47. package/dist/gc/garbageCollection.js.map +1 -1
  48. package/dist/gc/gcConfigs.d.ts +1 -1
  49. package/dist/gc/gcConfigs.d.ts.map +1 -1
  50. package/dist/gc/gcConfigs.js.map +1 -1
  51. package/dist/gc/gcDefinitions.d.ts +1 -1
  52. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  53. package/dist/gc/gcDefinitions.js.map +1 -1
  54. package/dist/gc/gcHelpers.d.ts.map +1 -1
  55. package/dist/gc/gcHelpers.js.map +1 -1
  56. package/dist/gc/gcSummaryStateTracker.d.ts +1 -1
  57. package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
  58. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  59. package/dist/gc/gcTelemetry.d.ts +1 -1
  60. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  61. package/dist/gc/gcTelemetry.js.map +1 -1
  62. package/dist/index.d.ts +2 -2
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +4 -2
  65. package/dist/index.js.map +1 -1
  66. package/dist/messageTypes.d.ts +11 -5
  67. package/dist/messageTypes.d.ts.map +1 -1
  68. package/dist/messageTypes.js +4 -0
  69. package/dist/messageTypes.js.map +1 -1
  70. package/dist/opLifecycle/definitions.d.ts +1 -19
  71. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  72. package/dist/opLifecycle/definitions.js.map +1 -1
  73. package/dist/opLifecycle/index.d.ts +3 -3
  74. package/dist/opLifecycle/index.d.ts.map +1 -1
  75. package/dist/opLifecycle/index.js +3 -1
  76. package/dist/opLifecycle/index.js.map +1 -1
  77. package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
  78. package/dist/opLifecycle/opCompressor.js +2 -3
  79. package/dist/opLifecycle/opCompressor.js.map +1 -1
  80. package/dist/opLifecycle/opDecompressor.d.ts +15 -4
  81. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  82. package/dist/opLifecycle/opDecompressor.js +60 -61
  83. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  84. package/dist/opLifecycle/opGroupingManager.d.ts +2 -1
  85. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  86. package/dist/opLifecycle/opGroupingManager.js +9 -11
  87. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  88. package/dist/opLifecycle/opSplitter.d.ts +11 -3
  89. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  90. package/dist/opLifecycle/opSplitter.js +48 -38
  91. package/dist/opLifecycle/opSplitter.js.map +1 -1
  92. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  93. package/dist/opLifecycle/outbox.js +7 -12
  94. package/dist/opLifecycle/outbox.js.map +1 -1
  95. package/dist/opLifecycle/remoteMessageProcessor.d.ts +8 -0
  96. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  97. package/dist/opLifecycle/remoteMessageProcessor.js +36 -35
  98. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  99. package/dist/packageVersion.d.ts +1 -1
  100. package/dist/packageVersion.js +1 -1
  101. package/dist/packageVersion.js.map +1 -1
  102. package/dist/pendingStateManager.d.ts +1 -1
  103. package/dist/pendingStateManager.d.ts.map +1 -1
  104. package/dist/pendingStateManager.js.map +1 -1
  105. package/dist/scheduleManager.d.ts +1 -1
  106. package/dist/scheduleManager.d.ts.map +1 -1
  107. package/dist/scheduleManager.js +2 -2
  108. package/dist/scheduleManager.js.map +1 -1
  109. package/dist/summary/documentSchema.d.ts +178 -0
  110. package/dist/summary/documentSchema.d.ts.map +1 -0
  111. package/dist/summary/documentSchema.js +345 -0
  112. package/dist/summary/documentSchema.js.map +1 -0
  113. package/dist/summary/index.d.ts +2 -1
  114. package/dist/summary/index.d.ts.map +1 -1
  115. package/dist/summary/index.js +4 -1
  116. package/dist/summary/index.js.map +1 -1
  117. package/dist/summary/orderedClientElection.d.ts +2 -2
  118. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  119. package/dist/summary/orderedClientElection.js +3 -2
  120. package/dist/summary/orderedClientElection.js.map +1 -1
  121. package/dist/summary/runWhileConnectedCoordinator.d.ts +1 -1
  122. package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  123. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  124. package/dist/summary/runningSummarizer.d.ts +2 -2
  125. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  126. package/dist/summary/runningSummarizer.js +2 -2
  127. package/dist/summary/runningSummarizer.js.map +1 -1
  128. package/dist/summary/summarizer.d.ts +2 -2
  129. package/dist/summary/summarizer.d.ts.map +1 -1
  130. package/dist/summary/summarizer.js +2 -2
  131. package/dist/summary/summarizer.js.map +1 -1
  132. package/dist/summary/summarizerClientElection.d.ts +2 -2
  133. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  134. package/dist/summary/summarizerClientElection.js.map +1 -1
  135. package/dist/summary/summarizerHeuristics.d.ts +1 -1
  136. package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
  137. package/dist/summary/summarizerHeuristics.js.map +1 -1
  138. package/dist/summary/summarizerNode/summarizerNode.d.ts +2 -2
  139. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  140. package/dist/summary/summarizerNode/summarizerNode.js +3 -3
  141. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  142. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -1
  143. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  144. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  145. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +1 -1
  146. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  147. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +1 -1
  148. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  149. package/dist/summary/summarizerTypes.d.ts +3 -3
  150. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  151. package/dist/summary/summarizerTypes.js.map +1 -1
  152. package/dist/summary/summaryCollection.d.ts +2 -2
  153. package/dist/summary/summaryCollection.d.ts.map +1 -1
  154. package/dist/summary/summaryCollection.js +1 -1
  155. package/dist/summary/summaryCollection.js.map +1 -1
  156. package/dist/summary/summaryFormat.d.ts +5 -16
  157. package/dist/summary/summaryFormat.d.ts.map +1 -1
  158. package/dist/summary/summaryFormat.js.map +1 -1
  159. package/dist/summary/summaryGenerator.d.ts +2 -2
  160. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  161. package/dist/summary/summaryGenerator.js +2 -2
  162. package/dist/summary/summaryGenerator.js.map +1 -1
  163. package/dist/summary/summaryManager.d.ts +1 -1
  164. package/dist/summary/summaryManager.d.ts.map +1 -1
  165. package/dist/summary/summaryManager.js +2 -2
  166. package/dist/summary/summaryManager.js.map +1 -1
  167. package/lib/batchTracker.d.ts +1 -1
  168. package/lib/batchTracker.d.ts.map +1 -1
  169. package/lib/batchTracker.js +2 -2
  170. package/lib/batchTracker.js.map +1 -1
  171. package/lib/blobManager.d.ts +3 -3
  172. package/lib/blobManager.d.ts.map +1 -1
  173. package/lib/blobManager.js +5 -5
  174. package/lib/blobManager.js.map +1 -1
  175. package/lib/channelCollection.d.ts +5 -5
  176. package/lib/channelCollection.d.ts.map +1 -1
  177. package/lib/channelCollection.js +46 -13
  178. package/lib/channelCollection.js.map +1 -1
  179. package/lib/connectionTelemetry.d.ts +2 -2
  180. package/lib/connectionTelemetry.d.ts.map +1 -1
  181. package/lib/connectionTelemetry.js +3 -3
  182. package/lib/connectionTelemetry.js.map +1 -1
  183. package/lib/container-runtime-alpha.d.ts +205 -11
  184. package/lib/container-runtime-beta.d.ts +16 -2
  185. package/lib/container-runtime-public.d.ts +16 -2
  186. package/lib/container-runtime-untrimmed.d.ts +205 -24
  187. package/lib/containerHandleContext.d.ts.map +1 -1
  188. package/lib/containerHandleContext.js.map +1 -1
  189. package/lib/containerRuntime.d.ts +32 -26
  190. package/lib/containerRuntime.d.ts.map +1 -1
  191. package/lib/containerRuntime.js +175 -81
  192. package/lib/containerRuntime.js.map +1 -1
  193. package/lib/dataStore.d.ts +1 -1
  194. package/lib/dataStore.d.ts.map +1 -1
  195. package/lib/dataStore.js +2 -2
  196. package/lib/dataStore.js.map +1 -1
  197. package/lib/dataStoreContext.d.ts +4 -4
  198. package/lib/dataStoreContext.d.ts.map +1 -1
  199. package/lib/dataStoreContext.js +3 -3
  200. package/lib/dataStoreContext.js.map +1 -1
  201. package/lib/dataStoreContexts.d.ts.map +1 -1
  202. package/lib/dataStoreContexts.js.map +1 -1
  203. package/lib/dataStoreRegistry.d.ts.map +1 -1
  204. package/lib/dataStoreRegistry.js.map +1 -1
  205. package/lib/deltaScheduler.d.ts +1 -1
  206. package/lib/deltaScheduler.d.ts.map +1 -1
  207. package/lib/deltaScheduler.js +1 -1
  208. package/lib/deltaScheduler.js.map +1 -1
  209. package/lib/gc/garbageCollection.d.ts +1 -1
  210. package/lib/gc/garbageCollection.d.ts.map +1 -1
  211. package/lib/gc/garbageCollection.js +3 -3
  212. package/lib/gc/garbageCollection.js.map +1 -1
  213. package/lib/gc/gcConfigs.d.ts +1 -1
  214. package/lib/gc/gcConfigs.d.ts.map +1 -1
  215. package/lib/gc/gcConfigs.js +1 -1
  216. package/lib/gc/gcConfigs.js.map +1 -1
  217. package/lib/gc/gcDefinitions.d.ts +1 -1
  218. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  219. package/lib/gc/gcDefinitions.js.map +1 -1
  220. package/lib/gc/gcHelpers.d.ts.map +1 -1
  221. package/lib/gc/gcHelpers.js.map +1 -1
  222. package/lib/gc/gcSummaryStateTracker.d.ts +1 -1
  223. package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
  224. package/lib/gc/gcSummaryStateTracker.js +1 -1
  225. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  226. package/lib/gc/gcTelemetry.d.ts +1 -1
  227. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  228. package/lib/gc/gcTelemetry.js +1 -1
  229. package/lib/gc/gcTelemetry.js.map +1 -1
  230. package/lib/index.d.ts +2 -2
  231. package/lib/index.d.ts.map +1 -1
  232. package/lib/index.js +2 -2
  233. package/lib/index.js.map +1 -1
  234. package/lib/messageTypes.d.ts +11 -5
  235. package/lib/messageTypes.d.ts.map +1 -1
  236. package/lib/messageTypes.js +4 -0
  237. package/lib/messageTypes.js.map +1 -1
  238. package/lib/opLifecycle/definitions.d.ts +1 -19
  239. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  240. package/lib/opLifecycle/definitions.js.map +1 -1
  241. package/lib/opLifecycle/index.d.ts +3 -3
  242. package/lib/opLifecycle/index.d.ts.map +1 -1
  243. package/lib/opLifecycle/index.js +2 -2
  244. package/lib/opLifecycle/index.js.map +1 -1
  245. package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
  246. package/lib/opLifecycle/opCompressor.js +2 -3
  247. package/lib/opLifecycle/opCompressor.js.map +1 -1
  248. package/lib/opLifecycle/opDecompressor.d.ts +15 -4
  249. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  250. package/lib/opLifecycle/opDecompressor.js +60 -61
  251. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  252. package/lib/opLifecycle/opGroupingManager.d.ts +2 -1
  253. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  254. package/lib/opLifecycle/opGroupingManager.js +7 -10
  255. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  256. package/lib/opLifecycle/opSplitter.d.ts +11 -3
  257. package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
  258. package/lib/opLifecycle/opSplitter.js +46 -37
  259. package/lib/opLifecycle/opSplitter.js.map +1 -1
  260. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  261. package/lib/opLifecycle/outbox.js +7 -12
  262. package/lib/opLifecycle/outbox.js.map +1 -1
  263. package/lib/opLifecycle/remoteMessageProcessor.d.ts +8 -0
  264. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  265. package/lib/opLifecycle/remoteMessageProcessor.js +36 -35
  266. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  267. package/lib/packageVersion.d.ts +1 -1
  268. package/lib/packageVersion.js +1 -1
  269. package/lib/packageVersion.js.map +1 -1
  270. package/lib/pendingStateManager.d.ts +1 -1
  271. package/lib/pendingStateManager.d.ts.map +1 -1
  272. package/lib/pendingStateManager.js.map +1 -1
  273. package/lib/scheduleManager.d.ts +1 -1
  274. package/lib/scheduleManager.d.ts.map +1 -1
  275. package/lib/scheduleManager.js +2 -2
  276. package/lib/scheduleManager.js.map +1 -1
  277. package/lib/summary/documentSchema.d.ts +178 -0
  278. package/lib/summary/documentSchema.d.ts.map +1 -0
  279. package/lib/summary/documentSchema.js +341 -0
  280. package/lib/summary/documentSchema.js.map +1 -0
  281. package/lib/summary/index.d.ts +2 -1
  282. package/lib/summary/index.d.ts.map +1 -1
  283. package/lib/summary/index.js +1 -0
  284. package/lib/summary/index.js.map +1 -1
  285. package/lib/summary/orderedClientElection.d.ts +2 -2
  286. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  287. package/lib/summary/orderedClientElection.js +3 -2
  288. package/lib/summary/orderedClientElection.js.map +1 -1
  289. package/lib/summary/runWhileConnectedCoordinator.d.ts +1 -1
  290. package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  291. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  292. package/lib/summary/runningSummarizer.d.ts +2 -2
  293. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  294. package/lib/summary/runningSummarizer.js +3 -3
  295. package/lib/summary/runningSummarizer.js.map +1 -1
  296. package/lib/summary/summarizer.d.ts +2 -2
  297. package/lib/summary/summarizer.d.ts.map +1 -1
  298. package/lib/summary/summarizer.js +3 -3
  299. package/lib/summary/summarizer.js.map +1 -1
  300. package/lib/summary/summarizerClientElection.d.ts +2 -2
  301. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  302. package/lib/summary/summarizerClientElection.js.map +1 -1
  303. package/lib/summary/summarizerHeuristics.d.ts +1 -1
  304. package/lib/summary/summarizerHeuristics.d.ts.map +1 -1
  305. package/lib/summary/summarizerHeuristics.js.map +1 -1
  306. package/lib/summary/summarizerNode/summarizerNode.d.ts +2 -2
  307. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  308. package/lib/summary/summarizerNode/summarizerNode.js +4 -4
  309. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  310. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -1
  311. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  312. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  313. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +1 -1
  314. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  315. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +1 -1
  316. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  317. package/lib/summary/summarizerTypes.d.ts +3 -3
  318. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  319. package/lib/summary/summarizerTypes.js.map +1 -1
  320. package/lib/summary/summaryCollection.d.ts +2 -2
  321. package/lib/summary/summaryCollection.d.ts.map +1 -1
  322. package/lib/summary/summaryCollection.js +1 -1
  323. package/lib/summary/summaryCollection.js.map +1 -1
  324. package/lib/summary/summaryFormat.d.ts +5 -16
  325. package/lib/summary/summaryFormat.d.ts.map +1 -1
  326. package/lib/summary/summaryFormat.js +1 -1
  327. package/lib/summary/summaryFormat.js.map +1 -1
  328. package/lib/summary/summaryGenerator.d.ts +2 -2
  329. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  330. package/lib/summary/summaryGenerator.js +3 -3
  331. package/lib/summary/summaryGenerator.js.map +1 -1
  332. package/lib/summary/summaryManager.d.ts +1 -1
  333. package/lib/summary/summaryManager.d.ts.map +1 -1
  334. package/lib/summary/summaryManager.js +2 -2
  335. package/lib/summary/summaryManager.js.map +1 -1
  336. package/lib/test/blobManager.spec.js +3 -3
  337. package/lib/test/blobManager.spec.js.map +1 -1
  338. package/lib/test/containerRuntime.spec.js +6 -4
  339. package/lib/test/containerRuntime.spec.js.map +1 -1
  340. package/lib/test/dataStoreContext.spec.js +4 -4
  341. package/lib/test/dataStoreContext.spec.js.map +1 -1
  342. package/lib/test/dataStoreCreation.spec.js +1 -1
  343. package/lib/test/dataStoreCreation.spec.js.map +1 -1
  344. package/lib/test/dataStoreRegistry.spec.js.map +1 -1
  345. package/lib/test/documentSchema.spec.js +282 -0
  346. package/lib/test/documentSchema.spec.js.map +1 -0
  347. package/lib/test/fuzz/fuzzUtils.js +11 -7
  348. package/lib/test/fuzz/fuzzUtils.js.map +1 -1
  349. package/lib/test/fuzz/summarizer.fuzz.spec.js +9 -7
  350. package/lib/test/fuzz/summarizer.fuzz.spec.js.map +1 -1
  351. package/lib/test/fuzz/summarizerFuzzMocks.js +43 -25
  352. package/lib/test/fuzz/summarizerFuzzMocks.js.map +1 -1
  353. package/lib/test/fuzz/summarizerFuzzSuite.js +7 -4
  354. package/lib/test/fuzz/summarizerFuzzSuite.js.map +1 -1
  355. package/lib/test/gc/garbageCollection.spec.js +5 -5
  356. package/lib/test/gc/garbageCollection.spec.js.map +1 -1
  357. package/lib/test/gc/gcConfigs.spec.js +2 -2
  358. package/lib/test/gc/gcConfigs.spec.js.map +1 -1
  359. package/lib/test/gc/gcHelpers.spec.js.map +1 -1
  360. package/lib/test/gc/gcStats.spec.js +2 -2
  361. package/lib/test/gc/gcStats.spec.js.map +1 -1
  362. package/lib/test/gc/gcSummaryStateTracker.spec.js +1 -1
  363. package/lib/test/gc/gcSummaryStateTracker.spec.js.map +1 -1
  364. package/lib/test/gc/gcTelemetry.spec.js +3 -3
  365. package/lib/test/gc/gcTelemetry.spec.js.map +1 -1
  366. package/lib/test/gc/gcUnreferencedStateTracker.spec.js +1 -1
  367. package/lib/test/gc/gcUnreferencedStateTracker.spec.js.map +1 -1
  368. package/lib/test/getPendingBlobs.spec.js +1 -1
  369. package/lib/test/getPendingBlobs.spec.js.map +1 -1
  370. package/lib/test/hardwareStats.spec.js +1 -1
  371. package/lib/test/hardwareStats.spec.js.map +1 -1
  372. package/lib/test/opLifecycle/OpGroupingManager.spec.js +95 -118
  373. package/lib/test/opLifecycle/OpGroupingManager.spec.js.map +1 -1
  374. package/lib/test/opLifecycle/batchManager.spec.js +1 -1
  375. package/lib/test/opLifecycle/batchManager.spec.js.map +1 -1
  376. package/lib/test/opLifecycle/opCompressor.spec.js +0 -1
  377. package/lib/test/opLifecycle/opCompressor.spec.js.map +1 -1
  378. package/lib/test/opLifecycle/opDecompressor.spec.js +60 -55
  379. package/lib/test/opLifecycle/opDecompressor.spec.js.map +1 -1
  380. package/lib/test/opLifecycle/opSplitter.spec.js +56 -41
  381. package/lib/test/opLifecycle/opSplitter.spec.js.map +1 -1
  382. package/lib/test/opLifecycle/outbox.spec.js +118 -10
  383. package/lib/test/opLifecycle/outbox.spec.js.map +1 -1
  384. package/lib/test/opLifecycle/remoteMessageProcessor.spec.js +115 -91
  385. package/lib/test/opLifecycle/remoteMessageProcessor.spec.js.map +1 -1
  386. package/lib/test/pendingStateManager.spec.js +1 -1
  387. package/lib/test/pendingStateManager.spec.js.map +1 -1
  388. package/lib/test/scheduleManager.spec.js +1 -1
  389. package/lib/test/scheduleManager.spec.js.map +1 -1
  390. package/lib/test/summarizerNode.spec.js +1 -1
  391. package/lib/test/summarizerNode.spec.js.map +1 -1
  392. package/lib/test/summarizerNodeWithGc.spec.js +1 -1
  393. package/lib/test/summarizerNodeWithGc.spec.js.map +1 -1
  394. package/lib/test/summary/runningSummarizer.spec.js +4 -4
  395. package/lib/test/summary/runningSummarizer.spec.js.map +1 -1
  396. package/lib/test/summary/summarizer.spec.js.map +1 -1
  397. package/lib/test/summary/summarizerClientElection.spec.js +2 -2
  398. package/lib/test/summary/summarizerClientElection.spec.js.map +1 -1
  399. package/lib/test/summary/summarizerHeuristics.spec.js +1 -1
  400. package/lib/test/summary/summarizerHeuristics.spec.js.map +1 -1
  401. package/lib/test/summary/summaryCollection.spec.js +1 -1
  402. package/lib/test/summary/summaryCollection.spec.js.map +1 -1
  403. package/lib/test/summary/summaryManager.spec.js +3 -3
  404. package/lib/test/summary/summaryManager.spec.js.map +1 -1
  405. package/lib/test/throttler.spec.js +1 -1
  406. package/lib/test/throttler.spec.js.map +1 -1
  407. package/lib/test/types/validateContainerRuntimePrevious.generated.js +6 -4
  408. package/lib/test/types/validateContainerRuntimePrevious.generated.js.map +1 -1
  409. package/package.json +35 -21
  410. package/src/batchTracker.ts +3 -3
  411. package/src/blobManager.ts +15 -15
  412. package/src/channelCollection.ts +75 -35
  413. package/src/connectionTelemetry.ts +10 -10
  414. package/src/containerHandleContext.ts +1 -1
  415. package/src/containerRuntime.ts +352 -197
  416. package/src/dataStore.ts +2 -2
  417. package/src/dataStoreContext.ts +19 -19
  418. package/src/dataStoreContexts.ts +2 -2
  419. package/src/dataStoreRegistry.ts +1 -1
  420. package/src/deltaScheduler.ts +1 -1
  421. package/src/gc/garbageCollection.ts +12 -12
  422. package/src/gc/gcConfigs.ts +11 -11
  423. package/src/gc/gcDefinitions.ts +2 -2
  424. package/src/gc/gcHelpers.ts +2 -2
  425. package/src/gc/gcSummaryStateTracker.ts +4 -4
  426. package/src/gc/gcTelemetry.ts +6 -6
  427. package/src/index.ts +8 -1
  428. package/src/messageTypes.ts +18 -5
  429. package/src/opLifecycle/README.md +89 -0
  430. package/src/opLifecycle/definitions.ts +1 -20
  431. package/src/opLifecycle/index.ts +3 -9
  432. package/src/opLifecycle/opCompressor.ts +4 -5
  433. package/src/opLifecycle/opDecompressor.ts +83 -100
  434. package/src/opLifecycle/opGroupingManager.ts +9 -12
  435. package/src/opLifecycle/opSplitter.ts +73 -47
  436. package/src/opLifecycle/outbox.ts +13 -31
  437. package/src/opLifecycle/remoteMessageProcessor.ts +41 -59
  438. package/src/packageVersion.ts +1 -1
  439. package/src/pendingStateManager.ts +2 -2
  440. package/src/scheduleManager.ts +7 -7
  441. package/src/summary/documentSchema.ts +553 -0
  442. package/src/summary/index.ts +10 -1
  443. package/src/summary/orderedClientElection.ts +6 -5
  444. package/src/summary/runWhileConnectedCoordinator.ts +1 -1
  445. package/src/summary/runningSummarizer.ts +19 -19
  446. package/src/summary/summarizer.ts +14 -14
  447. package/src/summary/summarizerClientElection.ts +2 -2
  448. package/src/summary/summarizerHeuristics.ts +2 -2
  449. package/src/summary/summarizerNode/summarizerNode.ts +15 -15
  450. package/src/summary/summarizerNode/summarizerNodeUtils.ts +1 -1
  451. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +4 -4
  452. package/src/summary/summarizerTypes.ts +3 -3
  453. package/src/summary/summaryCollection.ts +3 -3
  454. package/src/summary/summaryFormat.ts +8 -19
  455. package/src/summary/summaryGenerator.ts +10 -10
  456. package/src/summary/summaryManager.ts +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"connectionTelemetry.js","sourceRoot":"","sources":["../src/connectionTelemetry.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qEAOyC;AAEzC,+EAI8C;AAC9C,2DAAoD;AACpD,+DAA2D;AAI3D;;GAEG;AACU,QAAA,gBAAgB,GAAG,IAAI,CAAC;AAgCrC,MAAM,eAAe;IA+BpB;;;;;;;OAOG;IACH;IACC;;;;;;OAMG;IACK,QAA4B;IACpC;;OAEG;IACc,YAAwE;IACzF;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AI,CAAC,iBAAiB,CAAC,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;SAC5D;IACF,CAAC;;AArSuB,sCAAsB,GAAG,GAAG,AAAN,CAAO;AAG7B,yCAAyB,GAAG,GAAG,AAAN,CAAO;AA0TzD;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CACpC,QAA4B,EAC5B,YAAwE,EACxE,sBAA+D,EAC/D,MAA2B;IAE3B,IAAI,eAAe,CAAC,QAAQ,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,CAAC,CAAC;AAC7E,CAAC;AAPD,sDAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIEventSampler,\n\tISampledTelemetryLogger,\n\tITelemetryLoggerExt,\n\tcreateChildLogger,\n\tcreateSampledLogger,\n\tformatTick,\n} from \"@fluidframework/telemetry-utils\";\nimport { IDeltaManager } from \"@fluidframework/container-definitions\";\nimport {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tMessageType,\n} from \"@fluidframework/protocol-definitions\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { performance } from \"@fluid-internal/client-utils\";\nimport { IContainerRuntimeEvents } from \"@fluidframework/container-runtime-definitions\";\nimport { IEventProvider } from \"@fluidframework/core-interfaces\";\n\n/**\n * We report various latency-related errors when waiting for op roundtrip takes longer than that amout of time.\n */\nexport const latencyThreshold = 5000;\n\n// Phases in OpPerfTelemetry:\n// 1.\tOp is added to DeltaManager (DM) buffer.\n// 2.\tOp is sent to service (op leaves outbound queue).\n// \t - Note: We do not know for sure when op is sent, we only track when it is added to outbound queue.\n// If outbound queue is paused, time queue is paused is counted as network time.\n// 3.\tOp received from service back (pushed to inbound queue).\n// 4.\tOp is processed.\ninterface IOpPerfTelemetryProperties {\n\t/** Measure time between (1) and (2) - Measure time outbound op is sitting in queue due to active batch */\n\tdurationOutboundBatching: number; // was durationOutboundQueue in previous versions\n\t/** Measure time between (2) and (3) - Track how long it took for op to be acked by service */\n\tdurationNetwork: number; // was durationInboundQueue\n\t/** Measure time between (3) and (4) - Time between DM's inbound \"push\" event until DM's \"op\" event */\n\tdurationInboundToProcessing: number;\n\t/** Length of the DeltaManager's inbound queue at the time of the DM's inbound \"push\" event (3) */\n\tlengthInboundQueue: number;\n}\n\n/**\n * Timings collected at various moments during the op processing.\n */\ninterface IOpPerfTimings {\n\t/** Starting time for (1) */\n\tsubmitOpEventTime: number;\n\t/** Starting time for (2) */\n\toutboundPushEventTime: number;\n\t/** Starting time for (3) */\n\tinboundPushEventTime: number;\n}\n\nclass OpPerfTelemetry {\n\tprivate pingLatency: number | undefined;\n\n\t// Collab window tracking. This is timestamp of %1000 message.\n\tprivate sequenceNumberForMsnTracking: number | undefined;\n\tprivate msnTrackingTimestamp: number = 0;\n\t// To track round trip time for every %500 client message.\n\tprivate clientSequenceNumberForLatencyStatistics: number | undefined;\n\t// Performance Data to be reported for ops round trips and processing.\n\tprivate readonly latencyStatistics = new Map<\n\t\tnumber,\n\t\t{\n\t\t\topProcessingTimes: Partial<IOpPerfTimings>;\n\t\t\topPerfData: Partial<IOpPerfTelemetryProperties>;\n\t\t}\n\t>();\n\n\tprivate firstConnection = true;\n\tprivate connectionOpSeqNumber: number | undefined;\n\tprivate readonly bootTime = performance.now();\n\tprivate connectionStartTime = 0;\n\tprivate gap = 0;\n\n\tprivate readonly logger: ITelemetryLoggerExt;\n\n\tprivate static readonly OP_LATENCY_SAMPLE_RATE = 500;\n\tprivate readonly opLatencyLogger: ISampledTelemetryLogger;\n\n\tprivate static readonly DELTA_LATENCY_SAMPLE_RATE = 100;\n\tprivate readonly deltaLatencyLogger: ISampledTelemetryLogger;\n\n\t/**\n\t * Create an instance of OpPerfTelemetry which starts monitoring and generating telemetry related to op performance.\n\t *\n\t * @param clientId - The clientId of the current container.\n\t * @param deltaManager - DeltaManager instance to monitor.\n\t * @param containerRuntimeEvents - Emitter of events for the container runtime.\n\t * @param logger - Telemetry logger to write events to.\n\t */\n\tpublic constructor(\n\t\t/**\n\t\t * The clientId of the current container.\n\t\t *\n\t\t * @remarks Until the container connects to the server and receives an ack for its own join op, this can be undefined.\n\t\t * It gets updated in response to event changes once the value provided by the server is available.\n\t\t * If the container loses its connection, this could be the last known clientId.\n\t\t */\n\t\tprivate clientId: string | undefined,\n\t\t/**\n\t\t * DeltaManager instance to monitor.\n\t\t */\n\t\tprivate readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\t\t/**\n\t\t * Emitter of events for the container runtime.\n\t\t */\n\t\tcontainerRuntimeEvents: IEventProvider<IContainerRuntimeEvents>,\n\t\t/**\n\t\t * Telemetry logger to write events to.\n\t\t */\n\t\tlogger: ITelemetryLoggerExt,\n\t) {\n\t\tthis.logger = createChildLogger({ logger, namespace: \"OpPerf\" });\n\n\t\tconst deltaLatencyEventSampler: IEventSampler = (() => {\n\t\t\tlet eventCount = -1;\n\t\t\treturn {\n\t\t\t\tsample: () => {\n\t\t\t\t\teventCount++;\n\t\t\t\t\tconst shouldSample =\n\t\t\t\t\t\teventCount % OpPerfTelemetry.DELTA_LATENCY_SAMPLE_RATE === 0;\n\t\t\t\t\tif (shouldSample) {\n\t\t\t\t\t\teventCount = 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn shouldSample;\n\t\t\t\t},\n\t\t\t};\n\t\t})();\n\n\t\tthis.deltaLatencyLogger = createSampledLogger(logger, deltaLatencyEventSampler);\n\n\t\t// The SampledLogger here is used get access to the isSamplingDisabled property derived from\n\t\t// telemetry config properties. The actual sampling logic for op messages happens outside this SampledLogger\n\t\t// due to complexity of the different asynchronus scenarios of the op message lifecycle.\n\t\tthis.opLatencyLogger = createSampledLogger(logger);\n\n\t\tthis.deltaManager.on(\"pong\", (latency) => this.recordPingTime(latency));\n\t\tthis.deltaManager.on(\"submitOp\", (message) => this.beforeOpSubmit(message));\n\n\t\tthis.deltaManager.on(\"op\", (message) => this.afterProcessingOp(message));\n\n\t\tthis.deltaManager.on(\"connect\", (details, opsBehind) => {\n\t\t\tif (opsBehind !== undefined) {\n\t\t\t\tthis.connectionOpSeqNumber = this.deltaManager.lastKnownSeqNumber;\n\t\t\t\tthis.gap = opsBehind;\n\t\t\t\tthis.connectionStartTime = performance.now();\n\n\t\t\t\t// We might be already up-today. If so, report it right away.\n\t\t\t\tif (this.gap <= 0) {\n\t\t\t\t\tthis.reportGettingUpToDate();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.deltaManager.on(\"disconnect\", () => {\n\t\t\tthis.sequenceNumberForMsnTracking = undefined;\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = undefined;\n\t\t\tthis.connectionOpSeqNumber = undefined;\n\t\t\tthis.firstConnection = false;\n\t\t\tthis.latencyStatistics.clear();\n\t\t});\n\n\t\tthis.deltaManager.outbound.on(\"push\", (messages) => {\n\t\t\tfor (const msg of messages) {\n\t\t\t\tif (\n\t\t\t\t\tmsg.type === MessageType.Operation &&\n\t\t\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === msg.clientSequenceNumber)\n\t\t\t\t) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tconst latencyStats = this.latencyStatistics.get(msg.clientSequenceNumber)!;\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats !== undefined,\n\t\t\t\t\t\t0x7c2 /* Latency stats for op should exist */,\n\t\t\t\t\t);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime === undefined,\n\t\t\t\t\t\t0x2c8 /* \"outboundPushEventTime should be undefined\" */,\n\t\t\t\t\t);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opPerfData.durationNetwork === undefined,\n\t\t\t\t\t\t0x2c9 /* \"durationNetwork should be undefined\" */,\n\t\t\t\t\t);\n\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime = Date.now();\n\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opPerfData.durationOutboundBatching === undefined,\n\t\t\t\t\t\t0x2ca /* \"durationOutboundBatching should be undefined\" */,\n\t\t\t\t\t);\n\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.submitOpEventTime !== undefined,\n\t\t\t\t\t\t0x2cb /* \"submitOpEventTime should be undefined\" */,\n\t\t\t\t\t);\n\n\t\t\t\t\tlatencyStats.opPerfData.durationOutboundBatching =\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime -\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.submitOpEventTime;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tthis.deltaManager.inbound.on(\"push\", (message: ISequencedDocumentMessage) => {\n\t\t\tif (\n\t\t\t\tthis.clientId === message.clientId &&\n\t\t\t\tmessage.type === MessageType.Operation &&\n\t\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber)\n\t\t\t) {\n\t\t\t\t// We do an explicit check for undefined right after this\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tconst latencyStats = this.latencyStatistics.get(message.clientSequenceNumber)!;\n\t\t\t\tassert(latencyStats !== undefined, 0x7c3 /* Latency stats for op should exist */);\n\t\t\t\tif (latencyStats.opProcessingTimes.outboundPushEventTime !== undefined) {\n\t\t\t\t\tlatencyStats.opProcessingTimes.inboundPushEventTime = Date.now();\n\t\t\t\t\tlatencyStats.opPerfData.durationNetwork =\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.inboundPushEventTime -\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime;\n\t\t\t\t\tlatencyStats.opPerfData.lengthInboundQueue = this.deltaManager.inbound.length;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tthis.deltaManager.inbound.on(\"idle\", (count: number, duration: number) => {\n\t\t\t// Do not want to log zero for sure.\n\t\t\t// We are more interested in aggregates, so logging only if we are processing some number of ops\n\t\t\t// Cut-off is arbitrary - can be increased or decreased based on amount of data collected and questions we\n\t\t\t// want to get answered\n\t\t\t// back-compat: Once 0.36 loader version saturates (count & duration args were added there),\n\t\t\t// we can remove typeof check.\n\t\t\tif (typeof count === \"number\" && count >= 100) {\n\t\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\t\teventName: \"GetDeltas_OpProcessing\",\n\t\t\t\t\tcount,\n\t\t\t\t\tduration,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tcontainerRuntimeEvents.on(\"connected\", (newClientId) => {\n\t\t\tthis.clientId = newClientId;\n\t\t});\n\t}\n\n\tprivate reportGettingUpToDate() {\n\t\tthis.connectionOpSeqNumber = undefined;\n\t\tthis.logger.sendPerformanceEvent({\n\t\t\teventName: \"ConnectionSpeed\",\n\t\t\tduration: performance.now() - this.connectionStartTime,\n\t\t\tops: this.gap,\n\t\t\t// track time to connect only for first connection.\n\t\t\ttimeToConnect: this.firstConnection\n\t\t\t\t? formatTick(this.connectionStartTime - this.bootTime)\n\t\t\t\t: undefined,\n\t\t\tfirstConnection: this.firstConnection,\n\t\t});\n\t}\n\n\tprivate recordPingTime(latency: number) {\n\t\tthis.pingLatency = latency;\n\n\t\t// Log if latency is longer than 1 min\n\t\tif (latency > 1000 * 60) {\n\t\t\tthis.logger.sendErrorEvent({\n\t\t\t\teventName: \"LatencyTooLong\",\n\t\t\t\tduration: latency,\n\t\t\t});\n\t\t}\n\n\t\t// logging one in every DELTA_LATENCY_SAMPLE_RATE pongs, including the first time, if it is a \"write\" client.\n\t\tif (this.deltaManager.active) {\n\t\t\tthis.deltaLatencyLogger.sendPerformanceEvent({\n\t\t\t\teventName: \"DeltaLatency\",\n\t\t\t\tduration: latency,\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate beforeOpSubmit(message: IDocumentMessage) {\n\t\t// start with first client op and measure latency every 500 client ops\n\t\tif (\n\t\t\tthis.opLatencyLogger.isSamplingDisabled ||\n\t\t\t(this.clientSequenceNumberForLatencyStatistics === undefined &&\n\t\t\t\tmessage.clientSequenceNumber % OpPerfTelemetry.OP_LATENCY_SAMPLE_RATE === 1)\n\t\t) {\n\t\t\tassert(\n\t\t\t\tthis.latencyStatistics.get(message.clientSequenceNumber) === undefined,\n\t\t\t\t0x7c4 /* Existing op perf data for client sequence number */,\n\t\t\t);\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = message.clientSequenceNumber;\n\t\t\tthis.latencyStatistics.set(message.clientSequenceNumber, {\n\t\t\t\topProcessingTimes: {\n\t\t\t\t\tsubmitOpEventTime: Date.now(),\n\t\t\t\t},\n\t\t\t\topPerfData: {},\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate afterProcessingOp(message: ISequencedDocumentMessage) {\n\t\tconst sequenceNumber = message.sequenceNumber;\n\n\t\tif (sequenceNumber === this.connectionOpSeqNumber) {\n\t\t\tthis.reportGettingUpToDate();\n\t\t}\n\n\t\t// Record collab window max size after every 1000th op.\n\t\tif (this.sequenceNumberForMsnTracking === undefined && sequenceNumber % 1000 === 0) {\n\t\t\tthis.sequenceNumberForMsnTracking = sequenceNumber;\n\t\t\tthis.msnTrackingTimestamp = message.timestamp;\n\t\t}\n\t\tif (\n\t\t\tthis.sequenceNumberForMsnTracking !== undefined &&\n\t\t\tmessage.minimumSequenceNumber >= this.sequenceNumberForMsnTracking\n\t\t) {\n\t\t\tassert(\n\t\t\t\tthis.msnTrackingTimestamp !== undefined,\n\t\t\t\t0x2ce /* \"msnTrackingTimestamp should not be undefined\" */,\n\t\t\t);\n\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\teventName: \"MsnStatistics\",\n\t\t\t\tsequenceNumber,\n\t\t\t\tmsnDistance: sequenceNumber - this.sequenceNumberForMsnTracking,\n\t\t\t\tduration: message.timestamp - this.msnTrackingTimestamp,\n\t\t\t});\n\t\t\tthis.sequenceNumberForMsnTracking = undefined;\n\t\t}\n\n\t\tif (\n\t\t\tthis.clientId === message.clientId &&\n\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber)\n\t\t) {\n\t\t\t// We do an explicit check for undefined right after this\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst latencyData = this.latencyStatistics.get(message.clientSequenceNumber)!;\n\t\t\tassert(latencyData !== undefined, 0x7c5 /* Undefined latency statistics for op */);\n\t\t\tassert(\n\t\t\t\tlatencyData.opProcessingTimes.submitOpEventTime !== undefined,\n\t\t\t\t0x120 /* \"Undefined latency statistics for op (op send time)\" */,\n\t\t\t);\n\t\t\tconst currentTime = Date.now();\n\t\t\tif (latencyData.opProcessingTimes.inboundPushEventTime !== undefined) {\n\t\t\t\tlatencyData.opPerfData.durationInboundToProcessing =\n\t\t\t\t\tcurrentTime - latencyData.opProcessingTimes.inboundPushEventTime;\n\t\t\t}\n\t\t\tconst duration = currentTime - latencyData.opProcessingTimes.submitOpEventTime;\n\n\t\t\t// One of the core expectations for Fluid service is to be fast.\n\t\t\t// When it's not the case, we want to learn about it and be able to investigate, so\n\t\t\t// raise awareness.\n\t\t\t// This also helps identify cases where it's due to client behavior (sending too many ops)\n\t\t\t// that results in overwhelming ordering service and thus starting to see long latencies.\n\t\t\t// The threshold could be adjusted, but ideally it stays workload-agnostic, as service\n\t\t\t// performance impacts all workloads relying on service.\n\t\t\tconst category = duration > latencyThreshold ? \"error\" : \"performance\";\n\t\t\tthis.opLatencyLogger.sendPerformanceEvent({\n\t\t\t\teventName: \"OpRoundtripTime\",\n\t\t\t\tsequenceNumber,\n\t\t\t\treferenceSequenceNumber: message.referenceSequenceNumber,\n\t\t\t\tduration,\n\t\t\t\tcategory,\n\t\t\t\tpingLatency: this.pingLatency,\n\t\t\t\tmsnDistance:\n\t\t\t\t\tthis.deltaManager.lastSequenceNumber - this.deltaManager.minimumSequenceNumber,\n\t\t\t\t...latencyData.opPerfData,\n\t\t\t});\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = undefined;\n\t\t\tthis.latencyStatistics.delete(message.clientSequenceNumber);\n\t\t}\n\t}\n}\nexport interface IPerfSignalReport {\n\t/**\n\t * Identifier for the signal being submitted in order to\n\t * allow collection of data around the roundtrip of signal messages.\n\t */\n\tsignalSequenceNumber: number;\n\t/**\n\t * Number of signals that were expected but not received.\n\t */\n\tsignalsLost: number;\n\n\t/**\n\t * Timestamp before submitting the signal we will trace.\n\t */\n\tsignalTimestamp: number;\n\n\t/**\n\t * Expected Signal Sequence to be received.\n\t */\n\ttrackingSignalSequenceNumber: number | undefined;\n}\n\n/**\n * Starts monitoring and generation of telemetry related to op performance.\n *\n * @param clientId - The clientId of the current container.\n * @param deltaManager - DeltaManager instance to monitor.\n * @param containerRuntimeEvents - Emitter of events for the container runtime.\n * @param logger - Telemetry logger to write events to.\n */\nexport function ReportOpPerfTelemetry(\n\tclientId: string | undefined,\n\tdeltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\tcontainerRuntimeEvents: IEventProvider<IContainerRuntimeEvents>,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tnew OpPerfTelemetry(clientId, deltaManager, containerRuntimeEvents, logger);\n}\n"]}
1
+ {"version":3,"file":"connectionTelemetry.js","sourceRoot":"","sources":["../src/connectionTelemetry.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA2D;AAI3D,2DAAoD;AACpD,+EAI8C;AAC9C,qEAOyC;AAEzC;;GAEG;AACU,QAAA,gBAAgB,GAAG,IAAI,CAAC;AAgCrC,MAAM,eAAe;IA+BpB;;;;;;;OAOG;IACH;IACC;;;;;;OAMG;IACK,QAA4B;IACpC;;OAEG;IACc,YAAwE;IACzF;;OAEG;IACH,sBAA+D;IAC/D;;OAEG;IACH,MAA2B;QAZnB,aAAQ,GAAR,QAAQ,CAA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F,CAAC;;AArSuB,sCAAsB,GAAG,GAAG,AAAN,CAAO;AAG7B,yCAAyB,GAAG,GAAG,AAAN,CAAO;AA0TzD;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CACpC,QAA4B,EAC5B,YAAwE,EACxE,sBAA+D,EAC/D,MAA2B;IAE3B,IAAI,eAAe,CAAC,QAAQ,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,CAAC,CAAC;AAC7E,CAAC;AAPD,sDAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performance } from \"@fluid-internal/client-utils\";\nimport { IDeltaManager } from \"@fluidframework/container-definitions\";\nimport { IContainerRuntimeEvents } from \"@fluidframework/container-runtime-definitions\";\nimport { IEventProvider } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tMessageType,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n\tIEventSampler,\n\tISampledTelemetryLogger,\n\tITelemetryLoggerExt,\n\tcreateChildLogger,\n\tcreateSampledLogger,\n\tformatTick,\n} from \"@fluidframework/telemetry-utils\";\n\n/**\n * We report various latency-related errors when waiting for op roundtrip takes longer than that amout of time.\n */\nexport const latencyThreshold = 5000;\n\n// Phases in OpPerfTelemetry:\n// 1.\tOp is added to DeltaManager (DM) buffer.\n// 2.\tOp is sent to service (op leaves outbound queue).\n// \t - Note: We do not know for sure when op is sent, we only track when it is added to outbound queue.\n// If outbound queue is paused, time queue is paused is counted as network time.\n// 3.\tOp received from service back (pushed to inbound queue).\n// 4.\tOp is processed.\ninterface IOpPerfTelemetryProperties {\n\t/** Measure time between (1) and (2) - Measure time outbound op is sitting in queue due to active batch */\n\tdurationOutboundBatching: number; // was durationOutboundQueue in previous versions\n\t/** Measure time between (2) and (3) - Track how long it took for op to be acked by service */\n\tdurationNetwork: number; // was durationInboundQueue\n\t/** Measure time between (3) and (4) - Time between DM's inbound \"push\" event until DM's \"op\" event */\n\tdurationInboundToProcessing: number;\n\t/** Length of the DeltaManager's inbound queue at the time of the DM's inbound \"push\" event (3) */\n\tlengthInboundQueue: number;\n}\n\n/**\n * Timings collected at various moments during the op processing.\n */\ninterface IOpPerfTimings {\n\t/** Starting time for (1) */\n\tsubmitOpEventTime: number;\n\t/** Starting time for (2) */\n\toutboundPushEventTime: number;\n\t/** Starting time for (3) */\n\tinboundPushEventTime: number;\n}\n\nclass OpPerfTelemetry {\n\tprivate pingLatency: number | undefined;\n\n\t// Collab window tracking. This is timestamp of %1000 message.\n\tprivate sequenceNumberForMsnTracking: number | undefined;\n\tprivate msnTrackingTimestamp: number = 0;\n\t// To track round trip time for every %500 client message.\n\tprivate clientSequenceNumberForLatencyStatistics: number | undefined;\n\t// Performance Data to be reported for ops round trips and processing.\n\tprivate readonly latencyStatistics = new Map<\n\t\tnumber,\n\t\t{\n\t\t\topProcessingTimes: Partial<IOpPerfTimings>;\n\t\t\topPerfData: Partial<IOpPerfTelemetryProperties>;\n\t\t}\n\t>();\n\n\tprivate firstConnection = true;\n\tprivate connectionOpSeqNumber: number | undefined;\n\tprivate readonly bootTime = performance.now();\n\tprivate connectionStartTime = 0;\n\tprivate gap = 0;\n\n\tprivate readonly logger: ITelemetryLoggerExt;\n\n\tprivate static readonly OP_LATENCY_SAMPLE_RATE = 500;\n\tprivate readonly opLatencyLogger: ISampledTelemetryLogger;\n\n\tprivate static readonly DELTA_LATENCY_SAMPLE_RATE = 100;\n\tprivate readonly deltaLatencyLogger: ISampledTelemetryLogger;\n\n\t/**\n\t * Create an instance of OpPerfTelemetry which starts monitoring and generating telemetry related to op performance.\n\t *\n\t * @param clientId - The clientId of the current container.\n\t * @param deltaManager - DeltaManager instance to monitor.\n\t * @param containerRuntimeEvents - Emitter of events for the container runtime.\n\t * @param logger - Telemetry logger to write events to.\n\t */\n\tpublic constructor(\n\t\t/**\n\t\t * The clientId of the current container.\n\t\t *\n\t\t * @remarks Until the container connects to the server and receives an ack for its own join op, this can be undefined.\n\t\t * It gets updated in response to event changes once the value provided by the server is available.\n\t\t * If the container loses its connection, this could be the last known clientId.\n\t\t */\n\t\tprivate clientId: string | undefined,\n\t\t/**\n\t\t * DeltaManager instance to monitor.\n\t\t */\n\t\tprivate readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\t\t/**\n\t\t * Emitter of events for the container runtime.\n\t\t */\n\t\tcontainerRuntimeEvents: IEventProvider<IContainerRuntimeEvents>,\n\t\t/**\n\t\t * Telemetry logger to write events to.\n\t\t */\n\t\tlogger: ITelemetryLoggerExt,\n\t) {\n\t\tthis.logger = createChildLogger({ logger, namespace: \"OpPerf\" });\n\n\t\tconst deltaLatencyEventSampler: IEventSampler = (() => {\n\t\t\tlet eventCount = -1;\n\t\t\treturn {\n\t\t\t\tsample: () => {\n\t\t\t\t\teventCount++;\n\t\t\t\t\tconst shouldSample =\n\t\t\t\t\t\teventCount % OpPerfTelemetry.DELTA_LATENCY_SAMPLE_RATE === 0;\n\t\t\t\t\tif (shouldSample) {\n\t\t\t\t\t\teventCount = 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn shouldSample;\n\t\t\t\t},\n\t\t\t};\n\t\t})();\n\n\t\tthis.deltaLatencyLogger = createSampledLogger(logger, deltaLatencyEventSampler);\n\n\t\t// The SampledLogger here is used get access to the isSamplingDisabled property derived from\n\t\t// telemetry config properties. The actual sampling logic for op messages happens outside this SampledLogger\n\t\t// due to complexity of the different asynchronus scenarios of the op message lifecycle.\n\t\tthis.opLatencyLogger = createSampledLogger(logger);\n\n\t\tthis.deltaManager.on(\"pong\", (latency) => this.recordPingTime(latency));\n\t\tthis.deltaManager.on(\"submitOp\", (message) => this.beforeOpSubmit(message));\n\n\t\tthis.deltaManager.on(\"op\", (message) => this.afterProcessingOp(message));\n\n\t\tthis.deltaManager.on(\"connect\", (details, opsBehind) => {\n\t\t\tif (opsBehind !== undefined) {\n\t\t\t\tthis.connectionOpSeqNumber = this.deltaManager.lastKnownSeqNumber;\n\t\t\t\tthis.gap = opsBehind;\n\t\t\t\tthis.connectionStartTime = performance.now();\n\n\t\t\t\t// We might be already up-today. If so, report it right away.\n\t\t\t\tif (this.gap <= 0) {\n\t\t\t\t\tthis.reportGettingUpToDate();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.deltaManager.on(\"disconnect\", () => {\n\t\t\tthis.sequenceNumberForMsnTracking = undefined;\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = undefined;\n\t\t\tthis.connectionOpSeqNumber = undefined;\n\t\t\tthis.firstConnection = false;\n\t\t\tthis.latencyStatistics.clear();\n\t\t});\n\n\t\tthis.deltaManager.outbound.on(\"push\", (messages) => {\n\t\t\tfor (const msg of messages) {\n\t\t\t\tif (\n\t\t\t\t\tmsg.type === MessageType.Operation &&\n\t\t\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === msg.clientSequenceNumber)\n\t\t\t\t) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tconst latencyStats = this.latencyStatistics.get(msg.clientSequenceNumber)!;\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats !== undefined,\n\t\t\t\t\t\t0x7c2 /* Latency stats for op should exist */,\n\t\t\t\t\t);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime === undefined,\n\t\t\t\t\t\t0x2c8 /* \"outboundPushEventTime should be undefined\" */,\n\t\t\t\t\t);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opPerfData.durationNetwork === undefined,\n\t\t\t\t\t\t0x2c9 /* \"durationNetwork should be undefined\" */,\n\t\t\t\t\t);\n\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime = Date.now();\n\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opPerfData.durationOutboundBatching === undefined,\n\t\t\t\t\t\t0x2ca /* \"durationOutboundBatching should be undefined\" */,\n\t\t\t\t\t);\n\n\t\t\t\t\tassert(\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.submitOpEventTime !== undefined,\n\t\t\t\t\t\t0x2cb /* \"submitOpEventTime should be undefined\" */,\n\t\t\t\t\t);\n\n\t\t\t\t\tlatencyStats.opPerfData.durationOutboundBatching =\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime -\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.submitOpEventTime;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tthis.deltaManager.inbound.on(\"push\", (message: ISequencedDocumentMessage) => {\n\t\t\tif (\n\t\t\t\tthis.clientId === message.clientId &&\n\t\t\t\tmessage.type === MessageType.Operation &&\n\t\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber)\n\t\t\t) {\n\t\t\t\t// We do an explicit check for undefined right after this\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tconst latencyStats = this.latencyStatistics.get(message.clientSequenceNumber)!;\n\t\t\t\tassert(latencyStats !== undefined, 0x7c3 /* Latency stats for op should exist */);\n\t\t\t\tif (latencyStats.opProcessingTimes.outboundPushEventTime !== undefined) {\n\t\t\t\t\tlatencyStats.opProcessingTimes.inboundPushEventTime = Date.now();\n\t\t\t\t\tlatencyStats.opPerfData.durationNetwork =\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.inboundPushEventTime -\n\t\t\t\t\t\tlatencyStats.opProcessingTimes.outboundPushEventTime;\n\t\t\t\t\tlatencyStats.opPerfData.lengthInboundQueue = this.deltaManager.inbound.length;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tthis.deltaManager.inbound.on(\"idle\", (count: number, duration: number) => {\n\t\t\t// Do not want to log zero for sure.\n\t\t\t// We are more interested in aggregates, so logging only if we are processing some number of ops\n\t\t\t// Cut-off is arbitrary - can be increased or decreased based on amount of data collected and questions we\n\t\t\t// want to get answered\n\t\t\t// back-compat: Once 0.36 loader version saturates (count & duration args were added there),\n\t\t\t// we can remove typeof check.\n\t\t\tif (typeof count === \"number\" && count >= 100) {\n\t\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\t\teventName: \"GetDeltas_OpProcessing\",\n\t\t\t\t\tcount,\n\t\t\t\t\tduration,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tcontainerRuntimeEvents.on(\"connected\", (newClientId) => {\n\t\t\tthis.clientId = newClientId;\n\t\t});\n\t}\n\n\tprivate reportGettingUpToDate() {\n\t\tthis.connectionOpSeqNumber = undefined;\n\t\tthis.logger.sendPerformanceEvent({\n\t\t\teventName: \"ConnectionSpeed\",\n\t\t\tduration: performance.now() - this.connectionStartTime,\n\t\t\tops: this.gap,\n\t\t\t// track time to connect only for first connection.\n\t\t\ttimeToConnect: this.firstConnection\n\t\t\t\t? formatTick(this.connectionStartTime - this.bootTime)\n\t\t\t\t: undefined,\n\t\t\tfirstConnection: this.firstConnection,\n\t\t});\n\t}\n\n\tprivate recordPingTime(latency: number) {\n\t\tthis.pingLatency = latency;\n\n\t\t// Log if latency is longer than 1 min\n\t\tif (latency > 1000 * 60) {\n\t\t\tthis.logger.sendErrorEvent({\n\t\t\t\teventName: \"LatencyTooLong\",\n\t\t\t\tduration: latency,\n\t\t\t});\n\t\t}\n\n\t\t// logging one in every DELTA_LATENCY_SAMPLE_RATE pongs, including the first time, if it is a \"write\" client.\n\t\tif (this.deltaManager.active) {\n\t\t\tthis.deltaLatencyLogger.sendPerformanceEvent({\n\t\t\t\teventName: \"DeltaLatency\",\n\t\t\t\tduration: latency,\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate beforeOpSubmit(message: IDocumentMessage) {\n\t\t// start with first client op and measure latency every 500 client ops\n\t\tif (\n\t\t\tthis.opLatencyLogger.isSamplingDisabled ||\n\t\t\t(this.clientSequenceNumberForLatencyStatistics === undefined &&\n\t\t\t\tmessage.clientSequenceNumber % OpPerfTelemetry.OP_LATENCY_SAMPLE_RATE === 1)\n\t\t) {\n\t\t\tassert(\n\t\t\t\tthis.latencyStatistics.get(message.clientSequenceNumber) === undefined,\n\t\t\t\t0x7c4 /* Existing op perf data for client sequence number */,\n\t\t\t);\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = message.clientSequenceNumber;\n\t\t\tthis.latencyStatistics.set(message.clientSequenceNumber, {\n\t\t\t\topProcessingTimes: {\n\t\t\t\t\tsubmitOpEventTime: Date.now(),\n\t\t\t\t},\n\t\t\t\topPerfData: {},\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate afterProcessingOp(message: ISequencedDocumentMessage) {\n\t\tconst sequenceNumber = message.sequenceNumber;\n\n\t\tif (sequenceNumber === this.connectionOpSeqNumber) {\n\t\t\tthis.reportGettingUpToDate();\n\t\t}\n\n\t\t// Record collab window max size after every 1000th op.\n\t\tif (this.sequenceNumberForMsnTracking === undefined && sequenceNumber % 1000 === 0) {\n\t\t\tthis.sequenceNumberForMsnTracking = sequenceNumber;\n\t\t\tthis.msnTrackingTimestamp = message.timestamp;\n\t\t}\n\t\tif (\n\t\t\tthis.sequenceNumberForMsnTracking !== undefined &&\n\t\t\tmessage.minimumSequenceNumber >= this.sequenceNumberForMsnTracking\n\t\t) {\n\t\t\tassert(\n\t\t\t\tthis.msnTrackingTimestamp !== undefined,\n\t\t\t\t0x2ce /* \"msnTrackingTimestamp should not be undefined\" */,\n\t\t\t);\n\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\teventName: \"MsnStatistics\",\n\t\t\t\tsequenceNumber,\n\t\t\t\tmsnDistance: sequenceNumber - this.sequenceNumberForMsnTracking,\n\t\t\t\tduration: message.timestamp - this.msnTrackingTimestamp,\n\t\t\t});\n\t\t\tthis.sequenceNumberForMsnTracking = undefined;\n\t\t}\n\n\t\tif (\n\t\t\tthis.clientId === message.clientId &&\n\t\t\t(this.opLatencyLogger.isSamplingDisabled ||\n\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber)\n\t\t) {\n\t\t\t// We do an explicit check for undefined right after this\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst latencyData = this.latencyStatistics.get(message.clientSequenceNumber)!;\n\t\t\tassert(latencyData !== undefined, 0x7c5 /* Undefined latency statistics for op */);\n\t\t\tassert(\n\t\t\t\tlatencyData.opProcessingTimes.submitOpEventTime !== undefined,\n\t\t\t\t0x120 /* \"Undefined latency statistics for op (op send time)\" */,\n\t\t\t);\n\t\t\tconst currentTime = Date.now();\n\t\t\tif (latencyData.opProcessingTimes.inboundPushEventTime !== undefined) {\n\t\t\t\tlatencyData.opPerfData.durationInboundToProcessing =\n\t\t\t\t\tcurrentTime - latencyData.opProcessingTimes.inboundPushEventTime;\n\t\t\t}\n\t\t\tconst duration = currentTime - latencyData.opProcessingTimes.submitOpEventTime;\n\n\t\t\t// One of the core expectations for Fluid service is to be fast.\n\t\t\t// When it's not the case, we want to learn about it and be able to investigate, so\n\t\t\t// raise awareness.\n\t\t\t// This also helps identify cases where it's due to client behavior (sending too many ops)\n\t\t\t// that results in overwhelming ordering service and thus starting to see long latencies.\n\t\t\t// The threshold could be adjusted, but ideally it stays workload-agnostic, as service\n\t\t\t// performance impacts all workloads relying on service.\n\t\t\tconst category = duration > latencyThreshold ? \"error\" : \"performance\";\n\t\t\tthis.opLatencyLogger.sendPerformanceEvent({\n\t\t\t\teventName: \"OpRoundtripTime\",\n\t\t\t\tsequenceNumber,\n\t\t\t\treferenceSequenceNumber: message.referenceSequenceNumber,\n\t\t\t\tduration,\n\t\t\t\tcategory,\n\t\t\t\tpingLatency: this.pingLatency,\n\t\t\t\tmsnDistance:\n\t\t\t\t\tthis.deltaManager.lastSequenceNumber - this.deltaManager.minimumSequenceNumber,\n\t\t\t\t...latencyData.opPerfData,\n\t\t\t});\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = undefined;\n\t\t\tthis.latencyStatistics.delete(message.clientSequenceNumber);\n\t\t}\n\t}\n}\nexport interface IPerfSignalReport {\n\t/**\n\t * Identifier for the signal being submitted in order to\n\t * allow collection of data around the roundtrip of signal messages.\n\t */\n\tsignalSequenceNumber: number;\n\t/**\n\t * Number of signals that were expected but not received.\n\t */\n\tsignalsLost: number;\n\n\t/**\n\t * Timestamp before submitting the signal we will trace.\n\t */\n\tsignalTimestamp: number;\n\n\t/**\n\t * Expected Signal Sequence to be received.\n\t */\n\ttrackingSignalSequenceNumber: number | undefined;\n}\n\n/**\n * Starts monitoring and generation of telemetry related to op performance.\n *\n * @param clientId - The clientId of the current container.\n * @param deltaManager - DeltaManager instance to monitor.\n * @param containerRuntimeEvents - Emitter of events for the container runtime.\n * @param logger - Telemetry logger to write events to.\n */\nexport function ReportOpPerfTelemetry(\n\tclientId: string | undefined,\n\tdeltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\tcontainerRuntimeEvents: IEventProvider<IContainerRuntimeEvents>,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tnew OpPerfTelemetry(clientId, deltaManager, containerRuntimeEvents, logger);\n}\n"]}
@@ -99,6 +99,10 @@ export declare enum ContainerMessageType {
99
99
  * See the [IdCompressor README](./id-compressor/README.md) for more details.
100
100
  */
101
101
  IdAllocation = "idAllocation",
102
+ /**
103
+ * An op that changes document schema
104
+ */
105
+ DocumentSchemaChange = "schema",
102
106
  /**
103
107
  * Garbage collection specific op. This is sent by the summarizer client when GC runs. It's used to synchronize GC
104
108
  * state across all clients.
@@ -119,7 +123,7 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
119
123
  readonly logger: ITelemetryLoggerExt;
120
124
  private readonly _storage;
121
125
  private readonly createIdCompressor;
122
- private readonly idCompressorMode;
126
+ private readonly documentsSchemaController;
123
127
  private readonly requestHandler?;
124
128
  private readonly summaryConfiguration;
125
129
  /**
@@ -169,9 +173,16 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
169
173
  get IFluidDataStoreRegistry(): IFluidDataStoreRegistry;
170
174
  private readonly _getAttachState;
171
175
  get attachState(): AttachState;
176
+ get documentSchema(): {
177
+ explicitSchemaControl?: true | undefined;
178
+ compressionLz4?: true | undefined;
179
+ idCompressorMode?: IdCompressorMode;
180
+ opGroupingEnabled?: true | undefined;
181
+ };
172
182
  private _idCompressor;
173
183
  private pendingIdCompressorOps;
174
184
  private readonly skipSavedCompressorOps;
185
+ get idCompressorMode(): IdCompressorMode;
175
186
  /**
176
187
  * See IContainerRuntimeBase.idCompressor() for details.
177
188
  */
@@ -180,7 +191,7 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
180
191
  * True if we have ID compressor loading in-flight (async operation). Useful only for
181
192
  * this.idCompressorMode === "delayed" mode
182
193
  */
183
- protected compressorLoadInitiated: boolean;
194
+ protected _loadIdCompressor: Promise<void> | undefined;
184
195
  /**
185
196
  * See IContainerRuntimeBase.generateDocumentUniqueId() for details.
186
197
  */
@@ -311,7 +322,8 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
311
322
  */
312
323
  private readonly snapshotCacheForLoadingGroupIds;
313
324
  /***/
314
- protected constructor(context: IContainerContext, registry: IFluidDataStoreRegistry, metadata: IContainerRuntimeMetadata | undefined, electedSummarizerData: ISerializedElection | undefined, chunks: [string, string[]][], dataStoreAliasMap: [string, string][], runtimeOptions: Readonly<Required<IContainerRuntimeOptions>>, containerScope: FluidObject, logger: ITelemetryLoggerExt, existing: boolean, blobManagerSnapshot: IBlobManagerLoadInfo, _storage: IDocumentStorageService, createIdCompressor: () => Promise<IIdCompressor & IIdCompressorCore>, idCompressorMode: IdCompressorMode, provideEntryPoint: (containerRuntime: IContainerRuntime) => Promise<FluidObject>, requestHandler?: ((request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>) | undefined, summaryConfiguration?: ISummaryConfiguration);
325
+ protected constructor(context: IContainerContext, registry: IFluidDataStoreRegistry, metadata: IContainerRuntimeMetadata | undefined, electedSummarizerData: ISerializedElection | undefined, chunks: [string, string[]][], dataStoreAliasMap: [string, string][], runtimeOptions: Readonly<Required<IContainerRuntimeOptions>>, containerScope: FluidObject, logger: ITelemetryLoggerExt, existing: boolean, blobManagerSnapshot: IBlobManagerLoadInfo, _storage: IDocumentStorageService, createIdCompressor: () => Promise<IIdCompressor & IIdCompressorCore>, documentsSchemaController: DocumentsSchemaController, featureGatesForTelemetry: Record<string, boolean | number | undefined>, provideEntryPoint: (containerRuntime: IContainerRuntime) => Promise<FluidObject>, requestHandler?: ((request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>) | undefined, summaryConfiguration?: ISummaryConfiguration);
326
+ onSchemaChange(schema: IDocumentSchemaCurrent): void;
315
327
  getCreateChildSummarizerNodeFn(id: string, createParam: CreateChildSummarizerNodeParam): (summarizeInternal: SummarizeInternalFn, getGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>) => ISummarizerNodeWithGC;
316
328
  deleteChildSummarizerNode(id: string): void;
317
329
  makeLocallyVisible(): void;
@@ -369,6 +381,7 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
369
381
  */
370
382
  private parseLocalOpContent;
371
383
  private applyStashedOp;
384
+ private loadIdCompressor;
372
385
  setConnectionState(connected: boolean, clientId?: string): void;
373
386
  private setConnectionStateCore;
374
387
  notifyOpReplay(message: ISequencedDocumentMessage): Promise<void>;
@@ -622,6 +635,15 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
622
635
 
623
636
  /* Excluded from this release type: ContainerRuntimeMessage */
624
637
 
638
+ /**
639
+ * Current version known properties that define document schema
640
+ * This must be bumped whenever the format of document schema or protocol for changing the current document schema changes.
641
+ * Ex: adding a new configuration property (under IDocumentSchema.runtime) does not require changing this version.
642
+ * Ex: Changing the 'document schema acceptance' mechanism from convert-and-swap to one requiring consensus does require changing this version.
643
+ * @alpha
644
+ */
645
+ export declare const currentDocumentVersionSchema = 1;
646
+
625
647
  /* Excluded from this release type: DataStoreContexts */
626
648
 
627
649
  /**
@@ -631,6 +653,102 @@ export declare const DefaultSummaryConfiguration: ISummaryConfiguration;
631
653
 
632
654
  /* Excluded from this release type: detectOutboundReferences */
633
655
 
656
+ /** @alpha */
657
+ export declare const disabledCompressionConfig: ICompressionRuntimeOptions;
658
+
659
+ /**
660
+ * Descripe allowed type for properties in document schema.
661
+ * Please note that for all property types we should use undefined to indicate that particular capability is off.
662
+ * Using false, or some string value (like "off") will result in clients who do not understand that property failing, whereas
663
+ * we want them to continue to collaborate alongside clients who support that capability, but such capability is shipping dark for now.
664
+ * @alpha
665
+ */
666
+ export declare type DocumentSchemaValueType = string | true | number | undefined;
667
+
668
+ /**
669
+ * Controller of document schema.
670
+ *
671
+ * Recommended pre-reading: https://github.com/microsoft/FluidFramework/blob/main/packages/dds/SchemaVersioning.md
672
+ *
673
+ * This class manages current document schema and transitions between document schemas.
674
+ * At the moment, it only focuses on subset of document schema, specifically - how FluidFramework runtime serializes data
675
+ * (summary and op format), features & capabilities that a version of runtime has to support and understand in
676
+ * order to collaborate on a document.
677
+ * New features that modify document format have to be included in document schema definition.
678
+ * Usage of such features could only happen after document schema has been updated to reflect such feature.
679
+ *
680
+ * This formality allows clients that do not understand such features to fail right away when they observe
681
+ * document schema listing capabilities that such client does not understand.
682
+ * Old clients will fail in predictable way. This allows us to
683
+ * 1) Immediately see such issues and adjust if features are enabled too early, before changes have been saturated.
684
+ * 2) There is no way to get to 100% saturation with new code. Even if we have 99.99% saturation, there are
685
+ * still 0.01% of clients who will fail. Failing early and predictably ensures they have no chance to limp along
686
+ * and potentially corrupt the document. This is especially true for summarizer client, who could simply "undo"
687
+ * changes it does not understands.
688
+ *
689
+ * It's important to note how it overlaps with feature gates and safe velocity.
690
+ * If new feature was in use, that resulted in a number of documents referencing such feature in document schema.
691
+ * But, developers (through code deployment or feature gates) could disable usage of such features.
692
+ * That will stop a process of further document schema changes (for documents that were not using such feature).
693
+ * And documents that already list such capability in their schema will continue to do so. Later ensures that old
694
+ * clients who do not understand such feature will continue to fail to open such documents, as such documents very
695
+ * likely contain data in a new format.
696
+ *
697
+ * Users of this class need to use DocumentsSchemaController.sessionSchema to determine what features can be used.
698
+ *
699
+ * There are two modes this class can operate:
700
+ * 1) Legacy mode. In such mode it does not issue any ops to change document schema. Any changes happen implicitly,
701
+ * right away, and new features are available right away
702
+ * 2) Non-legacy mode. In such mode any changes to schema require an op roundtrip. This class will manage such transitions.
703
+ * However code should assume that any new features that were not enabled in a given document will not be available
704
+ * for a given session. That's because this session may never send any ops (including read-only documents). Or it may
705
+ * fail to convert schema.
706
+ * This class promises eventual movement forward. I.e. if new feature is allowed (let's say - through feature gates),
707
+ * then eventually all documents that are modified will have that feature reflected in their schema. It could require
708
+ * multiple reloads / new sessions to get there (depends on if code reacts to schema changes right away, or only consults
709
+ * schema on document load).
710
+ *
711
+ * How schemas are changed (in non-legacy mode):
712
+ * If a client needs to change a schema, it will attempt to do so as part of normal ops sending process.
713
+ * Changes happen in CAS (Compare-and-swap) fashion, i.e. client tells current schema and schema it wants to change to.
714
+ * When a number of clients race to change a schema, then only one of them will win, all others will fail because they will
715
+ * reference old schema that is no longer in effect.
716
+ * Clients can retry, but current implementation is simply - they will not (and will rely on next session / reload to do
717
+ * recalc and decide if schema needs to be changed or not).
718
+ *
719
+ * @alpha
720
+ */
721
+ export declare class DocumentsSchemaController {
722
+ private readonly onSchemaChange;
723
+ private explicitSchemaControl;
724
+ private sendOp;
725
+ private documentSchema;
726
+ private readonly desiredSchema;
727
+ private futureSchema;
728
+ sessionSchema: IDocumentSchemaCurrent;
729
+ /**
730
+ * Constructs DocumentsSchemaController that controls current schema and processes around it, including changes in schema.
731
+ * @param explicitSchemaControl - Tells if schema changes are done implicitly (without ops - legacy behavior), or go through formal schema change ops process.
732
+ * @param existing - Is the document existing document, or a new doc.
733
+ * @param documentMetadataSchema - current document's schema, if present.
734
+ * @param compressionAlgorithm - desired compression algorith to use
735
+ * @param idCompressorModeArg - desired ID compressor mode to use
736
+ * @param opGroupingEnabled - true if it's desired to use op grouping.
737
+ */
738
+ constructor(existing: boolean, documentMetadataSchema: IDocumentSchema | undefined, features: IDocumentSchemaFeatures, onSchemaChange: (schema: IDocumentSchemaCurrent) => void);
739
+ summarizeDocumentSchema(refSeq: number): IDocumentSchemaCurrent | undefined;
740
+ onMessageSent(send: (content: IDocumentSchemaChangeMessage) => void): void;
741
+ /**
742
+ * Process document schema change message
743
+ * @param content - content of the message
744
+ * @param local - whether op is local
745
+ * @param sequenceNumber - sequence number of the op
746
+ * @returns - true if schema was accepted, otherwise false (rejected due to failed CAS)
747
+ */
748
+ processDocumentSchemaOp(content: IDocumentSchemaChangeMessage, local: boolean, sequenceNumber: number): boolean;
749
+ onDisconnect(): void;
750
+ }
751
+
634
752
  /**
635
753
  * @alpha
636
754
  */
@@ -819,16 +937,17 @@ export declare interface IConnectableRuntime {
819
937
  */
820
938
  export declare interface IContainerRuntimeMetadata extends ICreateContainerMetadata, IGCMetadata {
821
939
  readonly summaryFormatVersion: 1;
940
+ /** @deprecated - used by old (prior to 2.0 RC3) runtimes */
941
+ readonly message?: ISummaryMetadataMessage;
822
942
  /** The last message processed at the time of summary. Only primitive property types are added to the summary. */
823
- readonly message: ISummaryMetadataMessage | undefined;
943
+ readonly lastMessage?: ISummaryMetadataMessage;
824
944
  /** True if channels are not isolated in .channels subtrees, otherwise isolated. */
825
945
  readonly disableIsolatedChannels?: true;
826
946
  /** The summary number for a container's summary. Incremented on summaries throughout its lifetime. */
827
947
  readonly summaryNumber?: number;
828
948
  /** GUID to identify a document in telemetry */
829
949
  readonly telemetryDocumentId?: string;
830
- /** True if the runtime IdCompressor is enabled */
831
- readonly idCompressorMode?: IdCompressorMode;
950
+ readonly documentSchema?: IDocumentSchema;
832
951
  }
833
952
 
834
953
  /**
@@ -862,7 +981,7 @@ export declare interface IContainerRuntimeOptions {
862
981
  * If specified, when in FlushMode.TurnBased, if the size of the ops between JS turns exceeds this value,
863
982
  * an error will be thrown and the container will close.
864
983
  *
865
- * If unspecified, the limit is 950 * 1024.
984
+ * If unspecified, the limit is 700Kb.
866
985
  *
867
986
  * 'Infinity' will disable any limit.
868
987
  *
@@ -909,6 +1028,14 @@ export declare interface IContainerRuntimeOptions {
909
1028
  * @experimental Not ready for use.
910
1029
  */
911
1030
  readonly enableGroupedBatching?: boolean;
1031
+ /**
1032
+ * When this property is set to true, it requires runtime to control is document schema properly through ops
1033
+ * The benefit of this mode is that clients who do not understand schema will fail in predictable way, with predictable message,
1034
+ * and will not attempt to limp along, which could cause data corruptions and crashes in random places.
1035
+ * When this property is not set (or set to false), runtime operates in legacy mode, where new features (modifying document schema)
1036
+ * are engaged as they become available, without giving legacy clients any chance to fail predictably.
1037
+ */
1038
+ readonly explicitSchemaControl?: boolean;
912
1039
  }
913
1040
 
914
1041
  /**
@@ -928,12 +1055,81 @@ export declare interface ICreateContainerMetadata {
928
1055
  * "delayed" - ID compressor bundle is loaded only on establishing of first delta connection, i.e. it does not impact boot of cotnainer.
929
1056
  * In such mode IContainerRuntime.idCompressor is not made available (unless previous sessions of same document had it "On").
930
1057
  * The only thing that is available is IContainerRuntime.generateDocumentUniqueId() that provides opportunistically short IDs.
931
- * "off" - ID compressor is not laoded (unless it is "on" due to previous session for same document having it "on").
1058
+ * undefined - ID compressor is not loaded.
932
1059
  * While IContainerRuntime.generateDocumentUniqueId() is available, it will produce long IDs that are do not compress well.
933
1060
  *
934
1061
  * @alpha
935
1062
  */
936
- export declare type IdCompressorMode = "on" | "delayed" | "off";
1063
+ export declare type IdCompressorMode = "on" | "delayed" | undefined;
1064
+
1065
+ /**
1066
+ * Document schema information.
1067
+ * Describes overall shape of document schema, including unknown (to this version) properties.
1068
+ *
1069
+ * Used by runtime to make a call if it can understand document schema.
1070
+ * If it can't, it should not continue with document and immediately fail, preventing random (cryptic) failures
1071
+ * down the road and potentially corrupting documents.
1072
+ * For now this structure and appropriate interpretation / behavior is focused only on runtime features.
1073
+ * In the future that could be interpolated to more areas, including DDSs used, and even possibly - application
1074
+ * schema.
1075
+ *
1076
+ * Runtime will ignore any properties at the root that it does not understand (i.e. IDocumentSchema.app), but will
1077
+ * stop (and fail session) on any unknown properties within "runtime" sub-tree.
1078
+ *
1079
+ * In most cases values preserved in the document will not dictate if such features should be enabled in a given session.
1080
+ * I.e. if compression is mentioned in document schema, this means that runtime version that opens such document must know
1081
+ * how to interpret such ops, but does not need to actually use compression itself. That said, some options could be
1082
+ * sticky, i.e. influence feature selection for all runtimes opening a document. ID compression is one such example.
1083
+ * Currently there is no mechanism to remove feature from this property bag, i.e. once compression was used, even if it's
1084
+ * disabled (through feature gate or code deployment), all existing documents that used compression will continue to fail
1085
+ * if opened by clients who do not support compression.
1086
+ *
1087
+ * For now we are limiting it to just plain properties, and only really simple types, but that can be changed in the future.
1088
+ *
1089
+ * @alpha
1090
+ */
1091
+ export declare interface IDocumentSchema {
1092
+ version: number;
1093
+ refSeq: number;
1094
+ runtime: Record<string, DocumentSchemaValueType>;
1095
+ }
1096
+
1097
+ /**
1098
+ * Content of the type=ContainerMessageType.DocumentSchemaChange ops.
1099
+ * The meaning of refSeq field is different in such messages (compared to other usages of IDocumentSchemaCurrent)
1100
+ * ContainerMessageType.DocumentSchemaChange messages use CAS (Compare-and-swap) semantics, and convey
1101
+ * regSeq of last known schema change (known to a client proposing schema change).
1102
+ * @see ContainerRuntimeDocumentSchemaMessage
1103
+ * @alpha
1104
+ */
1105
+ export declare type IDocumentSchemaChangeMessage = IDocumentSchema;
1106
+
1107
+ /**
1108
+ * Current document schema.
1109
+ * @alpha
1110
+ */
1111
+ export declare type IDocumentSchemaCurrent = {
1112
+ version: 1;
1113
+ refSeq: number;
1114
+ runtime: {
1115
+ [P in keyof IDocumentSchemaFeatures]?: IDocumentSchemaFeatures[P] extends boolean ? true : IDocumentSchemaFeatures[P];
1116
+ };
1117
+ };
1118
+
1119
+ /**
1120
+ * Settings that this session would like to have, based on options and feature gates.
1121
+ *
1122
+ * WARNING: This type is used to infer IDocumentSchemaCurrent type!
1123
+ * Any changes here (including renaming of properties) are potentially changing document format and should be considered carefully!
1124
+ *
1125
+ * @alpha
1126
+ */
1127
+ export declare interface IDocumentSchemaFeatures {
1128
+ explicitSchemaControl: boolean;
1129
+ compressionLz4: boolean;
1130
+ idCompressorMode: IdCompressorMode;
1131
+ opGroupingEnabled: boolean;
1132
+ }
937
1133
 
938
1134
  /**
939
1135
  * Options to use when enqueueing a summarize attempt.
@@ -1563,8 +1759,6 @@ export declare type OpActionEventName = MessageType.Summarize | MessageType.Summ
1563
1759
 
1564
1760
  /* Excluded from this release type: RuntimeHeaders */
1565
1761
 
1566
- /* Excluded from this release type: RuntimeMessage */
1567
-
1568
1762
  /**
1569
1763
  * The data in summarizer result when submit summary stage fails.
1570
1764
  * @alpha
@@ -88,12 +88,20 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
88
88
 
89
89
  /* Excluded from this release type: CreateChildSummarizerNodeParam */
90
90
 
91
+ /* Excluded from this release type: currentDocumentVersionSchema */
92
+
91
93
  /* Excluded from this release type: DataStoreContexts */
92
94
 
93
95
  /* Excluded from this release type: DefaultSummaryConfiguration */
94
96
 
95
97
  /* Excluded from this release type: detectOutboundReferences */
96
98
 
99
+ /* Excluded from this release type: disabledCompressionConfig */
100
+
101
+ /* Excluded from this release type: DocumentSchemaValueType */
102
+
103
+ /* Excluded from this release type: DocumentsSchemaController */
104
+
97
105
  /* Excluded from this release type: EnqueueSummarizeResult */
98
106
 
99
107
  /* Excluded from this release type: FluidDataStoreContext */
@@ -152,6 +160,14 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
152
160
 
153
161
  /* Excluded from this release type: IdCompressorMode */
154
162
 
163
+ /* Excluded from this release type: IDocumentSchema */
164
+
165
+ /* Excluded from this release type: IDocumentSchemaChangeMessage */
166
+
167
+ /* Excluded from this release type: IDocumentSchemaCurrent */
168
+
169
+ /* Excluded from this release type: IDocumentSchemaFeatures */
170
+
155
171
  /* Excluded from this release type: IDocumentStorageService */
156
172
 
157
173
  /* Excluded from this release type: IEnqueueSummarizeOptions */
@@ -288,8 +304,6 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
288
304
 
289
305
  /* Excluded from this release type: RuntimeHeaders */
290
306
 
291
- /* Excluded from this release type: RuntimeMessage */
292
-
293
307
  /* Excluded from this release type: SubmitSummaryFailureData */
294
308
 
295
309
  /* Excluded from this release type: SubmitSummaryResult */
@@ -88,12 +88,20 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
88
88
 
89
89
  /* Excluded from this release type: CreateChildSummarizerNodeParam */
90
90
 
91
+ /* Excluded from this release type: currentDocumentVersionSchema */
92
+
91
93
  /* Excluded from this release type: DataStoreContexts */
92
94
 
93
95
  /* Excluded from this release type: DefaultSummaryConfiguration */
94
96
 
95
97
  /* Excluded from this release type: detectOutboundReferences */
96
98
 
99
+ /* Excluded from this release type: disabledCompressionConfig */
100
+
101
+ /* Excluded from this release type: DocumentSchemaValueType */
102
+
103
+ /* Excluded from this release type: DocumentsSchemaController */
104
+
97
105
  /* Excluded from this release type: EnqueueSummarizeResult */
98
106
 
99
107
  /* Excluded from this release type: FluidDataStoreContext */
@@ -152,6 +160,14 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
152
160
 
153
161
  /* Excluded from this release type: IdCompressorMode */
154
162
 
163
+ /* Excluded from this release type: IDocumentSchema */
164
+
165
+ /* Excluded from this release type: IDocumentSchemaChangeMessage */
166
+
167
+ /* Excluded from this release type: IDocumentSchemaCurrent */
168
+
169
+ /* Excluded from this release type: IDocumentSchemaFeatures */
170
+
155
171
  /* Excluded from this release type: IDocumentStorageService */
156
172
 
157
173
  /* Excluded from this release type: IEnqueueSummarizeOptions */
@@ -288,8 +304,6 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
288
304
 
289
305
  /* Excluded from this release type: RuntimeHeaders */
290
306
 
291
- /* Excluded from this release type: RuntimeMessage */
292
-
293
307
  /* Excluded from this release type: SubmitSummaryFailureData */
294
308
 
295
309
  /* Excluded from this release type: SubmitSummaryResult */