Support more [filter:slo] parameters
Change-Id: I29e118af2ad9893ab1cc42a1d6befdfa07395a20
This commit is contained in:
parent
1ef0107008
commit
ef9ff55131
|
@ -8,29 +8,54 @@
|
|||
# == Parameters
|
||||
#
|
||||
# [*max_manifest_segments*]
|
||||
# Max manifest segments.
|
||||
# Default to 1000.
|
||||
# (Optional) Max manifest segments.
|
||||
# Defaults to 1000.
|
||||
#
|
||||
# [*max_manifest_size*]
|
||||
# Max manifest size.
|
||||
# Default to 2097152.
|
||||
# (Optional) Max manifest size.
|
||||
# Defaults to 2097152.
|
||||
#
|
||||
# [*min_segment_size*]
|
||||
# minimal segment size
|
||||
# Default to 1048576.
|
||||
# (Optional) minimal segment size
|
||||
# Defaults to 1048576.
|
||||
#
|
||||
# [*rate_limit_under_size*]
|
||||
# (Optional) Rate limiting applies only to segments smaller than this size.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*rate_limit_after_segment*]
|
||||
# Start rate-limiting SLO segment serving after the Nth segment of a segmented object.
|
||||
# Default to 10.
|
||||
# (Optional) Start rate-limiting SLO segment serving after the Nth segment of
|
||||
# a segmented object.
|
||||
# Defaults to 10.
|
||||
#
|
||||
# [*rate_limit_segments_per_sec*]
|
||||
# Once segment rate-limiting kicks in for an object, limit segments served to N per second.
|
||||
# 0 means no rate-limiting.
|
||||
# Default to 0.
|
||||
# (Optional) Once segment rate-limiting kicks in for an object, limit segments
|
||||
# served to N per second. 0 means no rate-limiting.
|
||||
# Defaults to 0.
|
||||
#
|
||||
# [*max_get_time*]
|
||||
# Time limit on GET requests (seconds).
|
||||
# Default to 86400.
|
||||
# (Optional) Time limit on GET requests (seconds).
|
||||
# Defaults to 86400.
|
||||
#
|
||||
# [*concurrency*]
|
||||
# (Optional) Limit how many subrequests may be executed concurrently.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*delete_concurrency*]
|
||||
# (Optional) Limit how many delete subrequests may be executed concurrently.
|
||||
# This may be used to separately tune validation and delete concurrency
|
||||
# values.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*yield_frequency*]
|
||||
# (Optional) Frequency, in seconds, to yield whitespace ahed of the final
|
||||
# response.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*allow_async_delete*]
|
||||
# (Optional) Allow clients to request the object-expirer handle the deletion
|
||||
# of segments using query params like `?multipart-manifest=delete&async=on`.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# == Authors
|
||||
#
|
||||
|
@ -44,9 +69,14 @@ class swift::proxy::slo (
|
|||
$max_manifest_segments = '1000',
|
||||
$max_manifest_size = '2097152',
|
||||
$min_segment_size = '1048576',
|
||||
$rate_limit_under_size = $::os_service_default,
|
||||
$rate_limit_after_segment = '10',
|
||||
$rate_limit_segments_per_sec = '0',
|
||||
$max_get_time = '86400'
|
||||
$max_get_time = '86400',
|
||||
$concurrency = $::os_service_default,
|
||||
$delete_concurrency = $::os_service_default,
|
||||
$yield_frequency = $::os_service_default,
|
||||
$allow_async_delete = $::os_service_default,
|
||||
) {
|
||||
|
||||
include swift::deps
|
||||
|
@ -56,8 +86,13 @@ class swift::proxy::slo (
|
|||
'filter:slo/max_manifest_segments': value => $max_manifest_segments;
|
||||
'filter:slo/max_manifest_size': value => $max_manifest_size;
|
||||
'filter:slo/min_segment_size': value => $min_segment_size;
|
||||
'filter:slo/rate_limit_under_size': value => $rate_limit_under_size;
|
||||
'filter:slo/rate_limit_after_segment': value => $rate_limit_after_segment;
|
||||
'filter:slo/rate_limit_segments_per_sec': value => $rate_limit_segments_per_sec;
|
||||
'filter:slo/max_get_time': value => $max_get_time;
|
||||
'filter:slo/concurrency': value => $concurrency;
|
||||
'filter:slo/delete_concurrency': value => $delete_concurrency;
|
||||
'filter:slo/yield_frequency': value => $yield_frequency;
|
||||
'filter:slo/allow_async_delete': value => $allow_async_delete;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
The following four parameters have been added to the ``swift::proxy::slo``
|
||||
class.
|
||||
|
||||
- ``rate_limit_under_size``
|
||||
- ``concurrency``
|
||||
- ``delete_concurrency``
|
||||
- ``yield_frequency``
|
||||
- ``allow_async_delete``
|
|
@ -7,25 +7,40 @@ describe 'swift::proxy::slo' do
|
|||
it { is_expected.to contain_swift_proxy_config('filter:slo/max_manifest_segments').with_value('1000') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/max_manifest_size').with_value('2097152') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/min_segment_size').with_value('1048576') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/rate_limit_under_size').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/rate_limit_after_segment').with_value('10') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/rate_limit_segments_per_sec').with_value('0') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/max_get_time').with_value('86400') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/concurrency').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/delete_concurrency').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/yield_frequency').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/allow_async_delete').with_value('<SERVICE DEFAULT>') }
|
||||
end
|
||||
|
||||
describe "when overriding default parameters" do
|
||||
let :params do
|
||||
{
|
||||
:max_manifest_segments => '2000',
|
||||
:max_manifest_size => '500000',
|
||||
:rate_limit_after_segment => '30',
|
||||
:max_get_time => '6400',
|
||||
:max_manifest_segments => 2000,
|
||||
:max_manifest_size => 500000,
|
||||
:rate_limit_under_size => 1048576,
|
||||
:rate_limit_after_segment => 30,
|
||||
:max_get_time => 6400,
|
||||
:concurrency => 2,
|
||||
:delete_concurrency => 4,
|
||||
:yield_frequency => 10,
|
||||
:allow_async_delete => false,
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/max_manifest_segments').with_value('2000') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/max_manifest_size').with_value('500000') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/rate_limit_after_segment').with_value('30') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/max_get_time').with_value('6400') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/max_manifest_segments').with_value(2000) }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/max_manifest_size').with_value(500000) }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/rate_limit_under_size').with_value(1048576) }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/rate_limit_after_segment').with_value(30) }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/max_get_time').with_value(6400) }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/concurrency').with_value(2) }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/delete_concurrency').with_value(4) }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/yield_frequency').with_value(10) }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:slo/allow_async_delete').with_value(false) }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue