@fluidframework/container-runtime 2.0.0-dev.7.4.0.215747 → 2.0.0-dev.7.4.0.216897

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 (139) hide show
  1. package/api-extractor-lint.json +13 -0
  2. package/api-report/container-runtime.api.md +105 -92
  3. package/dist/blobManager.d.ts +1 -1
  4. package/dist/blobManager.js.map +1 -1
  5. package/dist/container-runtime-alpha.d.ts +231 -1708
  6. package/dist/container-runtime-beta.d.ts +228 -1706
  7. package/dist/container-runtime-public.d.ts +228 -1706
  8. package/dist/container-runtime-untrimmed.d.ts +126 -103
  9. package/dist/containerRuntime.d.ts +20 -23
  10. package/dist/containerRuntime.d.ts.map +1 -1
  11. package/dist/containerRuntime.js +12 -15
  12. package/dist/containerRuntime.js.map +1 -1
  13. package/dist/dataStoreRegistry.d.ts +1 -1
  14. package/dist/dataStoreRegistry.js +1 -1
  15. package/dist/dataStoreRegistry.js.map +1 -1
  16. package/dist/gc/garbageCollection.d.ts +14 -5
  17. package/dist/gc/garbageCollection.d.ts.map +1 -1
  18. package/dist/gc/garbageCollection.js +85 -30
  19. package/dist/gc/garbageCollection.js.map +1 -1
  20. package/dist/gc/gcDefinitions.d.ts +33 -11
  21. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  22. package/dist/gc/gcDefinitions.js +2 -4
  23. package/dist/gc/gcDefinitions.js.map +1 -1
  24. package/dist/gc/gcTelemetry.d.ts +0 -5
  25. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  26. package/dist/gc/gcTelemetry.js +0 -39
  27. package/dist/gc/gcTelemetry.js.map +1 -1
  28. package/dist/gc/index.d.ts +1 -1
  29. package/dist/gc/index.d.ts.map +1 -1
  30. package/dist/gc/index.js +1 -2
  31. package/dist/gc/index.js.map +1 -1
  32. package/dist/id-compressor/utilities.d.ts +3 -3
  33. package/dist/id-compressor/utilities.js +3 -3
  34. package/dist/id-compressor/utilities.js.map +1 -1
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js.map +1 -1
  38. package/dist/messageTypes.d.ts +2 -2
  39. package/dist/messageTypes.d.ts.map +1 -1
  40. package/dist/messageTypes.js +1 -1
  41. package/dist/messageTypes.js.map +1 -1
  42. package/dist/opLifecycle/definitions.d.ts +1 -1
  43. package/dist/opLifecycle/definitions.js.map +1 -1
  44. package/dist/packageVersion.d.ts +1 -1
  45. package/dist/packageVersion.js +1 -1
  46. package/dist/packageVersion.js.map +1 -1
  47. package/dist/summary/orderedClientElection.d.ts +1 -1
  48. package/dist/summary/orderedClientElection.js.map +1 -1
  49. package/dist/summary/runWhileConnectedCoordinator.d.ts +2 -2
  50. package/dist/summary/runWhileConnectedCoordinator.js +1 -1
  51. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  52. package/dist/summary/summarizer.d.ts +1 -1
  53. package/dist/summary/summarizer.js +1 -1
  54. package/dist/summary/summarizer.js.map +1 -1
  55. package/dist/summary/summarizerTypes.d.ts +30 -30
  56. package/dist/summary/summarizerTypes.js.map +1 -1
  57. package/dist/summary/summaryCollection.d.ts +10 -10
  58. package/dist/summary/summaryCollection.js +1 -1
  59. package/dist/summary/summaryCollection.js.map +1 -1
  60. package/dist/summary/summaryFormat.d.ts +3 -3
  61. package/dist/summary/summaryFormat.js.map +1 -1
  62. package/lib/blobManager.d.ts +1 -1
  63. package/lib/blobManager.js.map +1 -1
  64. package/lib/container-runtime-alpha.d.ts +231 -1708
  65. package/lib/container-runtime-beta.d.ts +228 -1706
  66. package/lib/container-runtime-public.d.ts +228 -1706
  67. package/lib/container-runtime-untrimmed.d.ts +126 -103
  68. package/lib/containerRuntime.d.ts +20 -23
  69. package/lib/containerRuntime.d.ts.map +1 -1
  70. package/lib/containerRuntime.js +12 -15
  71. package/lib/containerRuntime.js.map +1 -1
  72. package/lib/dataStoreRegistry.d.ts +1 -1
  73. package/lib/dataStoreRegistry.js +1 -1
  74. package/lib/dataStoreRegistry.js.map +1 -1
  75. package/lib/gc/garbageCollection.d.ts +14 -5
  76. package/lib/gc/garbageCollection.d.ts.map +1 -1
  77. package/lib/gc/garbageCollection.js +85 -30
  78. package/lib/gc/garbageCollection.js.map +1 -1
  79. package/lib/gc/gcDefinitions.d.ts +33 -11
  80. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  81. package/lib/gc/gcDefinitions.js +1 -3
  82. package/lib/gc/gcDefinitions.js.map +1 -1
  83. package/lib/gc/gcTelemetry.d.ts +0 -5
  84. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  85. package/lib/gc/gcTelemetry.js +1 -40
  86. package/lib/gc/gcTelemetry.js.map +1 -1
  87. package/lib/gc/index.d.ts +1 -1
  88. package/lib/gc/index.d.ts.map +1 -1
  89. package/lib/gc/index.js +1 -1
  90. package/lib/gc/index.js.map +1 -1
  91. package/lib/id-compressor/utilities.d.ts +3 -3
  92. package/lib/id-compressor/utilities.js +3 -3
  93. package/lib/id-compressor/utilities.js.map +1 -1
  94. package/lib/index.d.ts +1 -1
  95. package/lib/index.d.ts.map +1 -1
  96. package/lib/index.js.map +1 -1
  97. package/lib/messageTypes.d.ts +2 -2
  98. package/lib/messageTypes.d.ts.map +1 -1
  99. package/lib/messageTypes.js +1 -1
  100. package/lib/messageTypes.js.map +1 -1
  101. package/lib/opLifecycle/definitions.d.ts +1 -1
  102. package/lib/opLifecycle/definitions.js.map +1 -1
  103. package/lib/packageVersion.d.ts +1 -1
  104. package/lib/packageVersion.js +1 -1
  105. package/lib/packageVersion.js.map +1 -1
  106. package/lib/summary/orderedClientElection.d.ts +1 -1
  107. package/lib/summary/orderedClientElection.js.map +1 -1
  108. package/lib/summary/runWhileConnectedCoordinator.d.ts +2 -2
  109. package/lib/summary/runWhileConnectedCoordinator.js +1 -1
  110. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  111. package/lib/summary/summarizer.d.ts +1 -1
  112. package/lib/summary/summarizer.js +1 -1
  113. package/lib/summary/summarizer.js.map +1 -1
  114. package/lib/summary/summarizerTypes.d.ts +30 -30
  115. package/lib/summary/summarizerTypes.js.map +1 -1
  116. package/lib/summary/summaryCollection.d.ts +10 -10
  117. package/lib/summary/summaryCollection.js +1 -1
  118. package/lib/summary/summaryCollection.js.map +1 -1
  119. package/lib/summary/summaryFormat.d.ts +3 -3
  120. package/lib/summary/summaryFormat.js.map +1 -1
  121. package/package.json +20 -16
  122. package/src/blobManager.ts +1 -1
  123. package/src/containerRuntime.ts +20 -23
  124. package/src/dataStoreRegistry.ts +1 -1
  125. package/src/gc/garbageCollection.ts +101 -48
  126. package/src/gc/gcDefinitions.ts +34 -11
  127. package/src/gc/gcTelemetry.ts +0 -53
  128. package/src/gc/index.ts +2 -1
  129. package/src/id-compressor/utilities.ts +3 -3
  130. package/src/index.ts +2 -0
  131. package/src/messageTypes.ts +3 -2
  132. package/src/opLifecycle/definitions.ts +1 -1
  133. package/src/packageVersion.ts +1 -1
  134. package/src/summary/orderedClientElection.ts +1 -1
  135. package/src/summary/runWhileConnectedCoordinator.ts +2 -2
  136. package/src/summary/summarizer.ts +1 -1
  137. package/src/summary/summarizerTypes.ts +30 -30
  138. package/src/summary/summaryCollection.ts +10 -10
  139. package/src/summary/summaryFormat.ts +3 -3
@@ -40,6 +40,8 @@ import {
40
40
  UnreferencedState,
41
41
  IGCMetadata,
42
42
  IGarbageCollectorConfigs,
43
+ IMarkPhaseStats,
44
+ ISweepPhaseStats,
43
45
  } from "./gcDefinitions";
44
46
  import { cloneGCData, concatGarbageCollectionData, getGCDataFromSnapshot } from "./gcHelpers";
45
47
  import { runGarbageCollection } from "./gcReferenceGraphAlgorithm";
@@ -305,6 +307,7 @@ export class GarbageCollector implements IGarbageCollector {
305
307
  eventName: "GarbageCollectorLoaded",
306
308
  gcConfigs: JSON.stringify(this.configs),
307
309
  gcOptions: JSON.stringify(createParams.gcOptions),
310
+ ...createParams.createContainerMetadata,
308
311
  });
309
312
  }
310
313
 
@@ -520,7 +523,11 @@ export class GarbageCollector implements IGarbageCollector {
520
523
 
521
524
  /** GC step */
522
525
  const gcStats = await this.runGC(fullGC, currentReferenceTimestampMs, logger);
523
- event.end({ ...gcStats, timestamp: currentReferenceTimestampMs });
526
+ event.end({
527
+ ...gcStats,
528
+ timestamp: currentReferenceTimestampMs,
529
+ sweep: this.configs.shouldRunSweep,
530
+ });
524
531
 
525
532
  /** Post-GC steps */
526
533
  // Log pending unreferenced events such as a node being used after inactive. This is done after GC runs and
@@ -541,9 +548,10 @@ export class GarbageCollector implements IGarbageCollector {
541
548
  /**
542
549
  * Runs garbage collection. It does the following:
543
550
  * 1. It generates / analyzes the runtime's reference graph.
544
- * 2. Generates stats for the GC run based on previous / current GC state.
551
+ * 2. Generates mark phase stats.
545
552
  * 3. Runs Mark phase.
546
553
  * 4. Runs Sweep phase.
554
+ * 5. Generates sweep phase stats.
547
555
  */
548
556
  private async runGC(
549
557
  fullGC: boolean,
@@ -559,9 +567,9 @@ export class GarbageCollector implements IGarbageCollector {
559
567
  this.findAllNodesReferencedBetweenGCs(gcData, this.gcDataFromLastRun, logger) ??
560
568
  gcResult.referencedNodeIds;
561
569
 
562
- // 2. Generate stats based on the previous / current GC state.
563
- // Must happen before running Mark / Sweep phase because previous GC state will be updated in these stages.
564
- const gcStats = this.generateStats(gcResult);
570
+ // 2. Get the mark phase stats based on the previous / current GC state.
571
+ // This is done before running mark phase because we need the previous GC state before it is updated.
572
+ const markPhaseStats = this.getMarkPhaseStats(gcResult);
565
573
 
566
574
  // 3. Run the Mark phase.
567
575
  // It will mark nodes as referenced / unreferenced and return a list of node ids that are ready to be swept.
@@ -573,18 +581,21 @@ export class GarbageCollector implements IGarbageCollector {
573
581
 
574
582
  // 4. Run the Sweep phase.
575
583
  // It will delete sweep ready nodes and return a list of deleted node ids.
576
- const deletedNodeIds = this.runSweepPhase(
577
- gcResult,
578
- sweepReadyNodeIds,
579
- currentReferenceTimestampMs,
580
- logger,
581
- );
584
+ const deletedNodeIds = this.runSweepPhase(gcResult, sweepReadyNodeIds);
582
585
 
583
586
  this.gcDataFromLastRun = cloneGCData(
584
587
  gcData,
585
588
  (id: string) => deletedNodeIds.includes(id) /* filter out deleted nodes */,
586
589
  );
587
- return gcStats;
590
+
591
+ // 5. Get the sweep phase stats.
592
+ const sweepPhaseStats = this.getSweepPhaseStats(
593
+ this.configs.shouldRunSweep ? this.deletedNodes : sweepReadyNodeIds,
594
+ new Set(deletedNodeIds),
595
+ markPhaseStats,
596
+ );
597
+
598
+ return { ...markPhaseStats, ...sweepPhaseStats };
588
599
  }
589
600
 
590
601
  /**
@@ -605,7 +616,7 @@ export class GarbageCollector implements IGarbageCollector {
605
616
  gcResult: IGCResult,
606
617
  allReferencedNodeIds: string[],
607
618
  currentReferenceTimestampMs: number,
608
- ): string[] {
619
+ ): Set<string> {
609
620
  // 1. Marks all referenced nodes by clearing their unreferenced tracker, if any.
610
621
  for (const nodeId of allReferencedNodeIds) {
611
622
  const nodeStateTracker = this.unreferencedNodesState.get(nodeId);
@@ -618,7 +629,7 @@ export class GarbageCollector implements IGarbageCollector {
618
629
  }
619
630
 
620
631
  // 2. Mark unreferenced nodes in this run by starting unreferenced tracking for them.
621
- const sweepReadyNodeIds: string[] = [];
632
+ const sweepReadyNodeIds: Set<string> = new Set();
622
633
  for (const nodeId of gcResult.deletedNodeIds) {
623
634
  const nodeStateTracker = this.unreferencedNodesState.get(nodeId);
624
635
  if (nodeStateTracker === undefined) {
@@ -638,7 +649,7 @@ export class GarbageCollector implements IGarbageCollector {
638
649
 
639
650
  // If a node is sweep ready, store it so it can be returned.
640
651
  if (nodeStateTracker.state === UnreferencedState.SweepReady) {
641
- sweepReadyNodeIds.push(nodeId);
652
+ sweepReadyNodeIds.add(nodeId);
642
653
  }
643
654
  }
644
655
  }
@@ -660,22 +671,7 @@ export class GarbageCollector implements IGarbageCollector {
660
671
  * @param logger - The logger to be used to log any telemetry.
661
672
  * @returns A list of nodes that have been deleted.
662
673
  */
663
- private runSweepPhase(
664
- gcResult: IGCResult,
665
- sweepReadyNodes: string[],
666
- currentReferenceTimestampMs: number,
667
- logger: ITelemetryLoggerExt,
668
- ): string[] {
669
- // Log events for objects that are ready to be deleted by sweep. This will give us data on sweep when
670
- // its not enabled.
671
- this.telemetryTracker.logSweepEvents(
672
- logger,
673
- currentReferenceTimestampMs,
674
- this.unreferencedNodesState,
675
- this.completedRuns,
676
- this.getLastSummaryTimestampMs(),
677
- );
678
-
674
+ private runSweepPhase(gcResult: IGCResult, sweepReadyNodes: Set<string>): string[] {
679
675
  /**
680
676
  * Currently, there are 3 modes for sweep:
681
677
  * Test mode - Unreferenced nodes are immediately deleted without waiting for them to be sweep ready.
@@ -692,7 +688,7 @@ export class GarbageCollector implements IGarbageCollector {
692
688
  }
693
689
 
694
690
  if (this.configs.tombstoneMode) {
695
- this.tombstones = sweepReadyNodes;
691
+ this.tombstones = Array.from(sweepReadyNodes);
696
692
  // If we are running in GC tombstone mode, update tombstoned routes. This enables testing scenarios
697
693
  // involving access to "deleted" data without actually deleting the data from summaries.
698
694
  this.runtime.updateTombstonedRoutes(this.tombstones);
@@ -706,7 +702,7 @@ export class GarbageCollector implements IGarbageCollector {
706
702
  // 1. Call the runtime to delete sweep ready nodes. The runtime returns a list of nodes it deleted.
707
703
  // TODO: GC:Validation - validate that removed routes are not double delete and that the child routes of
708
704
  // removed routes are deleted as well.
709
- const deletedNodeIds = this.runtime.deleteSweepReadyNodes(sweepReadyNodes);
705
+ const deletedNodeIds = this.runtime.deleteSweepReadyNodes(Array.from(sweepReadyNodes));
710
706
 
711
707
  // 2. Clear unreferenced state tracking for deleted nodes.
712
708
  for (const nodeId of deletedNodeIds) {
@@ -976,12 +972,12 @@ export class GarbageCollector implements IGarbageCollector {
976
972
  }
977
973
 
978
974
  /**
979
- * Generates the stats of a garbage collection run from the given results of the run.
980
- * @param gcResult - The result of a GC run.
981
- * @returns the GC stats of the GC run.
975
+ * Generates the stats of a garbage collection mark phase run.
976
+ * @param gcResult - The result of the current GC run.
977
+ * @returns the stats of the mark phase run.
982
978
  */
983
- private generateStats(gcResult: IGCResult): IGCStats {
984
- const gcStats: IGCStats = {
979
+ private getMarkPhaseStats(gcResult: IGCResult): IMarkPhaseStats {
980
+ const markPhaseStats: IMarkPhaseStats = {
985
981
  nodeCount: 0,
986
982
  dataStoreCount: 0,
987
983
  attachmentBlobCount: 0,
@@ -994,35 +990,35 @@ export class GarbageCollector implements IGarbageCollector {
994
990
  };
995
991
 
996
992
  const updateNodeStats = (nodeId: string, referenced: boolean) => {
997
- gcStats.nodeCount++;
993
+ markPhaseStats.nodeCount++;
998
994
  // If there is no previous GC data, every node's state is generated and is considered as updated.
999
995
  // Otherwise, find out if any node went from referenced to unreferenced or vice-versa.
1000
996
  const stateUpdated =
1001
997
  this.gcDataFromLastRun === undefined ||
1002
998
  this.unreferencedNodesState.has(nodeId) === referenced;
1003
999
  if (stateUpdated) {
1004
- gcStats.updatedNodeCount++;
1000
+ markPhaseStats.updatedNodeCount++;
1005
1001
  }
1006
1002
  if (!referenced) {
1007
- gcStats.unrefNodeCount++;
1003
+ markPhaseStats.unrefNodeCount++;
1008
1004
  }
1009
1005
 
1010
1006
  if (this.runtime.getNodeType(nodeId) === GCNodeType.DataStore) {
1011
- gcStats.dataStoreCount++;
1007
+ markPhaseStats.dataStoreCount++;
1012
1008
  if (stateUpdated) {
1013
- gcStats.updatedDataStoreCount++;
1009
+ markPhaseStats.updatedDataStoreCount++;
1014
1010
  }
1015
1011
  if (!referenced) {
1016
- gcStats.unrefDataStoreCount++;
1012
+ markPhaseStats.unrefDataStoreCount++;
1017
1013
  }
1018
1014
  }
1019
1015
  if (this.runtime.getNodeType(nodeId) === GCNodeType.Blob) {
1020
- gcStats.attachmentBlobCount++;
1016
+ markPhaseStats.attachmentBlobCount++;
1021
1017
  if (stateUpdated) {
1022
- gcStats.updatedAttachmentBlobCount++;
1018
+ markPhaseStats.updatedAttachmentBlobCount++;
1023
1019
  }
1024
1020
  if (!referenced) {
1025
- gcStats.unrefAttachmentBlobCount++;
1021
+ markPhaseStats.unrefAttachmentBlobCount++;
1026
1022
  }
1027
1023
  }
1028
1024
  };
@@ -1035,6 +1031,63 @@ export class GarbageCollector implements IGarbageCollector {
1035
1031
  updateNodeStats(nodeId, false /* referenced */);
1036
1032
  }
1037
1033
 
1038
- return gcStats;
1034
+ return markPhaseStats;
1035
+ }
1036
+
1037
+ /**
1038
+ * Generates the stats of a garbage collection sweep phase run.
1039
+ * @param allDeletedNodes - All the nodes that have been deleted across all GC runs.
1040
+ * @param currentDeletedNodes - The nodes that have been deleted in this GC run.
1041
+ * @param markPhaseStats - The stats of the mark phase run.
1042
+ * @returns the stats of the sweep phase run.
1043
+ */
1044
+ private getSweepPhaseStats(
1045
+ allDeletedNodes: Set<string>,
1046
+ currentDeletedNodes: Set<string>,
1047
+ markPhaseStats: IMarkPhaseStats,
1048
+ ): ISweepPhaseStats {
1049
+ // Initialize the life time node counts to the mark phase node counts. If sweep is not enabled,
1050
+ // these will be the life time node count for this container.
1051
+ const sweepPhaseStats: ISweepPhaseStats = {
1052
+ lifetimeNodeCount: markPhaseStats.nodeCount,
1053
+ lifetimeDataStoreCount: markPhaseStats.dataStoreCount,
1054
+ lifetimeAttachmentBlobCount: markPhaseStats.attachmentBlobCount,
1055
+ deletedNodeCount: 0,
1056
+ deletedDataStoreCount: 0,
1057
+ deletedAttachmentBlobCount: 0,
1058
+ };
1059
+
1060
+ for (const nodeId of allDeletedNodes) {
1061
+ sweepPhaseStats.deletedNodeCount++;
1062
+ const nodeType = this.runtime.getNodeType(nodeId);
1063
+ if (nodeType === GCNodeType.DataStore) {
1064
+ sweepPhaseStats.deletedDataStoreCount++;
1065
+ } else if (nodeType === GCNodeType.Blob) {
1066
+ sweepPhaseStats.deletedAttachmentBlobCount++;
1067
+ }
1068
+ }
1069
+
1070
+ if (!this.configs.shouldRunSweep) {
1071
+ return sweepPhaseStats;
1072
+ }
1073
+
1074
+ // If sweep is enabled, the counts from the mark phase stats do not include nodes that have been
1075
+ // deleted in previous runs. Add the deleted node counts to life time stats.
1076
+ sweepPhaseStats.lifetimeNodeCount += sweepPhaseStats.deletedNodeCount;
1077
+ sweepPhaseStats.lifetimeDataStoreCount += sweepPhaseStats.deletedDataStoreCount;
1078
+ sweepPhaseStats.lifetimeAttachmentBlobCount += sweepPhaseStats.deletedAttachmentBlobCount;
1079
+
1080
+ // The node deleted in current run are counted twice - once in allDeletedNodes and again in
1081
+ // markPhaseStats. So, remove them from the life time stats.
1082
+ for (const nodeId of currentDeletedNodes) {
1083
+ sweepPhaseStats.lifetimeNodeCount--;
1084
+ const nodeType = this.runtime.getNodeType(nodeId);
1085
+ if (nodeType === GCNodeType.DataStore) {
1086
+ sweepPhaseStats.lifetimeDataStoreCount--;
1087
+ } else if (nodeType === GCNodeType.Blob) {
1088
+ sweepPhaseStats.lifetimeAttachmentBlobCount--;
1089
+ }
1090
+ }
1091
+ return sweepPhaseStats;
1039
1092
  }
1040
1093
  }
@@ -22,7 +22,7 @@ import {
22
22
  import { RuntimeHeaderData } from "../containerRuntime";
23
23
 
24
24
  /**
25
- * @public
25
+ * @internal
26
26
  */
27
27
  export type GCVersion = number;
28
28
 
@@ -62,8 +62,6 @@ export const runSweepKey = "Fluid.GarbageCollection.RunSweep";
62
62
  export const gcTestModeKey = "Fluid.GarbageCollection.GCTestMode";
63
63
  /** Config key to expire a session after a set period of time. Defaults to true. */
64
64
  export const runSessionExpiryKey = "Fluid.GarbageCollection.RunSessionExpiry";
65
- /** Config key to turn GC sweep log off. */
66
- export const disableSweepLogKey = "Fluid.GarbageCollection.DisableSweepLog";
67
65
  /** Config key to disable the tombstone feature, i.e., tombstone information is not read / written into summary. */
68
66
  export const disableTombstoneKey = "Fluid.GarbageCollection.DisableTombstone";
69
67
  /** Config key to override throwing an error when tombstone object is loaded (requested). */
@@ -94,7 +92,7 @@ export const defaultSessionExpiryDurationMs = 30 * oneDayMs; // 30 days
94
92
 
95
93
  /**
96
94
  * @see IGCMetadata.gcFeatureMatrix
97
- * @public
95
+ * @internal
98
96
  */
99
97
  export interface GCFeatureMatrix {
100
98
  /**
@@ -112,7 +110,7 @@ export interface GCFeatureMatrix {
112
110
  }
113
111
 
114
112
  /**
115
- * @public
113
+ * @internal
116
114
  */
117
115
  export interface IGCMetadata {
118
116
  /**
@@ -151,10 +149,10 @@ export interface IGCMetadata {
151
149
  }
152
150
 
153
151
  /**
154
- * The statistics of the system state after a garbage collection run.
155
- * @public
152
+ * The statistics of the system state after a garbage collection mark phase run.
153
+ * @internal
156
154
  */
157
- export interface IGCStats {
155
+ export interface IMarkPhaseStats {
158
156
  /** The number of nodes in the container. */
159
157
  nodeCount: number;
160
158
  /** The number of data stores in the container. */
@@ -175,9 +173,34 @@ export interface IGCStats {
175
173
  updatedAttachmentBlobCount: number;
176
174
  }
177
175
 
176
+ /**
177
+ * The statistics of the system state after a garbage collection sweep phase run.
178
+ * @internal
179
+ */
180
+ export interface ISweepPhaseStats {
181
+ /** The number of nodes in the lifetime of the container. */
182
+ lifetimeNodeCount: number;
183
+ /** The number of data stores in the lifetime of the container. */
184
+ lifetimeDataStoreCount: number;
185
+ /** The number of attachment blobs in the lifetime of the container. */
186
+ lifetimeAttachmentBlobCount: number;
187
+ /** The number of deleted nodes in the container. */
188
+ deletedNodeCount: number;
189
+ /** The number of deleted data stores in the container. */
190
+ deletedDataStoreCount: number;
191
+ /** The number of deleted attachment blobs in the container. */
192
+ deletedAttachmentBlobCount: number;
193
+ }
194
+
195
+ /**
196
+ * The statistics of the system state after a garbage collection run.
197
+ * @internal
198
+ */
199
+ export interface IGCStats extends IMarkPhaseStats, ISweepPhaseStats {}
200
+
178
201
  /**
179
202
  * The types of GC nodes in the GC reference graph.
180
- * @public
203
+ * @internal
181
204
  */
182
205
  export const GCNodeType = {
183
206
  // Nodes that are for data stores.
@@ -191,7 +214,7 @@ export const GCNodeType = {
191
214
  };
192
215
 
193
216
  /**
194
- * @public
217
+ * @internal
195
218
  */
196
219
  export type GCNodeType = (typeof GCNodeType)[keyof typeof GCNodeType];
197
220
 
@@ -297,7 +320,7 @@ export interface IGarbageCollectorCreateParams {
297
320
  }
298
321
 
299
322
  /**
300
- * @public
323
+ * @internal
301
324
  */
302
325
  export interface IGCRuntimeOptions {
303
326
  /**
@@ -14,7 +14,6 @@ import {
14
14
  import { RuntimeHeaderData } from "../containerRuntime";
15
15
  import { ICreateContainerMetadata } from "../summary";
16
16
  import {
17
- disableSweepLogKey,
18
17
  GCNodeType,
19
18
  UnreferencedState,
20
19
  IGarbageCollectorConfigs,
@@ -392,58 +391,6 @@ export class GCTelemetryTracker {
392
391
  }
393
392
  this.pendingEventsQueue = [];
394
393
  }
395
-
396
- /**
397
- * For nodes that are ready to sweep, log an event for now. Until we start running sweep which deletes objects,
398
- * this will give us a view into how much deleted content a container has.
399
- */
400
- public logSweepEvents(
401
- logger: ITelemetryLoggerExt,
402
- currentReferenceTimestampMs: number,
403
- unreferencedNodesState: Map<string, UnreferencedStateTracker>,
404
- completedGCRuns: number,
405
- lastSummaryTime?: number,
406
- ) {
407
- if (
408
- this.mc.config.getBoolean(disableSweepLogKey) === true ||
409
- this.configs.sweepTimeoutMs === undefined
410
- ) {
411
- return;
412
- }
413
-
414
- const deletedNodeIds: string[] = [];
415
- for (const [nodeId, nodeStateTracker] of unreferencedNodesState) {
416
- if (nodeStateTracker.state !== UnreferencedState.SweepReady) {
417
- return;
418
- }
419
-
420
- const nodeType = this.getNodeType(nodeId);
421
- if (nodeType !== GCNodeType.DataStore && nodeType !== GCNodeType.Blob) {
422
- return;
423
- }
424
-
425
- // Log deleted event for each node only once to reduce noise in telemetry.
426
- const uniqueEventId = `Deleted-${nodeId}`;
427
- if (this.loggedUnreferencedEvents.has(uniqueEventId)) {
428
- return;
429
- }
430
- this.loggedUnreferencedEvents.add(uniqueEventId);
431
- deletedNodeIds.push(nodeId);
432
- }
433
-
434
- if (deletedNodeIds.length > 0) {
435
- logger.sendTelemetryEvent({
436
- eventName: "GC_SweepReadyObjects_Delete",
437
- details: JSON.stringify({
438
- timeout: this.configs.sweepTimeoutMs,
439
- completedGCRuns,
440
- lastSummaryTime,
441
- ...this.createContainerMetadata,
442
- }),
443
- ...tagCodeArtifacts({ id: JSON.stringify(deletedNodeIds) }),
444
- });
445
- }
446
- }
447
394
  }
448
395
 
449
396
  /**
package/src/gc/index.ts CHANGED
@@ -8,7 +8,6 @@ export {
8
8
  nextGCVersion,
9
9
  defaultInactiveTimeoutMs,
10
10
  defaultSessionExpiryDurationMs,
11
- disableSweepLogKey,
12
11
  GCNodeType,
13
12
  gcTestModeKey,
14
13
  gcTombstoneGenerationOptionName,
@@ -24,6 +23,8 @@ export {
24
23
  IGCMetadata,
25
24
  IGCResult,
26
25
  IGCRuntimeOptions,
26
+ IMarkPhaseStats,
27
+ ISweepPhaseStats,
27
28
  IGCStats,
28
29
  oneDayMs,
29
30
  runGCKey,
@@ -35,7 +35,7 @@ export function createSessionId(): SessionId {
35
35
 
36
36
  /**
37
37
  * Asserts that the given string is a stable ID.
38
- * @public
38
+ * @internal
39
39
  */
40
40
  export function assertIsStableId(stableId: string): StableId {
41
41
  assert(isStableId(stableId), 0x4a3 /* Expected a StableId */);
@@ -52,7 +52,7 @@ export function assertIsSessionId(stableId: string): SessionId {
52
52
 
53
53
  /**
54
54
  * Generate a random stable ID
55
- * @public
55
+ * @internal
56
56
  */
57
57
  export function generateStableId(): StableId {
58
58
  return assertIsStableId(v4());
@@ -61,7 +61,7 @@ export function generateStableId(): StableId {
61
61
  /**
62
62
  * Returns true iff the given string is a valid Version 4, variant 2 UUID
63
63
  * 'xxxxxxxx-xxxx-4xxx-vxxx-xxxxxxxxxxxx'
64
- * @public
64
+ * @internal
65
65
  */
66
66
  export function isStableId(str: string): str is StableId {
67
67
  if (str.length !== 36) {
package/src/index.ts CHANGED
@@ -40,6 +40,8 @@ export {
40
40
  GCFeatureMatrix,
41
41
  GCVersion,
42
42
  IGCRuntimeOptions,
43
+ IMarkPhaseStats,
44
+ ISweepPhaseStats,
43
45
  IGCStats,
44
46
  } from "./gc";
45
47
  export {
@@ -14,7 +14,7 @@ import { IDataStoreAliasMessage } from "./dataStore";
14
14
  import { IChunkedOp } from "./opLifecycle";
15
15
 
16
16
  /**
17
- * @public
17
+ * @internal
18
18
  */
19
19
  export enum ContainerMessageType {
20
20
  // An op to be delivered to store
@@ -71,7 +71,8 @@ export interface IContainerRuntimeMessageCompatDetails {
71
71
  * IMPORTANT: when creating one to be serialized, set the properties in the order they appear here.
72
72
  * This way stringified values can be compared.
73
73
  */
74
- interface TypedContainerRuntimeMessage<TType extends ContainerMessageType, TContents> {
74
+ interface TypedContainerRuntimeMessage<TType extends ContainerMessageType, TContents>
75
+ extends Partial<RecentlyAddedContainerRuntimeMessageDetails> {
75
76
  /** Type of the op, within the ContainerRuntime's domain */
76
77
  type: TType;
77
78
  /** Domain-specific contents, interpreted according to the type */
@@ -53,7 +53,7 @@ export interface IBatchCheckpoint {
53
53
  }
54
54
 
55
55
  /**
56
- * @public
56
+ * @internal
57
57
  */
58
58
  export interface IChunkedOp {
59
59
  chunkId: number;
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-runtime";
9
- export const pkgVersion = "2.0.0-dev.7.4.0.215747";
9
+ export const pkgVersion = "2.0.0-dev.7.4.0.216897";
@@ -227,7 +227,7 @@ export interface IOrderedClientElectionEvents extends IEvent {
227
227
 
228
228
  /**
229
229
  * Serialized state of IOrderedClientElection.
230
- * @public
230
+ * @internal
231
231
  */
232
232
  export interface ISerializedElection {
233
233
  /** Sequence number at the time of the latest election. */
@@ -12,7 +12,7 @@ import {
12
12
 
13
13
  /**
14
14
  * Similar to AbortController, but using promise instead of events
15
- * @public
15
+ * @internal
16
16
  */
17
17
  export interface ICancellableSummarizerController extends ISummaryCancellationToken {
18
18
  stop(reason: SummarizerStopReason): void;
@@ -21,7 +21,7 @@ export interface ICancellableSummarizerController extends ISummaryCancellationTo
21
21
  /**
22
22
  * Can be useful in testing as well as in places where caller does not use cancellation.
23
23
  * This object implements ISummaryCancellationToken interface but cancellation is never leveraged.
24
- * @public
24
+ * @internal
25
25
  */
26
26
  export const neverCancelledSummaryToken: ISummaryCancellationToken = {
27
27
  cancelled: false,
@@ -69,7 +69,7 @@ export const createSummarizingWarning = (errorMessage: string, logged: boolean)
69
69
  * Summarizer is responsible for coordinating when to generate and send summaries.
70
70
  * It is the main entry point for summary work.
71
71
  * It is created only by summarizing container (i.e. one with clientType === "summarizer")
72
- * @public
72
+ * @internal
73
73
  */
74
74
  export class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements ISummarizer {
75
75
  public get ISummarizer() {