-
Notifications
You must be signed in to change notification settings - Fork 244
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
base: master
Are you sure you want to change the base?
Conversation
_examples/http/client.go
Outdated
@@ -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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, thanks
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 newboomer:spawn3
event.