Comparing version 0.0.787 to 0.0.788
@@ -374,3 +374,3 @@ import { Cache } from './cache'; | ||
console.debug('DWC overlap', dwc['overlapLRU'], dwc['overlapLFU']); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 100); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 97); | ||
}); | ||
@@ -407,3 +407,3 @@ | ||
console.debug('DWC overlap', dwc['overlapLRU'], dwc['overlapLFU']); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 146); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 147); | ||
}); | ||
@@ -438,3 +438,3 @@ | ||
console.debug('DWC overlap', dwc['overlapLRU'], dwc['overlapLFU']); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 155); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 152); | ||
}); | ||
@@ -570,3 +570,3 @@ | ||
console.debug('DWC overlap', dwc['overlapLRU'], dwc['overlapLFU']); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 28); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 19); | ||
}); | ||
@@ -633,3 +633,3 @@ | ||
assert(stats.dwc / stats.lru * 100 === Infinity); | ||
assert(stats.dwc * 100 / stats.total >>> 0 === 9); | ||
assert(stats.dwc * 100 / stats.total >>> 0 === 8); | ||
}); | ||
@@ -702,3 +702,3 @@ | ||
console.debug('DWC overlap', dwc['overlapLRU'], dwc['overlapLFU']); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 24); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 22); | ||
}); | ||
@@ -735,3 +735,3 @@ | ||
assert(stats.dwc / stats.lru * 100 === Infinity); | ||
assert(stats.dwc * 100 / stats.total >>> 0 === 8); | ||
assert(stats.dwc * 100 / stats.total >>> 0 === 9); | ||
assert(dwc['partition']! * 100 / capacity >>> 0 === 0); | ||
@@ -771,3 +771,3 @@ }); | ||
console.debug('DWC overlap', dwc['overlapLRU'], dwc['overlapLFU']); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 108); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 112); | ||
assert(dwc['partition']! * 100 / capacity >>> 0 === 99); | ||
@@ -842,3 +842,3 @@ }); | ||
console.debug('DWC overlap', dwc['overlapLRU'], dwc['overlapLFU']); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 160); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 162); | ||
}); | ||
@@ -845,0 +845,0 @@ |
@@ -198,2 +198,3 @@ import { max, min, round } from './alias'; | ||
capacity, | ||
() => this.partition, | ||
settings.sweep!.window!, | ||
@@ -221,3 +222,3 @@ settings.sweep!.room!, | ||
threshold: 20, | ||
ratio: 50, | ||
ratio: 90, | ||
window: 1, | ||
@@ -630,3 +631,4 @@ room: 50, | ||
private target: T, | ||
capacity: number, | ||
private capacity: number, | ||
private partition: () => number, | ||
private $window: number, | ||
@@ -650,2 +652,3 @@ private room: number, | ||
public resize(capacity: number, window: number, room: number, range: number): void { | ||
this.capacity = capacity; | ||
this.$window = round(capacity * window / 100) || 1; | ||
@@ -708,3 +711,3 @@ this.room = round(capacity * room / 100) || 1; | ||
ratio < this.threshold || | ||
ratio < this.ratioRoom() * this.ratio / 100; | ||
ratio < this.ratioRoom() * (this.partition() / this.capacity) * this.ratio / 100; | ||
} | ||
@@ -711,0 +714,0 @@ public isActive(): boolean { |
{ | ||
"name": "spica", | ||
"version": "0.0.787", | ||
"version": "0.0.788", | ||
"description": "Supervisor, Coroutine, Channel, select, AtomicPromise, Cancellation, Cache, List, Queue, Stack, and some utils.", | ||
@@ -5,0 +5,0 @@ "private": false, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
842435
27495