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


Python cfg.FloatOpt方法代碼示例

本文整理匯總了Python中oslo_config.cfg.FloatOpt方法的典型用法代碼示例。如果您正苦於以下問題:Python cfg.FloatOpt方法的具體用法?Python cfg.FloatOpt怎麽用?Python cfg.FloatOpt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在oslo_config.cfg的用法示例。


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

示例1: list_test_opts

# 需要導入模塊: from oslo_config import cfg [as 別名]
# 或者: from oslo_config.cfg import FloatOpt [as 別名]
def list_test_opts():
    return [
        cfg.FloatOpt("length_diff_percent", default=1000.0,
                     help=_(
                         "Percentage difference between initial request "
                         "and test request body length to trigger a signal")),
        cfg.FloatOpt("time_diff_percent", default=1000.0,
                     help=_(
                         "Percentage difference between initial response "
                         "time and test response time to trigger a signal")),
        cfg.IntOpt("max_time", default=10,
                   help=_(
                       "Maximum absolute time (in seconds) to wait for a "
                       "response before triggering a timeout signal")),
        cfg.IntOpt("max_length", default=500,
                   help=_(
                       "Maximum length (in characters) of the response text")),
        cfg.ListOpt("failure_keys", default="[`syntax error`]",
                    help=_(
                        "Comma seperated list of keys for which the test "
                        "would fail."))
    ] 
開發者ID:openstack-archive,項目名稱:syntribos,代碼行數:24,代碼來源:config.py

示例2: _register_scheduler_opts

# 需要導入模塊: from oslo_config import cfg [as 別名]
# 或者: from oslo_config.cfg import FloatOpt [as 別名]
def _register_scheduler_opts():
    scheduler_opts = [
        cfg.FloatOpt(
            'execution_scheduling_timeout_threshold_min', default=1,
            help='How long GC to search back in minutes for orphaned scheduled actions'),
        cfg.IntOpt(
            'pool_size', default=10,
            help='The size of the pool used by the scheduler for scheduling executions.'),
        cfg.FloatOpt(
            'sleep_interval', default=0.01,
            help='How long to sleep between each action scheduler main loop run interval (in ms).'),
        cfg.FloatOpt(
            'gc_interval', default=5,
            help='How often to look for zombie executions before rescheduling them (in ms).'),
        cfg.IntOpt(
            'retry_max_attempt', default=3,
            help='The maximum number of attempts that the scheduler retries on error.'),
        cfg.IntOpt(
            'retry_wait_msec', default=100,
            help='The number of milliseconds to wait in between retries.')
    ]

    _register_opts(scheduler_opts, group='scheduler') 
開發者ID:StackStorm,項目名稱:st2,代碼行數:25,代碼來源:config.py

示例3: _register_garbage_collector_opts

# 需要導入模塊: from oslo_config import cfg [as 別名]
# 或者: from oslo_config.cfg import FloatOpt [as 別名]
def _register_garbage_collector_opts():
    common_opts = [
        cfg.IntOpt(
            'collection_interval', default=DEFAULT_COLLECTION_INTERVAL,
            help='How often to check database for old data and perform garbage collection.'),
        cfg.FloatOpt(
            'sleep_delay', default=DEFAULT_SLEEP_DELAY,
            help='How long to wait / sleep (in seconds) between '
                 'collection of different object types.')
    ]

    _register_opts(common_opts, group='garbagecollector')

    ttl_opts = [
        cfg.IntOpt(
            'action_executions_ttl', default=None,
            help='Action executions and related objects (live actions, action output '
                 'objects) older than this value (days) will be automatically deleted.'),
        cfg.IntOpt(
            'action_executions_output_ttl', default=7,
            help='Action execution output objects (ones generated by action output '
                 'streaming) older than this value (days) will be automatically deleted.'),
        cfg.IntOpt(
            'trigger_instances_ttl', default=None,
            help='Trigger instances older than this value (days) will be automatically deleted.')
    ]

    _register_opts(ttl_opts, group='garbagecollector')

    inquiry_opts = [
        cfg.BoolOpt(
            'purge_inquiries', default=False,
            help='Set to True to perform garbage collection on Inquiries (based on '
                 'the TTL value per Inquiry)')
    ]

    _register_opts(inquiry_opts, group='garbagecollector') 
開發者ID:StackStorm,項目名稱:st2,代碼行數:39,代碼來源:config.py

示例4: _register_service_opts

# 需要導入模塊: from oslo_config import cfg [as 別名]
# 或者: from oslo_config.cfg import FloatOpt [as 別名]
def _register_service_opts():
    scheduler_opts = [
        cfg.StrOpt(
            'logging',
            default='/etc/st2/logging.scheduler.conf',
            help='Location of the logging configuration file.'
        ),
        cfg.FloatOpt(
            'execution_scheduling_timeout_threshold_min', default=1,
            help='How long GC to search back in minutes for orphaned scheduled actions'),
        cfg.IntOpt(
            'pool_size', default=10,
            help='The size of the pool used by the scheduler for scheduling executions.'),
        cfg.FloatOpt(
            'sleep_interval', default=0.10,
            help='How long (in seconds) to sleep between each action scheduler main loop run '
                 'interval.'),
        cfg.FloatOpt(
            'gc_interval', default=10,
            help='How often (in seconds) to look for zombie execution requests before rescheduling '
                 'them.'),
        cfg.IntOpt(
            'retry_max_attempt', default=10,
            help='The maximum number of attempts that the scheduler retries on error.'),
        cfg.IntOpt(
            'retry_wait_msec', default=3000,
            help='The number of milliseconds to wait in between retries.')
    ]

    cfg.CONF.register_opts(scheduler_opts, group='scheduler') 
開發者ID:StackStorm,項目名稱:st2,代碼行數:32,代碼來源:config.py

示例5: _register_garbage_collector_opts

# 需要導入模塊: from oslo_config import cfg [as 別名]
# 或者: from oslo_config.cfg import FloatOpt [as 別名]
def _register_garbage_collector_opts():
    logging_opts = [
        cfg.StrOpt(
            'logging', default='/etc/st2/logging.garbagecollector.conf',
            help='Location of the logging configuration file.')
    ]

    CONF.register_opts(logging_opts, group='garbagecollector')

    common_opts = [
        cfg.IntOpt(
            'collection_interval', default=DEFAULT_COLLECTION_INTERVAL,
            help='How often to check database for old data and perform garbage collection.'),
        cfg.FloatOpt(
            'sleep_delay', default=DEFAULT_SLEEP_DELAY,
            help='How long to wait / sleep (in seconds) between '
                 'collection of different object types.')
    ]

    CONF.register_opts(common_opts, group='garbagecollector')

    ttl_opts = [
        cfg.IntOpt(
            'action_executions_ttl', default=None,
            help='Action executions and related objects (live actions, action output '
                 'objects) older than this value (days) will be automatically deleted.'),
        cfg.IntOpt(
            'action_executions_output_ttl', default=7,
            help='Action execution output objects (ones generated by action output '
                 'streaming) older than this value (days) will be automatically deleted.'),
        cfg.IntOpt(
            'trigger_instances_ttl', default=None,
            help='Trigger instances older than this value (days) will be automatically deleted.')
    ]

    CONF.register_opts(ttl_opts, group='garbagecollector')

    inquiry_opts = [
        cfg.BoolOpt(
            'purge_inquiries', default=False,
            help='Set to True to perform garbage collection on Inquiries (based on '
                 'the TTL value per Inquiry)')
    ]

    CONF.register_opts(inquiry_opts, group='garbagecollector') 
開發者ID:StackStorm,項目名稱:st2,代碼行數:47,代碼來源:config.py


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