當前位置: 首頁>>代碼示例>>Python>>正文


Python settings.TestConfig類代碼示例

本文整理匯總了Python中perfrunner.settings.TestConfig的典型用法代碼示例。如果您正苦於以下問題:Python TestConfig類的具體用法?Python TestConfig怎麽用?Python TestConfig使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了TestConfig類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: main

def main():
    usage = '%prog -c cluster -t test_config -v version'

    parser = OptionParser(usage)

    parser.add_option('-c', dest='cluster_spec_fname',
                      help='path to cluster specification file',
                      metavar='ClusterSpecFilePath')
    parser.add_option('-t', dest='test_config_fname',
                      help='path to test config file',
                      metavar='TestConfigFilePath')
    parser.add_option('-v', dest='version',
                      help='build version', metavar='Version')

    options, _ = parser.parse_args()
    if not options.cluster_spec_fname or not options.test_config_fname \
            or not options.version:
        parser.error('Missing mandatory parameter')

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname)

    test_config = TestConfig()
    test_config.parse(options.test_config_fname)

    installer = GatewayInstaller(cluster_spec, test_config, options)
    installer.install()
開發者ID:lichenyang2,項目名稱:perfrunner,代碼行數:27,代碼來源:install_gw.py

示例2: main

def main():
    usage = '%prog -c cluster -t test_config -v version'

    parser = OptionParser(usage)

    parser.add_option('-c', dest='cluster_spec_fname',
                      help='path to cluster specification file',
                      metavar='ClusterSpecFilePath')
    parser.add_option('-t', dest='test_config_fname',
                      help='path to test config file',
                      metavar='TestConfigFilePath')
    parser.add_option('-v', dest='version',
                      help='build version', metavar='Version')
    parser.add_option('--verbose', dest='verbose', action='store_true',
                      help='enable verbose logging')

    options, args = parser.parse_args()
    override = args and [arg.split('.') for arg in ' '.join(args).split(',')]

    if not options.cluster_spec_fname or not options.test_config_fname \
            or not options.version:
        parser.error('Missing mandatory parameter')

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname)

    test_config = TestConfig()
    test_config.parse(options.test_config_fname, override)

    installer = GatewayInstaller(cluster_spec, test_config, options)
    installer.install()
開發者ID:abhi-bit,項目名稱:perfrunner,代碼行數:31,代碼來源:install_gw.py

示例3: main

def main():
    options, args = get_options()
    override = args and (arg.split('.') for arg in ' '.join(args).split(','))

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname)
    test_config = TestConfig()
    test_config.parse(options.test_config_fname, override)

    cm = ClusterManager(cluster_spec, test_config)

    # Individual nodes
    cm.restart_with_alternative_num_vbuckets()
    cm.restart_with_alternative_num_cpus()
    cm.configure_internal_settings()
    cm.set_data_path()
    cm.set_auth()
    cm.set_mem_quota()
    cm.disable_moxi()

    time.sleep(30)  # crutch

    # Cluster
    if cm.group_number > 1:
        cm.create_server_groups()
    cm.add_nodes()
    cm.create_buckets()
    cm.restart_with_alternative_bucket_options()
    cm.wait_until_warmed_up()
    cm.configure_auto_compaction()
    cm.enable_auto_failover()
    cm.change_watermarks()
    cm.tweak_memory()
    cm.remote.disable_wan()
    cm.start_cbq_engine()
開發者ID:lichenyang2,項目名稱:perfrunner,代碼行數:35,代碼來源:cluster.py

示例4: main

def main():
    options, args = get_options()

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname, args)
    test_config = TestConfig()
    test_config.parse(options.test_config_fname, args)

    cm = ClusterManager(cluster_spec, test_config, options.verbose)

    # Individual nodes
    if cm.remote:
        cm.tune_logging()
        cm.restart_with_sfwi()
        cm.restart_with_alternative_num_vbuckets()
        cm.restart_with_alternative_num_cpus()
        cm.restart_with_tcmalloc_aggressive_decommit()
        cm.disable_moxi()
    cm.configure_internal_settings()
    cm.configure_xdcr_settings()
    time.sleep(10)  # dkao: crutch
    cm.set_data_path()
    cm.set_services()
    cm.set_mem_quota()
    cm.set_index_mem_quota()
    cm.set_fts_index_mem_quota()
    cm.set_auth()

    time.sleep(30)  # crutch

    # Cluster
    if cm.group_number > 1:
        cm.create_server_groups()
    cm.add_nodes()
    if cm.test_config.cluster.num_buckets:
        cm.create_buckets()
    if cm.test_config.cluster.emptybuckets:
        cm.create_buckets(empty_buckets=True)
    if cm.remote:
        cm.restart_with_alternative_bucket_options()
    cm.wait_until_warmed_up()
    cm.wait_until_healthy()
    cm.configure_auto_compaction()
    cm.enable_auto_failover()
    cm.change_watermarks()
    if cm.remote:
        cm.set_index_settings()
        cm.change_dcp_io_threads()
        time.sleep(60)
        cm.set_query_settings()
        cm.tweak_memory()
        cm.remote.disable_wan()
        cm.start_cbq_engine()
開發者ID:bharath-gp,項目名稱:perfrunner,代碼行數:53,代碼來源:cluster.py

示例5: main

def main():
    args = get_args()

    cluster_spec = ClusterSpec()
    cluster_spec.parse(args.cluster_spec_fname, override=args.override)
    test_config = TestConfig()
    test_config.parse(args.test_config_fname, override=args.override)

    cm = ClusterManager(cluster_spec, test_config, args.verbose)

    # Individual nodes
    cm.disable_wan()
    cm.clear_login_history()
    cm.tune_memory_settings()
    cm.throttle_cpu()
    cm.enable_ipv6()
    cm.tune_logging()
    cm.restart_with_alternative_num_vbuckets()
    cm.flush_iptables()

    cm.configure_internal_settings()
    cm.set_data_path()
    cm.set_index_path()
    cm.set_analytics_path()
    cm.set_mem_quotas()
    cm.set_services()
    cm.rename()
    cm.set_auth()
    cm.configure_xdcr_settings()

    # Cluster
    cm.add_nodes()
    cm.rebalance()
    cm.enable_auto_failover()
    cm.configure_auto_compaction()
    cm.enable_audit()

    if cm.test_config.cluster.num_buckets:
        cm.create_buckets()
        cm.create_eventing_buckets()
        cm.create_eventing_metadata_bucket()
        cm.add_rbac_users()

    cm.restart_with_alternative_bucket_options()
    cm.set_index_settings()
    cm.set_query_settings()
    cm.set_x509_certificates()
    cm.wait_until_healthy()
    cm.wait_until_warmed_up()

    cm.tweak_memory()
開發者ID:couchbase,項目名稱:perfrunner,代碼行數:51,代碼來源:cluster.py

示例6: main

def main():
    options, args = get_options()

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname, args)
    test_config = TestConfig()
    test_config.parse(options.test_config_fname, args)

    test_module = test_config.test_case.test_module
    test_class = test_config.test_case.test_class
    exec('from {} import {}'.format(test_module, test_class))

    with eval(test_class)(cluster_spec, test_config, options.verbose) as test:
        test.run()
開發者ID:mahesh152,項目名稱:perfrunner,代碼行數:14,代碼來源:__main__.py

示例7: main

def main():
    options, args = get_options()

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname, args)
    test_config = TestConfig()
    test_config.parse(options.test_config_fname, args)

    cm = ClusterManager(cluster_spec, test_config, options.verbose)

    # Individual nodes
    if cm.remote:
        cm.remote.disable_wan()
        cm.tune_logging()
        cm.restart_with_alternative_num_vbuckets()

    cm.configure_internal_settings()
    cm.set_data_path()
    cm.set_services()
    cm.rename()
    cm.set_mem_quota()
    cm.set_index_mem_quota()
    cm.set_fts_index_mem_quota()
    cm.set_auth()
    cm.configure_xdcr_settings()

    # Cluster
    if cm.group_number > 1:
        cm.create_server_groups()
    cm.add_nodes()
    cm.rebalance()
    cm.enable_auto_failover()
    cm.configure_auto_compaction()

    if cm.test_config.cluster.num_buckets:
        cm.create_buckets()

    if cm.remote:
        cm.restart_with_alternative_bucket_options()
        cm.set_index_settings()
        cm.set_query_settings()

    cm.wait_until_warmed_up()
    cm.wait_until_healthy()

    if cm.remote:
        cm.tweak_memory()
開發者ID:mahesh152,項目名稱:perfrunner,代碼行數:47,代碼來源:cluster.py

示例8: FunctionalTest

class FunctionalTest(unittest.TestCase):

    def __init__(self, *args, **kwargs):
        options, args = get_options()

        self.cluster_spec = ClusterSpec()
        self.cluster_spec.parse(options.cluster_spec_fname, args)
        self.test_config = TestConfig()
        self.test_config.parse(options.test_config_fname, args)

        self.target_iterator = TargetIterator(self.cluster_spec,
                                              self.test_config)
        self.memcached = MemcachedHelper(self.test_config)
        self.remote = RemoteHelper(self.cluster_spec, self.test_config)
        self.rest = RestHelper(self.cluster_spec)

        super(FunctionalTest, self).__init__(*args, **kwargs)
開發者ID:EricACooper,項目名稱:perfrunner,代碼行數:17,代碼來源:functional.py

示例9: FunctionalTest

class FunctionalTest(unittest.TestCase):

    def __init__(self, *args, **kwargs):
        options, _args = get_options()
        override = \
            _args and (arg.split('.') for arg in ' '.join(_args).split(','))

        self.cluster_spec = ClusterSpec()
        self.cluster_spec.parse(options.cluster_spec_fname)
        self.test_config = TestConfig()
        self.test_config.parse(options.test_config_fname, override)

        self.target_iterator = TargetIterator(self.cluster_spec,
                                              self.test_config)
        self.memcached = MemcachedHelper(self.cluster_spec)
        self.remote = RemoteHelper(self.cluster_spec)

        super(FunctionalTest, self).__init__(*args, **kwargs)
開發者ID:lichenyang2,項目名稱:perfrunner,代碼行數:18,代碼來源:functional.py

示例10: main

def main():
    options, args = get_options()
    override = args and (arg.split('.') for arg in itertools.chain(*csv.reader(args)))

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname)
    test_config = TestConfig()
    test_config.parse(options.test_config_fname, override)

    cm = ClusterManager(cluster_spec, test_config, options.verbose)

    # Individual nodes
    cm.tune_logging()
    cm.restart_with_sfwi()
    cm.restart_with_alternative_num_vbuckets()
    cm.restart_with_alternative_num_cpus()
    cm.restart_with_alternative_jemalloc_conf()

    # NOTE: configure_tcmalloc_aggressive_decommit() should be after
    # any restarts, as it doesn't survive a restart.
    cm.configure_tcmalloc_aggressive_decommit()
    cm.configure_internal_settings()
    cm.set_data_path()
    cm.set_auth()
    cm.set_mem_quota()
    cm.disable_moxi()

    time.sleep(30)  # crutch

    # Cluster
    if cm.group_number > 1:
        cm.create_server_groups()
    cm.add_nodes()
    if cm.test_config.cluster.num_buckets:
        cm.create_buckets()
    cm.restart_with_alternative_bucket_options()
    cm.wait_until_warmed_up()
    cm.wait_until_healthy()
    cm.configure_auto_compaction()
    cm.enable_auto_failover()
    cm.change_watermarks()
    cm.tweak_memory()
    cm.remote.disable_wan()
    cm.start_cbq_engine()
開發者ID:daverigby,項目名稱:perfrunner,代碼行數:44,代碼來源:cluster.py

示例11: main

def main():
    options, args = get_options()
    override = args and [arg.split('.') for arg in itertools.chain(*csv.reader(args))]

    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname, override)
    test_config = TestConfig()
    test_config.parse(options.test_config_fname, override)
    experiment = options.exp_fname and Experiment(options.exp_fname)

    test_module = test_config.test_case.test_module
    test_class = test_config.test_case.test_class
    exec('from {} import {}'.format(test_module, test_class))

    with eval(test_class)(cluster_spec,
                          test_config,
                          options.verbose,
                          experiment) as test:
        test.run()
開發者ID:daverigby,項目名稱:perfrunner,代碼行數:19,代碼來源:__main__.py

示例12: test_stale_false

 def test_stale_false(self):
     test_config = TestConfig()
     test_config.parse('tests/query_lat_20M_state_false.test', [])
     views_params = test_config.index_settings.params
     self.assertEqual(views_params, {'stale': 'false'})
開發者ID:bharath-gp,項目名稱:perfrunner,代碼行數:5,代碼來源:unittests.py

示例13: test_stale_update_after

 def test_stale_update_after(self):
     test_config = TestConfig()
     test_config.parse('tests/query_lat_20M.test', [])
     views_params = test_config.index_settings.params
     self.assertEqual(views_params, {})
開發者ID:bharath-gp,項目名稱:perfrunner,代碼行數:5,代碼來源:unittests.py

示例14: main

def main():
    usage = '%prog -v version -c cluster-spec -f conffile -b build -t tag'
    parser = OptionParser(usage)

    parser.add_option('-v', '--version', dest='version')
    parser.add_option('-c', dest='cluster_spec_fname',
                      help='path to cluster specification file',
                      metavar='cluster.spec')
    parser.add_option('--verbose', dest='verbose', action='store_true',
                      help='enable verbose logging')

    parser.add_option('-t', dest='test_config_fname',
                      help='path to test configuration file',
                      metavar='my_test.test')

    parser.add_option('-e', '--edition', dest='cluster_edition', default='enterprise',
                      help='the cluster edition (community or enterprise)')
    parser.add_option('--url', dest='url', default=None,
                      help='The http URL to a Couchbase RPM that should be'
                           ' installed.  This overrides the URL to be installed.')

    parser.add_option('-f', '--filename', dest='filename')
    parser.add_option('-b','--build',dest='build')
    parser.add_option('-n','--number',dest='number')

    options, args = parser.parse_args()
    test_id=options.number + '_'+options.build

    data=None
    try:
        with open(options.filename) as data_file:
            data = json.load(data_file)
    except (OSError, IOError,ValueError) as e:
        raise e
    mng_data = manage_test_result(['beer_queries','travel_queries'])
    mng_data.create_cb_instance(data["couchbase_server"],data["couchbase_query_bucket"])

    options, args = parser.parse_args()
    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname, args)

    test_config = TestConfig()
    test_config.parse(options.test_config_fname, args)

    cm = ClusterManager(cluster_spec, test_config, options.verbose)

    installer = CouchbaseInstaller(cluster_spec, options)
    if True:
        installer.install()
        if cm.remote:
            cm.tune_logging()
            cm.restart_with_alternative_num_vbuckets()
        cm.configure_internal_settings()
        cm.set_data_path()
        cm.set_services()
        cm.set_mem_quota()
        cm.set_index_mem_quota()
        cm.set_auth()
        time.sleep(30)
        """host = cluster_spec.yield_masters().next()"""
    host_ip = cluster_spec.yield_masters().next().split(':')[0]
    URL = 'http://' + host_ip + ':8093'
    logger.info('logging the URL: {}'.format(URL))
    conn = urllib3.connection_from_url(URL)
    rest = RestHelper(cluster_spec)
    airline_result = do_airline_benchmarks(mng_data,conn, rest, host_ip, installer.remote, cluster_spec)
    beer_result = do_beer_queries(mng_data,conn, rest, host_ip, installer.remote)
    print 'beer_result is', beer_result


    #mng_data.cb_load_test(data["couchbase_query_bucket"],beer_result)
    mng_data.load_data_query_benchmark(data["couchbase_query_bucket"],'query_benchmark',test_id,options.version)
    mng_data.show_data_query_benchmark(data["couchbase_query_bucket"],'query_benchmark',test_id)
    sys.exit(not (airline_result and beer_result))
開發者ID:mahesh152,項目名稱:perfrunner,代碼行數:74,代碼來源:query_benchmark_new.py

示例15: main

def main():

    global couchbaseConnection, version, runStartTime

    usage = '%prog -v version -c cluster-spec'
    parser = OptionParser(usage)
    parser.add_option('-v', '--version', dest='version')
    parser.add_option('-r', '--runStartTime', dest='runStartTime')
    parser.add_option('-c', dest='cluster_spec_fname',
                      help='path to cluster specification file',
                      metavar='cluster.spec')
    parser.add_option('--verbose', dest='verbose', action='store_true',
                      help='enable verbose logging')

    parser.add_option('-t', dest='test_config_fname',
                      help='path to test configuration file',
                      metavar='my_test.test')

    parser.add_option('-e', '--edition', dest='cluster_edition', default='enterprise',
                      help='the cluster edition (community or enterprise)')
    parser.add_option('--url', dest='url', default=None,
                      help='The http URL to a Couchbase RPM that should be'
                           ' installed.  This overrides the URL to be installed.')
    options, args = parser.parse_args()
    cluster_spec = ClusterSpec()
    cluster_spec.parse(options.cluster_spec_fname, args)

    test_config = TestConfig()
    test_config.parse(options.test_config_fname, args)

    cm = ClusterManager(cluster_spec, test_config, options.verbose)


    couchbaseConnection = Couchbase.connect(bucket='Daily-Performance', host='172.23.105.177')

    runStartTime = options.runStartTime
    version = options.version
    #bucket = Bucket('couchbase://'+ '172.23.105.177:8091/Daily-Performance')

    installer = CouchbaseInstaller(cluster_spec, options)
    if True:
        installer.install()
        if cm.remote:
            cm.tune_logging()
            cm.restart_with_alternative_num_vbuckets()
        cm.configure_internal_settings()
        cm.set_data_path()
        cm.set_services()
        cm.set_mem_quota()
        cm.set_index_mem_quota()
        cm.set_auth()
        time.sleep(30)
        """host = cluster_spec.yield_masters().next()"""
    host_ip = cluster_spec.yield_masters().next().split(':')[0]
    URL = 'http://' + host_ip + ':8093'
    logger.info('logging the URL: {}'.format(URL))
    conn = urllib3.connection_from_url(URL)
    rest = RestHelper(cluster_spec)
    cm.set_index_settings()
    airline_result = do_airline_benchmarks(conn, rest, host_ip, installer.remote, cluster_spec, options.version)
    beer_result = do_beer_queries(conn, rest, host_ip, installer.remote)
    print 'beer_result is', beer_result
    sabre_result = do_sabre_benchmarks(conn, rest, host_ip, installer.remote, cluster_spec)
    sys.exit(not (airline_result and beer_result and sabre_result))
開發者ID:mahesh152,項目名稱:perfrunner,代碼行數:64,代碼來源:query_benchmark.py


注:本文中的perfrunner.settings.TestConfig類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。