Show current workload on the machines page

This commit is contained in:
AndyGrant committed 2018-07-21 20:42:24 -04:00
1 parent 093fe91cf1
commit 8d4554f15a
3 files changed
+9 -2

No files matched your search

+1
View File
@@ -34,6 +34,7 @@ class Machine(Model):
threads = IntegerField(default=0)
mnps = FloatField(default=0.00)
updated = DateTimeField(auto_now=True)
workload = ForeignKey('Test', PROTECT, related_name='workload', default=1)
def __str__(self):
return '{0}-{1} ({2})'.format(self.owner, self.osname, self.id)
+6 -2
View File
@@ -434,8 +434,12 @@ def getWorkload(request):
except: return HttpResponse('Bad Machine')
# Find an active Test to work on
try: test = OpenBench.utils.getWorkload(machine)
except: return HttpResponse('None')
try:
test = OpenBench.utils.getWorkload(machine)
machine.workload = test
machine.save()
except:
return HttpResponse('None')
# Create or fetch the Results
try: result = OpenBench.utils.getResult(machine, test)
+2
View File
@@ -13,6 +13,7 @@
<th>User</th>
<th>System</th>
<th>Updated</th>
<th>Workload</th>
<th>Threads</th>
<th>MNPS</th>
</tr>
@@ -22,6 +23,7 @@
<td>{{machine.owner}}</td>
<td>{{machine.osname}}</td>
<td>{{machine.updated|date:'Y-m-d H:i'}}</td>
<td> <a href="viewTest/{{machine.workload.id}}">{{machine.workload.dev.name}}</a></td>
<td class="numeric">{{machine.threads}}</td>
<td class="numeric">{{machine.mnps|twoDigitPrecision}}</td>
</tr>