Collect all tests to run and run them.

        Each method will be run :attr:`Benchmark.times`.
179441
def run(self):
        '''
        
        '''
        tests = self._collect()

        if not tests:
            return

        self.times
        self.before_class()

        for test in tests:
            func = getattr(self, test)
            results = self.results[test] = Result()
            self._before(self, test)
            self.before()
            for i in range(self.times):
                self._before_each(self, test, i)
                result = self._run_one(func)
                results.total += result.duration
                if result.success:
                    results.has_success = True
                else:
                    results.has_errors = True
                self._after_each(self, test, i)
                if self.debug and not result.success:
                    results.error = result.result
                    break
            self.after()
            self._after(self, test)

        self.after_class()
522379
def main():
    """"""
    desc = 'Benchmark the files generated by generate.py'
    parser = argparse.ArgumentParser(description=desc)
    parser.add_argument(
        '--src',
        dest='src_dir',
        default='generated',
        help='The directory containing the sources to benchmark'
    )
    parser.add_argument(
        '--out',
        dest='out_dir',
        default='../../doc',
        help='The output directory'
    )
    parser.add_argument(
        '--include',
        dest='include',
        default='include',
        help='The directory containing the headeres for the benchmark'
    )
    parser.add_argument(
        '--boost_headers',
        dest='boost_headers',
        default='../../../..',
        help='The directory containing the Boost headers (the boost directory)'
    )
    parser.add_argument(
        '--compiler',
        dest='compiler',
        default='g++',
        help='The compiler to do the benchmark with'
    )
    parser.add_argument(
        '--repeat_count',
        dest='repeat_count',
        type=int,
        default=5,
        help='How many times a measurement should be repeated.'
    )

    args = parser.parse_args()

    compiler = compiler_info(args.compiler)
    results = benchmark(
        args.src_dir,
        args.compiler,
        [args.include, args.boost_headers],
        args.repeat_count
    )

    plot_diagrams(results, configs_in(args.src_dir), compiler, args.out_dir)
464841
def run():
    
    # GLOBALS
    global cwd, files, logger_start, logger_benchmark, settings, _timeseries_data
    _timeseries_data = {}
    # files = {".lpd": [ {"full_path", "filename_ext", "filename_no_ext", "dir"} ], ".xls": [...], ".txt": [...]}
    settings = {"note_update": True, "note_validate": True, "verbose": True}
    cwd = os.getcwd()
    # logger created in whatever directory lipd is called from
    logger_start = create_logger("start")
    logger_benchmark = create_benchmark("benchmarks", "benchmark.log")
    files = {".txt": [], ".lpd": [], ".xls": []}

    return
968601
def disc_benchmarks(root, ignore_import_errors=False):
    

    root_name = os.path.basename(root)

    for module in disc_modules(root_name, ignore_import_errors=ignore_import_errors):
        for attr_name, module_attr in (
            (k, v) for k, v in module.__dict__.items()
            if not k.startswith('_')
        ):
            if inspect.isclass(module_attr):
                for name, class_attr in inspect.getmembers(module_attr):
                    if (inspect.isfunction(class_attr) or
                            inspect.ismethod(class_attr)):
                        benchmark = _get_benchmark(name, module, module_attr,
                                                   class_attr)
                        if benchmark is not None:
                            yield benchmark
            elif inspect.isfunction(module_attr):
                benchmark = _get_benchmark(attr_name, module, None, module_attr)
                if benchmark is not None:
                    yield benchmark
1319743
def run(self, ds, skip_checks, *checker_names):
        

        ret_val = {}
        checkers = self._get_valid_checkers(ds, checker_names)

        if skip_checks is not None:
            skip_check_dict = CheckSuite._process_skip_checks(skip_checks)
        else:
            skip_check_dict = defaultdict(lambda: None)

        if len(checkers) == 0:
            print("No valid checkers found for tests '{}'".format(",".join(checker_names)))

        for checker_name, checker_class in checkers:

            checker = checker_class() # instantiate a Checker object
            checker.setup(ds)         # setup method to prep

            checks = self._get_checks(checker, skip_check_dict)
            vals = []
            errs = {}   # check method name -> (exc, traceback)

            for c, max_level in checks:
                try:
                    vals.extend(self._run_check(c, ds, max_level))
                except Exception as e:
                    errs[c.__func__.__name__] = (e, sys.exc_info()[2])

            # score the results we got back
            groups = self.scores(vals)

            ret_val[checker_name] = groups, errs

        return ret_val
397667
def load_from_module(self, module):
        ''''''
        benchmarks = []
        for name in dir(module):
            obj = getattr(module, name)
            if (inspect.isclass(obj) and issubclass(obj, Benchmark)
                    and obj != Benchmark):
                benchmarks.append(obj)
        return benchmarks
1262548
def collect_methods
      list = @context.method_list

      unless @options.show_all then
        list = list.select do |m|
          m.visibility == :public or
            m.visibility == :protected or
            m.force_documentation
        end
      end

      @methods = list.collect do |m|
        RDoc::Generator::Method.new m, self, @options
      end
    end
1369578
def _find_benchmarks(self):
        """"""
        def is_bench_method(attrname, prefix="bench"):
            return attrname.startswith(prefix) and hasattr(getattr(self.__class__, attrname), '__call__')
        return list(filter(is_bench_method, dir(self.__class__)))
1207274
def run_tasks(self):
        '''
        
        '''
        pool = Pool(len(self.tasks))
        for task in self.tasks:
            # Launch a green thread to schedule the task
            # A task will be managed by 2 green thread: execution thread and scheduling thread
            pool.spawn(self.run, task)
        return pool
550780
List<BenchmarkMethod> getBenchmarkMethods()
			throws PerfidixMethodCheckException {
		// Generating Set for returnVal
		final List<BenchmarkMethod> elems = new ArrayList<BenchmarkMethod>();
		// Getting all Methods and testing if its benchmarkable
		for (final Class<?> clazz : clazzes) {
			for (final Method meth : clazz.getDeclaredMethods()) {
				// Check if benchmarkable, if so, insert to returnVal;
				if (BenchmarkMethod.isBenchmarkable(meth)) {
					final BenchmarkMethod benchmarkMeth = new BenchmarkMethod(
							meth);
					elems.add(benchmarkMeth);
				}
			}
		}
		return elems;
	}
796666
def doBenchmark(plats):
	'''
		
	'''
	logger = logging.getLogger("osrframework.utils")
	# defining the results dict
	res = {}
	
	# args
	args = []
	
	#for p in plats:
	#	args.append( (str(p),) )
	
	# selecting the number of tries to be performed
	tries = [1, 4, 8 ,16, 24, 32, 40, 48, 56, 64]
	
	#for i in range(1, len(plats)/10):
	#	tries.append(i*10)
	
	logger.info("The test is starting recovering webpages by creating the following series of threads: " + str(tries))
	
	for i in tries:
		print "Testing creating " + str(i) + " simultaneous threads..."
		# starting 
		t0 = time.clock()
		pool = Pool(i)
		# We call the wrapping function with all the args previously generated
		poolResults = pool.map(multi_run_wrapper, args)  
		
		t1 = time.clock()
		# storing the results
		res[i] = t1 - t0
		print str(i) + "\t" + str(res[i]) + "\n"
	
	return res
382722
def get_task_runs(self, json_file=None):
        """"""
        if self.project is None:
            raise ProjectError
        loader = create_task_runs_loader(self.project.id, self.tasks,
                                         json_file, self.all)
        self.task_runs, self.task_runs_file = loader.load()

        self._check_project_has_taskruns()
        self.task_runs_df = dataframer.create_task_run_data_frames(self.tasks, self.task_runs)
628973
def get_all_methods
      methods = []
      each_type do | type |
        type.each_method do |meth|
          methods << meth
        end
      end
      methods
    end
536974
def run(self, test: unittest.TestSuite):
        
        start_time = time.time()
        process = []
        resource_manager = multiprocessing.Manager()
        results_queue = resource_manager.Queue()
        tasks_running = resource_manager.BoundedSemaphore(self.process_number)

        test_suites, local_test_suites = self.collect_tests(test)

        results_collector = ResultCollector(
            self.stream, self.descriptions, self.verbosity,
            result_queue=results_queue, test_results=self._makeResult(),
            tests=test_suites
        )

        results_collector.start()

        for index, suite in enumerate(test_suites):
            tasks_running.acquire()
            x = self.Process(index, suite, results_queue, tasks_running)
            x.start()
            process.append(x)

        local_test_suites.run(results_collector)

        for i in process:
            i.join()

        results_queue.join()
        results_collector.end_collection()
        results_collector.join()

        results_collector.printErrors()
        self.print_summary(results_collector, time.time() - start_time)

        return results_collector
505813
def get_all_methods(self, entry_point=ALL, protocol=ALL, sort_methods=False):
        """"""

        if sort_methods:
            return [
                method for (_, method) in sorted(self._registry.items()) if method.is_valid_for(entry_point, protocol)
            ]

        return self._registry.values()
462361
def methods(self):
        
        done = {}
        for astroid in itertools.chain(iter((self,)), self.ancestors()):
            for meth in astroid.mymethods():
                if meth.name in done:
                    continue
                done[meth.name] = None
                yield meth
198484
def run(self):
        

        self.info_log("The test batch is ready.")

        self.executed_tests = []

        for test in self.tests:
            localhost_instance = LocalhostInstance(
                runner=self,
                browser_config=self.browser_config,
                test_name=test.Test.name
            )

            localhost_instance.startup()

            with DbSessionContext(BROME_CONFIG['database']['mongo_database_name']) as session:  # noqa
                test_batch = session.query(Testbatch)\
                    .filter(Testbatch.mongo_id == self.test_batch_id).one()
                test_batch.total_executing_tests = 1
                session.save(test_batch, safe=True)

            test_ = test.Test(
                runner=self,
                browser_config=self.browser_config,
                name=test.Test.name,
                test_batch_id=self.test_batch_id,
                localhost_instance=localhost_instance,
                index=1
            )

            test_.execute()
            self.executed_tests.append(test_)

            localhost_instance.tear_down()