Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Benchmark] Prevent PID windup at start #3759

Merged
merged 1 commit into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions integration/benchmark/cmd/ci/adjuster.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type adjuster struct {
log zerolog.Logger
}
type AdjusterParams struct {
Delay time.Duration
Interval time.Duration
InitialTPS uint
MinTPS uint
Expand Down Expand Up @@ -76,6 +77,14 @@ func NewTPSAdjuster(
go func() {
defer close(a.done)

log.Info().Dur("delayInMS", params.Delay).Msg("Waiting before starting TPS adjuster")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this idea to inform the user there's going to be a delay.

select {
case <-time.After(params.Delay):
log.Info().Msg("starting TPS adjuster")
case <-ctx.Done():
return
}

err := a.adjustTPSForever()
if err != nil && err != context.Canceled {
log.Error().Err(err).Msg("adjuster failed")
Expand Down
2 changes: 2 additions & 0 deletions integration/benchmark/cmd/ci/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func main() {
maxTPSFlag := flag.Int("tps-max", *initialTPSFlag, "maximum transactions per second allowed")
minTPSFlag := flag.Int("tps-min", *initialTPSFlag, "minimum transactions per second allowed")
adjustIntervalFlag := flag.Duration("tps-adjust-interval", defaultAdjustInterval, "interval for adjusting TPS")
adjustDelayFlag := flag.Duration("tps-adjust-delay", 120*time.Second, "delay before adjusting TPS")
statIntervalFlag := flag.Duration("stat-interval", defaultMetricCollectionInterval, "")
durationFlag := flag.Duration("duration", 10*time.Minute, "test duration")
gitRepoPathFlag := flag.String("git-repo-path", "../..", "git repo path of the filesystem")
Expand Down Expand Up @@ -186,6 +187,7 @@ func main() {
workerStatsTracker,

AdjusterParams{
Delay: *adjustDelayFlag,
Interval: *adjustIntervalFlag,
InitialTPS: uint(*initialTPSFlag),
MinTPS: uint(*minTPSFlag),
Expand Down