repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: factor out worker runtime getter
[poolifier.git]
/
src
/
pools
/
selection-strategies
/
weighted-round-robin-worker-choice-strategy.ts
diff --git
a/src/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.ts
b/src/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.ts
index bda206a7d7e1521ac8a6056b0485ad18e7698375..a0553fcb81ace9c910b1ecd755b9c123b640f362 100644
(file)
--- a/
src/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.ts
+++ b/
src/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.ts
@@
-75,7
+75,7
@@
export class WeightedRoundRobinWorkerChoiceStrategy<
if (workerVirtualTaskRunTime < workerWeight) {
this.workerVirtualTaskRunTime =
workerVirtualTaskRunTime +
if (workerVirtualTaskRunTime < workerWeight) {
this.workerVirtualTaskRunTime =
workerVirtualTaskRunTime +
- this.getWorker
Virtual
TaskRunTime(chosenWorkerNodeKey)
+ this.getWorkerTaskRunTime(chosenWorkerNodeKey)
} else {
this.currentWorkerNodeId =
this.currentWorkerNodeId === this.pool.workerNodes.length - 1
} else {
this.currentWorkerNodeId =
this.currentWorkerNodeId === this.pool.workerNodes.length - 1
@@
-99,12
+99,6
@@
export class WeightedRoundRobinWorkerChoiceStrategy<
return true
}
return true
}
- private getWorkerVirtualTaskRunTime (workerNodeKey: number): number {
- return this.requiredStatistics.medRunTime
- ? this.pool.workerNodes[workerNodeKey].tasksUsage.medRunTime
- : this.pool.workerNodes[workerNodeKey].tasksUsage.avgRunTime
- }
-
private computeDefaultWorkerWeight (): number {
let cpusCycleTimeWeight = 0
for (const cpu of cpus()) {
private computeDefaultWorkerWeight (): number {
let cpusCycleTimeWeight = 0
for (const cpu of cpus()) {