@glimt/record 0.0.63 → 0.0.65
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.cjs +33 -13
- package/dist/record.cjs.map +1 -1
- package/dist/record.js +33 -13
- package/dist/record.js.map +1 -1
- package/dist/record.umd.cjs +33 -13
- package/dist/record.umd.cjs.map +2 -2
- package/dist/record.umd.min.cjs +22 -22
- package/dist/record.umd.min.cjs.map +3 -3
- package/package.json +1 -1
package/dist/record.cjs
CHANGED
|
@@ -1993,16 +1993,6 @@ function serializeNodeWithId(n2, options) {
|
|
|
1993
1993
|
debugging.store[n2.nodeName].push(took);
|
|
1994
1994
|
if (debugging.index % 5e3 === 0) {
|
|
1995
1995
|
debugging.index = 0;
|
|
1996
|
-
const avgs = Object.entries(debugging.store).map(([key, values]) => {
|
|
1997
|
-
return {
|
|
1998
|
-
tagName: key,
|
|
1999
|
-
avg: values.reduce((a2, b) => a2 + b, 0) / values.length,
|
|
2000
|
-
max: Math.max(...values),
|
|
2001
|
-
min: Math.min(...values)
|
|
2002
|
-
};
|
|
2003
|
-
});
|
|
2004
|
-
console.log("last 5000 avgs");
|
|
2005
|
-
console.table(avgs);
|
|
2006
1996
|
debugging.store = {};
|
|
2007
1997
|
}
|
|
2008
1998
|
return serializedNode;
|
|
@@ -10473,6 +10463,11 @@ class MutationBuffer {
|
|
|
10473
10463
|
mutationLimit: 800
|
|
10474
10464
|
//was 1500
|
|
10475
10465
|
});
|
|
10466
|
+
__publicField(this, "rollingMutTracker", {
|
|
10467
|
+
accumlativeMuts: 0,
|
|
10468
|
+
ts: -1,
|
|
10469
|
+
interval: 50
|
|
10470
|
+
});
|
|
10476
10471
|
__publicField(this, "handleStormMutations", (muts) => {
|
|
10477
10472
|
const time = Date.now();
|
|
10478
10473
|
if (this.stormInfo == null) {
|
|
@@ -10538,9 +10533,34 @@ class MutationBuffer {
|
|
|
10538
10533
|
}
|
|
10539
10534
|
});
|
|
10540
10535
|
__publicField(this, "processInternalMutations", (muts, overrideStorm = false) => {
|
|
10541
|
-
console.log(
|
|
10542
|
-
|
|
10543
|
-
|
|
10536
|
+
console.log(
|
|
10537
|
+
"muts",
|
|
10538
|
+
muts.length,
|
|
10539
|
+
JSON.parse(JSON.stringify(this.rollingMutTracker))
|
|
10540
|
+
);
|
|
10541
|
+
if (!overrideStorm) {
|
|
10542
|
+
if (this.stormInfo != null || muts.length >= this.stormSettings.batchSize) {
|
|
10543
|
+
this.handleStormMutations(muts);
|
|
10544
|
+
}
|
|
10545
|
+
if (this.stormInfo == null) {
|
|
10546
|
+
const now = Date.now();
|
|
10547
|
+
if (this.rollingMutTracker.ts === -1) {
|
|
10548
|
+
this.rollingMutTracker.accumlativeMuts = muts.length;
|
|
10549
|
+
} else {
|
|
10550
|
+
if (now - this.rollingMutTracker.ts <= this.rollingMutTracker.interval) {
|
|
10551
|
+
this.rollingMutTracker.accumlativeMuts += muts.length;
|
|
10552
|
+
if (this.rollingMutTracker.accumlativeMuts >= this.stormSettings.batchSize) {
|
|
10553
|
+
debugLog(`Mutation storm through rolling detected.`);
|
|
10554
|
+
this.handleStormMutations(muts);
|
|
10555
|
+
this.rollingMutTracker.accumlativeMuts = 0;
|
|
10556
|
+
this.rollingMutTracker.ts = -1;
|
|
10557
|
+
}
|
|
10558
|
+
} else {
|
|
10559
|
+
this.rollingMutTracker.accumlativeMuts = 0;
|
|
10560
|
+
}
|
|
10561
|
+
}
|
|
10562
|
+
this.rollingMutTracker.ts = now;
|
|
10563
|
+
}
|
|
10544
10564
|
return;
|
|
10545
10565
|
}
|
|
10546
10566
|
for (const mut of muts) {
|