From dd5389663923584843864234821590e9d01da744 Mon Sep 17 00:00:00 2001 From: taylan isikdemir Date: Mon, 9 Dec 2024 13:05:51 -0800 Subject: [PATCH] fix --- common/stats/stats_benchmark_test.go | 7 ++++--- host/testdata/matching_simulation_burst_adaptive.yaml | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/common/stats/stats_benchmark_test.go b/common/stats/stats_benchmark_test.go index d9c14c81ac4..3e71bdffc55 100644 --- a/common/stats/stats_benchmark_test.go +++ b/common/stats/stats_benchmark_test.go @@ -28,13 +28,14 @@ import ( "time" "github.com/uber/cadence/common/clock" + "github.com/uber/cadence/service/matching/event" ) // Benchmark the ReportCounter function to see how it handles frequent updates func BenchmarkReportCounter(b *testing.B) { timeSource := clock.NewRealTimeSource() // Initialize the QPS reporter with a smoothing factor and a 1 second bucket interval - reporter := NewEmaFixedWindowQPSTracker(timeSource, 0.5, time.Second) + reporter := NewEmaFixedWindowQPSTracker(timeSource, 0.5, time.Second, event.E{}) reporter.Start() // Run the benchmark for b.N iterations @@ -52,7 +53,7 @@ func BenchmarkReportCounter(b *testing.B) { func BenchmarkQPS(b *testing.B) { timeSource := clock.NewRealTimeSource() // Initialize the QPS reporter - reporter := NewEmaFixedWindowQPSTracker(timeSource, 0.5, time.Second) + reporter := NewEmaFixedWindowQPSTracker(timeSource, 0.5, time.Second, event.E{}) reporter.Start() // Simulate a number of report updates before calling QPS @@ -75,7 +76,7 @@ func BenchmarkQPS(b *testing.B) { func BenchmarkFullReport(b *testing.B) { timeSource := clock.NewRealTimeSource() // Initialize the QPS reporter - reporter := NewEmaFixedWindowQPSTracker(timeSource, 0.5, time.Millisecond*100) // 100ms bucket interval + reporter := NewEmaFixedWindowQPSTracker(timeSource, 0.5, time.Millisecond*100, event.E{}) // 100ms bucket interval reporter.Start() var wg sync.WaitGroup diff --git a/host/testdata/matching_simulation_burst_adaptive.yaml b/host/testdata/matching_simulation_burst_adaptive.yaml index ad92420c507..0aec9f60766 100644 --- a/host/testdata/matching_simulation_burst_adaptive.yaml +++ b/host/testdata/matching_simulation_burst_adaptive.yaml @@ -28,8 +28,8 @@ matchingconfig: enableadaptivescaler: true partitiondownscalefactor: 0.75 partitionupscalerps: 200 - partitionupscalesustainedduration: 1m - partitiondownscalesustainedduration: 1m - adaptivescalerupdateinterval: 2s + partitionupscalesustainedduration: 5s + partitiondownscalesustainedduration: 5s + adaptivescalerupdateinterval: 1s workerconfig: enableasyncwfconsumer: false