netrender: usage based balancer. more useful than credits
[blender.git] / release / io / netrender / balancing.py
index c167594..372ea7d 100644 (file)
@@ -64,7 +64,13 @@ class Balancer:
 
 class RatingCredit(RatingRule):
        def rate(self, job):
-               return -job.credits * job.priority # more credit is better (sort at first in list)
+               # more credit is better (sort at first in list)
+               return -job.credits * job.priority
+
+class RatingUsage(RatingRule):
+       def rate(self, job):
+               # less usage is better
+               return job.usage / job.priority
 
 class NewJobPriority(PriorityRule):
        def __init__(self, limit = 1):