VirtualBox

Changeset 97130 in vbox


Ignore:
Timestamp:
Oct 13, 2022 1:16:50 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
154102
Message:

Validation Kit/batch/quota.py: Simplified script by not being that generic anymore, addressed @todos. Tested locally on a partial DB dump + testset data. See ArchiveDelFilesBatchJob::init for configuration [forgot to commit the file].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/core/testset.py

    r97110 r97130  
    721721        return aoRet;
    722722
     723    def fetchByAge(self, tsNow = None, cHoursBack = 24):
     724        """
     725        Returns a list of TestSetData objects of a given time period (default is 24 hours).
     726
     727        Returns None if no testsets stored,
     728        Returns an empty list if no testsets found with given criteria.
     729        """
     730        if tsNow is None:
     731            tsNow = self._oDb.getCurrentTimestamp();
     732
     733        if self._oDb.getRowCount() == 0:
     734            return None;
     735
     736        self._oDb.execute('(SELECT *\n'
     737                    ' FROM   TestSets\n'
     738                    ' WHERE  tsDone           <= %s\n'
     739                    '    AND tsDone            > (%s - interval \'%s hours\')\n'
     740                    ')\n'
     741                    , ( tsNow, tsNow, cHoursBack, ));
     742
     743        aoRet = [];
     744        for aoRow in self._oDb.fetchAll():
     745            aoRet.append(TestSetData().initFromDbRow(aoRow));
     746        return aoRet;
     747
    723748    def isTestBoxExecutingTooRapidly(self, idTestBox): ## s/To/Too/
    724749        """
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette