Exemplo n.º 1
0
def search_experiments_by_research_group_owner_name(firstname="",
                                                    lastname="",
                                                    processes=4,
                                                    check_integrity=False):
    _init()

    #transform params into mongo search dictironary
    _test_search_experiment_by_research_group_owner_name_mongo[
        "header.research_group.owner.firstname"] = firstname
    _test_search_experiment_by_research_group_owner_name_mongo[
        "header.research_group.owner.lastname"] = lastname

    ora_param = [firstname, lastname]
    #function references for integriy check and measure functions
    ora = lambda: oc.query_experiment_ids(
        _test_search_experiment_by_research_group_owner_name_oracle, ora_param)
    mon = lambda: mo.find_ids(
        _test_search_experiment_by_research_group_owner_name_mongo)
    #function references for paralel run
    ora_m = lambda: _measure_oracle(ora)
    mon_m = lambda: _measure_mongo(mon)
    #run the tests
    _paralel_run(processes, ora_m, mon_m)

    print "### SEARCH EXPERIMENTS BY RESEARCH GROUP OWNER RESULTS ###"
    if (check_integrity):
        _check_integrity(ora, mon)
    print "Oracle: " + str(_oracle_time / processes)
    print "Mongo: " + str(_mongo_time / processes)
    print "########"
Exemplo n.º 2
0
def search_experiments_by_subject_age(age=18,
                                      processes=4,
                                      check_integrity=False):
    _init()

    #transform params into mongo search dictironary
    now = datetime.now()
    bday = datetime(now.year - age, now.month, now.day)
    _test_search_experiment_by_subject_age_mongo["subject.date_of_birth"][
        "$lte"] = bday

    ora_param = [age]
    #function references for integriy check and measure functions
    ora = lambda: oc.query_experiment_ids(
        _test_search_experiment_by_subject_age_oracle, ora_param)
    mon = lambda: mo.find_ids(_test_search_experiment_by_subject_age_mongo)
    #function references for paralel run
    ora_m = lambda: _measure_oracle(ora)
    mon_m = lambda: _measure_mongo(mon)
    #run the tests
    _paralel_run(processes, ora_m, mon_m)

    print "### SEARCH EXPERIMENTS BY SUBJECT AGE RESULTS ###"
    if (check_integrity):
        _check_integrity(ora, mon)
    print "Oracle: " + str(_oracle_time / processes)
    print "Mongo: " + str(_mongo_time / processes)
    print "########"
Exemplo n.º 3
0
def search_experiments_by_scenario_name(scenario_name,
                                        processes=4,
                                        check_integrity=False):
    _init()

    #transform params into mongo search dictironary
    _test_search_experiment_by_scenario_name_mongo[
        "scenario.name"] = scenario_name

    #function references for integriy check and measure functions
    ora = lambda: oc.query_experiment_ids(
        _test_search_experiment_by_scenario_name_oracle, [scenario_name])
    mon = lambda: mo.find_ids(_test_search_experiment_by_scenario_name_mongo)
    #function references for paralel run
    ora_m = lambda: _measure_oracle(ora)
    mon_m = lambda: _measure_mongo(mon)
    #run the tests
    _paralel_run(processes, ora_m, mon_m)

    print "### SEARCH EXPERIMENTS BY SCENARIO TITLE RESULTS ###"
    if (check_integrity):
        _check_integrity(ora, mon)
    print "Oracle: " + str(_oracle_time / processes)
    print "Mongo: " + str(_mongo_time / processes)
    print "######"
def search_experiments_by_scenario_name(scenario_name, processes=4, check_integrity=False):
    _init()

    #transform params into mongo search dictironary
    _test_search_experiment_by_scenario_name_mongo["scenario.name"] = scenario_name

    #function references for integriy check and measure functions
    ora = lambda: oc.query_experiment_ids(_test_search_experiment_by_scenario_name_oracle, [scenario_name])
    mon = lambda: mo.find_ids(_test_search_experiment_by_scenario_name_mongo)
    #function references for paralel run
    ora_m = lambda: _measure_oracle(ora)
    mon_m = lambda: _measure_mongo(mon)
    #run the tests
    _paralel_run(processes,ora_m,mon_m)

    print "### SEARCH EXPERIMENTS BY SCENARIO TITLE RESULTS ###"
    if(check_integrity):
        _check_integrity(ora, mon)
    print "Oracle: " + str(_oracle_time/processes)
    print "Mongo: " + str(_mongo_time/processes)
    print "######"
def search_experiments_by_research_group_owner_name(firstname="", lastname="", processes=4, check_integrity=False):
    _init()

    #transform params into mongo search dictironary
    _test_search_experiment_by_research_group_owner_name_mongo["header.research_group.owner.firstname"] = firstname
    _test_search_experiment_by_research_group_owner_name_mongo["header.research_group.owner.lastname"] = lastname

    ora_param = [firstname, lastname]
    #function references for integriy check and measure functions
    ora = lambda: oc.query_experiment_ids(_test_search_experiment_by_research_group_owner_name_oracle, ora_param)
    mon = lambda: mo.find_ids(_test_search_experiment_by_research_group_owner_name_mongo)
    #function references for paralel run
    ora_m = lambda: _measure_oracle(ora)
    mon_m = lambda: _measure_mongo(mon)
    #run the tests
    _paralel_run(processes,ora_m,mon_m)

    print "### SEARCH EXPERIMENTS BY RESEARCH GROUP OWNER RESULTS ###"
    if(check_integrity):
        _check_integrity(ora, mon)
    print "Oracle: " + str(_oracle_time/processes)
    print "Mongo: " + str(_mongo_time/processes)
    print "########"
def search_experiments_by_subject_age(age=18, processes=4, check_integrity=False):
    _init()

    #transform params into mongo search dictironary
    now = datetime.now()
    bday = datetime(now.year - age, now.month, now.day)
    _test_search_experiment_by_subject_age_mongo["subject.date_of_birth"]["$lte"]=bday

    ora_param = [age]
    #function references for integriy check and measure functions
    ora = lambda: oc.query_experiment_ids(_test_search_experiment_by_subject_age_oracle, ora_param)
    mon = lambda: mo.find_ids(_test_search_experiment_by_subject_age_mongo)
    #function references for paralel run
    ora_m = lambda: _measure_oracle(ora)
    mon_m = lambda: _measure_mongo(mon)
    #run the tests
    _paralel_run(processes,ora_m,mon_m)

    print "### SEARCH EXPERIMENTS BY SUBJECT AGE RESULTS ###"
    if(check_integrity):
        _check_integrity(ora, mon)
    print "Oracle: " + str(_oracle_time/processes)
    print "Mongo: " + str(_mongo_time/processes)
    print "########"