Skip to content

Commit

Permalink
recheck
Browse files Browse the repository at this point in the history
Signed-off-by: husharp <jinhao.hu@pingcap.com>
  • Loading branch information
HuSharp committed Jan 18, 2024
1 parent 3607af1 commit de02922
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/utils/etcdutil/etcdutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ func (checker *HealthyChecker) inspector(ctx context.Context) {
for _, ep := range lastEps {
// add new trend
if _, ok := checker.allRecordUrls[ep]; !ok {
checker.allRecordUrls[ep] = trend.NewTrend(fmt.Sprintf("%s-%s", checker.name, ep), 20)
checker.allRecordUrls[ep] = trend.NewTrend(fmt.Sprintf("%s-%s", checker.name, ep), 20*time.Second)
etcdAsyncVals[ep] = trend.NewAsyncFromEtcd()
}
}
Expand Down
2 changes: 1 addition & 1 deletion server/trend/trend.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func laLbRateSimple(laAvg, lbAvg, marginError float64) float64 {
}

// TODO: unSensitiveCause reduce influence of spike
const unSensitiveCause = 2.0
const unSensitiveCause = 3.0

// A*(A-B)^2 / Sqrt(B) = x
func laLbRate(laAvg float64, lbAvg float64, marginError float64) float64 {
Expand Down
2 changes: 1 addition & 1 deletion server/trend/trend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func TestTrendGetAsyncMock(t *testing.T) {
now = now.Add(time.Millisecond * 100)
time.Sleep(time.Millisecond * 100)
res := float64(rand.Intn(8)+1) * 0.001
trend.Record(1, res+4, now)
trend.Record(1, res+10, now)
}

log.Info("--------------------- normal ---------------------")
Expand Down

0 comments on commit de02922

Please sign in to comment.