Python oslo_config.cfg.FloatOpt() Examples

The following are 5 code examples of oslo_config.cfg.FloatOpt(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module oslo_config.cfg , or try the search function .
Example #1
Source File: config.py    From syntribos with Apache License 2.0 6 votes vote down vote up
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."))
    ] 
Example #2
Source File: config.py    From st2 with Apache License 2.0 6 votes vote down vote up
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') 
Example #3
Source File: config.py    From st2 with Apache License 2.0 5 votes vote down vote up
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') 
Example #4
Source File: config.py    From st2 with Apache License 2.0 5 votes vote down vote up
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') 
Example #5
Source File: config.py    From st2 with Apache License 2.0 4 votes vote down vote up
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')