Temper stream allocator more (#1920)
* Temper stream allocator more * gofmt * AllowPause default
This commit is contained in:
+10
-4
@@ -139,7 +139,9 @@ type CongestionControlProbeConfig struct {
|
|||||||
|
|
||||||
type CongestionControlChannelObserverConfig struct {
|
type CongestionControlChannelObserverConfig struct {
|
||||||
EstimateRequiredSamples int `yaml:"estimate_required_samples,omitempty"`
|
EstimateRequiredSamples int `yaml:"estimate_required_samples,omitempty"`
|
||||||
|
EstimateRequiredSamplesMin int `yaml:"estimate_required_samples_min,omitempty"`
|
||||||
EstimateDownwardTrendThreshold float64 `yaml:"estimate_downward_trend_threshold,omitempty"`
|
EstimateDownwardTrendThreshold float64 `yaml:"estimate_downward_trend_threshold,omitempty"`
|
||||||
|
EstimateDownwardTrendMaxWait time.Duration `yaml:"estimate_downward_trend_max_wait,omitempty"`
|
||||||
EstimateCollapseThreshold time.Duration `yaml:"estimate_collapse_threshold,omitempty"`
|
EstimateCollapseThreshold time.Duration `yaml:"estimate_collapse_threshold,omitempty"`
|
||||||
EstimateValidityWindow time.Duration `yaml:"estimate_validity_window,omitempty"`
|
EstimateValidityWindow time.Duration `yaml:"estimate_validity_window,omitempty"`
|
||||||
NackWindowMinDuration time.Duration `yaml:"nack_window_min_duration,omitempty"`
|
NackWindowMinDuration time.Duration `yaml:"nack_window_min_duration,omitempty"`
|
||||||
@@ -331,7 +333,9 @@ var DefaultConfig = Config{
|
|||||||
},
|
},
|
||||||
ChannelObserverProbeConfig: CongestionControlChannelObserverConfig{
|
ChannelObserverProbeConfig: CongestionControlChannelObserverConfig{
|
||||||
EstimateRequiredSamples: 3,
|
EstimateRequiredSamples: 3,
|
||||||
|
EstimateRequiredSamplesMin: 3,
|
||||||
EstimateDownwardTrendThreshold: 0.0,
|
EstimateDownwardTrendThreshold: 0.0,
|
||||||
|
EstimateDownwardTrendMaxWait: 5 * time.Second,
|
||||||
EstimateCollapseThreshold: 0,
|
EstimateCollapseThreshold: 0,
|
||||||
EstimateValidityWindow: 10 * time.Second,
|
EstimateValidityWindow: 10 * time.Second,
|
||||||
NackWindowMinDuration: 500 * time.Millisecond,
|
NackWindowMinDuration: 500 * time.Millisecond,
|
||||||
@@ -339,12 +343,14 @@ var DefaultConfig = Config{
|
|||||||
NackRatioThreshold: 0.04,
|
NackRatioThreshold: 0.04,
|
||||||
},
|
},
|
||||||
ChannelObserverNonProbeConfig: CongestionControlChannelObserverConfig{
|
ChannelObserverNonProbeConfig: CongestionControlChannelObserverConfig{
|
||||||
EstimateRequiredSamples: 8,
|
EstimateRequiredSamples: 12,
|
||||||
EstimateDownwardTrendThreshold: -0.5,
|
EstimateRequiredSamplesMin: 8,
|
||||||
|
EstimateDownwardTrendThreshold: -0.6,
|
||||||
|
EstimateDownwardTrendMaxWait: 5 * time.Second,
|
||||||
EstimateCollapseThreshold: 500 * time.Millisecond,
|
EstimateCollapseThreshold: 500 * time.Millisecond,
|
||||||
EstimateValidityWindow: 10 * time.Second,
|
EstimateValidityWindow: 10 * time.Second,
|
||||||
NackWindowMinDuration: 1 * time.Second,
|
NackWindowMinDuration: 2 * time.Second,
|
||||||
NackWindowMaxDuration: 2 * time.Second,
|
NackWindowMaxDuration: 3 * time.Second,
|
||||||
NackRatioThreshold: 0.08,
|
NackRatioThreshold: 0.08,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -90,7 +90,9 @@ func NewChannelObserver(params ChannelObserverParams, logger logger.Logger) *Cha
|
|||||||
Name: params.Name + "-estimate",
|
Name: params.Name + "-estimate",
|
||||||
Logger: logger,
|
Logger: logger,
|
||||||
RequiredSamples: params.Config.EstimateRequiredSamples,
|
RequiredSamples: params.Config.EstimateRequiredSamples,
|
||||||
|
RequiredSamplesMin: params.Config.EstimateRequiredSamplesMin,
|
||||||
DownwardTrendThreshold: params.Config.EstimateDownwardTrendThreshold,
|
DownwardTrendThreshold: params.Config.EstimateDownwardTrendThreshold,
|
||||||
|
DownwardTrendMaxWait: params.Config.EstimateDownwardTrendMaxWait,
|
||||||
CollapseThreshold: params.Config.EstimateCollapseThreshold,
|
CollapseThreshold: params.Config.EstimateCollapseThreshold,
|
||||||
ValidityWindow: params.Config.EstimateValidityWindow,
|
ValidityWindow: params.Config.EstimateValidityWindow,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -57,7 +57,9 @@ type TrendDetectorParams struct {
|
|||||||
Name string
|
Name string
|
||||||
Logger logger.Logger
|
Logger logger.Logger
|
||||||
RequiredSamples int
|
RequiredSamples int
|
||||||
|
RequiredSamplesMin int
|
||||||
DownwardTrendThreshold float64
|
DownwardTrendThreshold float64
|
||||||
|
DownwardTrendMaxWait time.Duration
|
||||||
CollapseThreshold time.Duration
|
CollapseThreshold time.Duration
|
||||||
ValidityWindow time.Duration
|
ValidityWindow time.Duration
|
||||||
}
|
}
|
||||||
@@ -203,7 +205,7 @@ func (t *TrendDetector) prune() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *TrendDetector) updateDirection() {
|
func (t *TrendDetector) updateDirection() {
|
||||||
if len(t.samples) < t.params.RequiredSamples {
|
if len(t.samples) < t.params.RequiredSamplesMin {
|
||||||
t.direction = TrendDirectionNeutral
|
t.direction = TrendDirectionNeutral
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -213,9 +215,9 @@ func (t *TrendDetector) updateDirection() {
|
|||||||
|
|
||||||
t.direction = TrendDirectionNeutral
|
t.direction = TrendDirectionNeutral
|
||||||
switch {
|
switch {
|
||||||
case kt > 0:
|
case kt > 0 && len(t.samples) >= t.params.RequiredSamples:
|
||||||
t.direction = TrendDirectionUpward
|
t.direction = TrendDirectionUpward
|
||||||
case kt < t.params.DownwardTrendThreshold:
|
case kt < t.params.DownwardTrendThreshold && (len(t.samples) >= t.params.RequiredSamples || t.samples[len(t.samples)-1].at.Sub(t.samples[0].at) > t.params.DownwardTrendMaxWait):
|
||||||
t.direction = TrendDirectionDownward
|
t.direction = TrendDirectionDownward
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user