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

Make host url configurable from UI #205

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ikorihn
Copy link

@ikorihn ikorihn commented Aug 20, 2024

Related to #177, this PR allows boomer to receive the host url configured in master UI.
When boomer receives the spawn message including host field, it publishes a new boomer:spawn3 event.

@@ -126,6 +126,11 @@ verbose: %t`, method, url, timeout, postFile, contentType, disableCompression, d
Timeout: time.Duration(timeout) * time.Second,
}

// Update the host URL passed from UI
boomer.Events.Subscribe(boomer.EVENT_SPAWN3, func(workers int, spawnRate float64, host string) {
Copy link
Owner

Choose a reason for hiding this comment

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

what about a more understandable name like boomer.EVENT_CONFIG?

Copy link
Author

Choose a reason for hiding this comment

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

That makes sense! I applied that f090ff9

runner.go Outdated
@@ -43,6 +43,7 @@ type runner struct {

numClients int32
spawnRate float64
targetHost string
Copy link
Owner

Choose a reason for hiding this comment

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

I don't want to keep this field. Publishing an event is enough.

Copy link
Author

Choose a reason for hiding this comment

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

I removed the field in a553bd9 .

runner.go Outdated
Events.Publish(EVENT_SPAWN, spawnCount, spawnRate)
Events.Publish(EVENT_SPAWN3, spawnCount, spawnRate, host)
Copy link
Owner

Choose a reason for hiding this comment

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

What about Events.Publish(EVENT_CONFIG, "host", host)?

Copy link
Author

Choose a reason for hiding this comment

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

I have modified the code to publish the boomer:config event along with a map f090ff9 .
Is this what you meant?

Copy link
Owner

Choose a reason for hiding this comment

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

yes, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants