本文整理汇总了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."))
]
示例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')
示例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')
示例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')
示例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')