Changeset 61291 in vbox
- Timestamp:
- May 30, 2016 12:57:40 PM (8 years ago)
- Location:
- trunk/src/VBox/ValidationKit/testmanager
- Files:
-
- 2 edited
-
core/report.py (modified) (4 diffs)
-
webui/wuireport.py (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/core/report.py
r61290 r61291 373 373 self.cHits = 0; # Sum number of hits in all periods and all reasons. 374 374 self.cMaxHits = 0; # Max hits in a row. 375 self.cMinHits = 0;# Min hits in a row.375 self.cMinHits = 99999999; # Min hits in a row. 376 376 self.cMaxRows = 0; # Max number of rows in a period. 377 self.cMinRows = 0;# Min number of rows in a period.377 self.cMinRows = 99999999; # Min number of rows in a period. 378 378 self.diPeriodFirst = {}; # The period number a reason was first seen (keyed by subject ID). 379 379 self.diPeriodLast = {}; # The period number a reason was last seen (keyed by subject ID). … … 392 392 """ Worker for appendPeriod and recalcStats. """ 393 393 self.cHits += oPeriod.cHits; 394 if oPeriod.c Hits > self.cMaxHits:395 self.cMaxHits = oPeriod.c Hits;396 if oPeriod.c Hits < self.cMinHits:397 self.cMinHits = oPeriod.c Hits;398 399 if len(oPeriod.aoRows) > self.cMax Hits:400 self.cMax Hits = len(oPeriod.aoRows);401 if len(oPeriod.aoRows) < self.cMin Hits:402 self.cMin Hits = len(oPeriod.aoRows);394 if oPeriod.cMaxHits > self.cMaxHits: 395 self.cMaxHits = oPeriod.cMaxHits; 396 if oPeriod.cMinHits < self.cMinHits: 397 self.cMinHits = oPeriod.cMinHits; 398 399 if len(oPeriod.aoRows) > self.cMaxRows: 400 self.cMaxRows = len(oPeriod.aoRows); 401 if len(oPeriod.aoRows) < self.cMinRows: 402 self.cMinRows = len(oPeriod.aoRows); 403 403 404 404 def recalcStats(self): … … 406 406 self.cHits = 0; 407 407 self.cMaxHits = 0; 408 self.cMinHits = 0;408 self.cMinHits = 99999999; 409 409 self.cMaxRows = 0; 410 self.cMinRows = 0;410 self.cMinRows = 99999999; 411 411 self.diPeriodFirst = {}; 412 412 self.diPeriodLast = {}; … … 474 474 super(ReportPeriodSetWithTotalBase, self)._doStatsForPeriod(oPeriod); 475 475 self.cTotal += oPeriod.cTotal; 476 if oPeriod.c Total > self.cMaxTotal:477 self.cMaxTotal = oPeriod.c Total;478 if oPeriod.c Total < self.cMinTotal:479 self.cMinTotal = oPeriod.c Total;476 if oPeriod.cMaxTotal > self.cMaxTotal: 477 self.cMaxTotal = oPeriod.cMaxTotal; 478 if oPeriod.cMinTotal < self.cMinTotal: 479 self.cMinTotal = oPeriod.cMinTotal; 480 480 481 481 if oPeriod.uMaxPct > self.uMaxPct: -
trunk/src/VBox/ValidationKit/testmanager/webui/wuireport.py
r61289 r61291 264 264 return u'<td align="center">%u</td>' % (oSet.dcHitsPerId[idKey],); 265 265 266 def _generateTableForSet(self, oSet, sColumnName, aidSorted = None, fWithTotals = True, cColsPerSeries = None): 266 def _generateTableForSet(self, oSet, sColumnName, aidSorted = None, iSortColumn = 0, 267 fWithTotals = True, cColsPerSeries = None): 267 268 """ 268 269 Turns the set into a table. … … 276 277 # Header row. 277 278 sHtml += u' <tr><thead><th></th><th>%s</th>' % (webutils.escapeElem(sColumnName),) 278 for oPeriod in reversed(oSet.aoPeriods): 279 sHtml += u'<th colspan="%d">%s</th>' % (cColsPerSeries, webutils.escapeElem(oPeriod.sDesc),); 279 for iPeriod, oPeriod in enumerate(reversed(oSet.aoPeriods)): 280 sHtml += u'<th colspan="%d">%s%s</th>' % ( cColsPerSeries, webutils.escapeElem(oPeriod.sDesc), 281 '▼' if iPeriod == iSortColumn else ''); 280 282 if fWithTotals: 281 sHtml += u'<th colspan="%d">Total</th>' % (cColsPerSeries,); 283 sHtml += u'<th colspan="%d">Total%s</th>' % (cColsPerSeries, 284 '▼' if iSortColumn == len(oSet.aoPeriods) else ''); 282 285 sHtml += u'</thead></td>\n'; 283 286 … … 308 311 def _getSortedIds(self, oSet, fByTotal = None): 309 312 """ 310 Get default sorted subject IDs .313 Get default sorted subject IDs and which column. 311 314 """ 312 315 … … 319 322 key = lambda idKey: oSet.dcHitsPerId[idKey] * 10000 / oSet.dcTotalPerId[idKey], 320 323 reverse = True); 324 iColumn = len(oSet.aoPeriods); 321 325 else: 322 326 # Sort by NOW column. … … 327 331 else: dTmp[idKey] = oRow.cHits * 10000 / max(1, oRow.cTotal); 328 332 aidSortedRaw = sorted(dTmp, key = lambda idKey: dTmp[idKey], reverse = True); 329 return aidSortedRaw; 333 iColumn = 0; 334 return (aidSortedRaw, iColumn); 330 335 331 336 def _generateGraph(self, oSet, sIdBase, aidSortedRaw): … … 410 415 # Generate table and transition list. These are the most useful ones with the current graph machinery. 411 416 # 412 sHtml = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw );417 sHtml = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw, len(oSet.aoPeriods)); 413 418 sHtml += self._generateTransitionList(oSet); 414 419 … … 485 490 self._sTitle = 'Test Case Failures'; 486 491 oSet = self._oModel.getTestCaseFailures(); 487 aidSortedRaw= self._getSortedIds(oSet);488 489 sHtml = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw );492 (aidSortedRaw, iSortColumn) = self._getSortedIds(oSet); 493 494 sHtml = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw, iSortColumn); 490 495 sHtml += self._generateTransitionList(oSet); 491 496 sHtml += self._generateGraph(oSet, 'testcase-graph', aidSortedRaw); … … 524 529 self._sTitle = 'Test Case Variation Failures'; 525 530 oSet = self._oModel.getTestCaseVariationFailures(); 526 aidSortedRaw= self._getSortedIds(oSet);527 528 sHtml = self._generateTableForSet(oSet, 'Test Case Variations', aidSortedRaw );531 (aidSortedRaw, iSortColumn) = self._getSortedIds(oSet); 532 533 sHtml = self._generateTableForSet(oSet, 'Test Case Variations', aidSortedRaw, iSortColumn); 529 534 sHtml += self._generateTransitionList(oSet); 530 535 sHtml += self._generateGraph(oSet, 'testcasearg-graph', aidSortedRaw); … … 556 561 self._sTitle = 'Test Box Failures'; 557 562 oSet = self._oModel.getTestBoxFailures(); 558 aidSortedRaw= self._getSortedIds(oSet);559 560 sHtml = self._generateTableForSet(oSet, 'Test Boxes', aidSortedRaw );563 (aidSortedRaw, iSortColumn) = self._getSortedIds(oSet); 564 565 sHtml = self._generateTableForSet(oSet, 'Test Boxes', aidSortedRaw, iSortColumn); 561 566 sHtml += self._generateTransitionList(oSet); 562 567 sHtml += self._generateGraph(oSet, 'testbox-graph', aidSortedRaw);
Note:
See TracChangeset
for help on using the changeset viewer.

