@glimt/record 0.0.66 → 0.0.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/record.js CHANGED
@@ -10325,12 +10325,16 @@ const _StormSnapshotManager = class _StormSnapshotManager2 {
10325
10325
  __publicField(_StormSnapshotManager, "instance");
10326
10326
  let StormSnapshotManager = _StormSnapshotManager;
10327
10327
  const stormSnapshotManager = new StormSnapshotManager();
10328
- class MutationRateLimiter {
10328
+ const _MutationRateLimiter = class _MutationRateLimiter2 {
10329
10329
  constructor() {
10330
10330
  __publicField(this, "mutTracker");
10331
10331
  __publicField(this, "interval", 50);
10332
- __publicField(this, "limit", 150);
10332
+ __publicField(this, "limit", 100);
10333
10333
  __publicField(this, "inGlobalStorm", false);
10334
+ if (_MutationRateLimiter2.instance) {
10335
+ return _MutationRateLimiter2.instance;
10336
+ }
10337
+ _MutationRateLimiter2.instance = this;
10334
10338
  debugLog(`MutationRateLimiter, init`);
10335
10339
  this.reset();
10336
10340
  }
@@ -10343,11 +10347,15 @@ class MutationRateLimiter {
10343
10347
  isStorming(muts) {
10344
10348
  const now = Date.now();
10345
10349
  if (this.inGlobalStorm) {
10350
+ this.mutTracker.muts += muts;
10346
10351
  if (now - this.mutTracker.ts > this.interval) {
10347
10352
  this.inGlobalStorm = false;
10348
- debugLog(`MutationRateLimiter, detected global storm over`);
10353
+ debugLog(
10354
+ `MutationRateLimiter, detected global storm over. Total mutations stormed: ${this.mutTracker.muts}`
10355
+ );
10349
10356
  return false;
10350
10357
  }
10358
+ this.mutTracker.ts = now;
10351
10359
  return true;
10352
10360
  }
10353
10361
  if (this.mutTracker.ts === -1) {
@@ -10366,7 +10374,9 @@ class MutationRateLimiter {
10366
10374
  this.mutTracker.ts = now;
10367
10375
  return false;
10368
10376
  }
10369
- }
10377
+ };
10378
+ __publicField(_MutationRateLimiter, "instance");
10379
+ let MutationRateLimiter = _MutationRateLimiter;
10370
10380
  const mutationRateLimiter = new MutationRateLimiter();
10371
10381
  function isNodeInLinkedList(n2) {
10372
10382
  return "__ln" in n2;
@@ -10504,11 +10514,6 @@ class MutationBuffer {
10504
10514
  mutationLimit: 800
10505
10515
  //was 1500
10506
10516
  });
10507
- __publicField(this, "rollingMutTracker", {
10508
- accumlativeMuts: 0,
10509
- ts: -1,
10510
- interval: 50
10511
- });
10512
10517
  __publicField(this, "handleStormMutations", (muts, canFinishStorm = true) => {
10513
10518
  const time = Date.now();
10514
10519
  if (this.stormInfo == null) {
@@ -10574,11 +10579,6 @@ class MutationBuffer {
10574
10579
  }
10575
10580
  });
10576
10581
  __publicField(this, "processInternalMutations", (muts, overrideStorm = false) => {
10577
- console.log(
10578
- "muts",
10579
- muts.length,
10580
- JSON.parse(JSON.stringify(this.rollingMutTracker))
10581
- );
10582
10582
  if (!overrideStorm) {
10583
10583
  const isStorming = mutationRateLimiter.isStorming(muts.length);
10584
10584
  if (isStorming) {