def toil_jobstore_info(jobstore: str) -> dict: """parses a toil jobstore folder""" try: jobStore = Toil.resumeJobStore(jobstore) except NoSuchJobStoreException: return {} else: stats = getStats(jobStore) return processData(jobStore.config, stats)
def testMultipleJobsPerWorkerStats(self): """ Tests case where multiple jobs are run on 1 worker to insure that all jobs report back their data """ options = Job.Runner.getDefaultOptions(self._getTestJobStorePath()) options.clean = "never" options.stats = True Job.Runner.startToil(RunTwoJobsPerWorker(), options) jobStore = Toil.loadOrCreateJobStore(options.jobStore) stats = getStats(options) collatedStats = processData(jobStore.config, stats, options) self.assertTrue(len(collatedStats.job_types) == 2, "Some jobs are not represented in the stats")
def testMultipleJobsPerWorkerStats(self): """ Tests case where multiple jobs are run on 1 worker to insure that all jobs report back their data """ options = Job.Runner.getDefaultOptions(self._getTestJobStorePath()) options.clean = 'never' options.stats = True Job.Runner.startToil(RunTwoJobsPerWorker(), options) jobStore = Toil.resumeJobStore(options.jobStore) stats = getStats(jobStore) collatedStats = processData(jobStore.config, stats) self.assertTrue( len(collatedStats.job_types) == 2, "Some jobs are not represented in the stats")