repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test: code cleanup
[poolifier.git]
/
src
/
pools
/
selection-strategies
/
interleaved-weighted-round-robin-worker-choice-strategy.ts
diff --git
a/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts
b/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts
index 7fba0f1b5dad0972af4ae9630b3c8565301a7863..eee39ec8d646da13324c7050e86afc33882fa22c 100644
(file)
--- a/
src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts
+++ b/
src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts
@@
-53,9
+53,9
@@
export class InterleavedWeightedRoundRobinWorkerChoiceStrategy<
*/
private workerNodeId: number = 0
/**
*/
private workerNodeId: number = 0
/**
- * Worker virtual task runtime.
+ * Worker
node
virtual task runtime.
*/
*/
- private workerVirtualTaskRunTime: number = 0
+ private worker
Node
VirtualTaskRunTime: number = 0
/** @inheritDoc */
public constructor (
/** @inheritDoc */
public constructor (
@@
-73,7
+73,7
@@
export class InterleavedWeightedRoundRobinWorkerChoiceStrategy<
this.resetWorkerNodeKeyProperties()
this.roundId = 0
this.workerNodeId = 0
this.resetWorkerNodeKeyProperties()
this.roundId = 0
this.workerNodeId = 0
- this.workerVirtualTaskRunTime = 0
+ this.worker
Node
VirtualTaskRunTime = 0
return true
}
return true
}
@@
-98,19
+98,20
@@
export class InterleavedWeightedRoundRobinWorkerChoiceStrategy<
this.workerNodeId = workerNodeKey
if (
this.workerNodeId !== this.nextWorkerNodeKey &&
this.workerNodeId = workerNodeKey
if (
this.workerNodeId !== this.nextWorkerNodeKey &&
- this.workerVirtualTaskRunTime !== 0
+ this.worker
Node
VirtualTaskRunTime !== 0
) {
) {
- this.workerVirtualTaskRunTime = 0
+ this.worker
Node
VirtualTaskRunTime = 0
}
const workerWeight =
this.opts.weights?.[workerNodeKey] ?? this.defaultWorkerWeight
if (
}
const workerWeight =
this.opts.weights?.[workerNodeKey] ?? this.defaultWorkerWeight
if (
+ this.isWorkerNodeReady(workerNodeKey) &&
workerWeight >= this.roundWeights[roundIndex] &&
workerWeight >= this.roundWeights[roundIndex] &&
- this.workerVirtualTaskRunTime < workerWeight
+ this.worker
Node
VirtualTaskRunTime < workerWeight
) {
) {
- this.workerVirtualTaskRunTime =
- this.workerVirtualTaskRunTime +
- this.getWorkerTaskRunTime(workerNodeKey)
+ this.worker
Node
VirtualTaskRunTime =
+ this.worker
Node
VirtualTaskRunTime +
+ this.getWorker
Node
TaskRunTime(workerNodeKey)
this.setPreviousWorkerNodeKey(this.nextWorkerNodeKey)
this.nextWorkerNodeKey = workerNodeKey
return this.nextWorkerNodeKey
this.setPreviousWorkerNodeKey(this.nextWorkerNodeKey)
this.nextWorkerNodeKey = workerNodeKey
return this.nextWorkerNodeKey