Parametrized LoadTestShape
See original GitHub issueIt’d be nice if we were able to parametrize custom LoadTestShape
s. For example control peak number of users or test duration as a whole.
Is your feature request related to a problem? Please describe.
I want to measure resources utilization for different amount of users. To achieve that I’ve prepared usage characteristics from our logs and want to see how much more users we can support with current hardware. To do that I want to test my service with different peak user counts - e.g. 1k, 2k, 3k, etc. For now it’s really frustrating to do because I always need to change that value in file.
Describe the solution you’d like
I’d be nice if we were able to access some kind of context information from LoadTestShape
that could contain configuration in form of simple dictionary. e.g.
def tick(self):
max_users = self.context.parameters['max_users']
...
Parameters could be set via HTTP form <input name="load_parameter[max_users]" />
or CLI parameter: --load-parameter max_users=200
.
HTTP form could be changed by wraping it with some block and thus allowing to easily overwrite it with custom form.
Describe alternatives you’ve considered
For CLI usage probable environment variables would be good enough, but for HTTP it’s not really viable - especially because we’re using k8s.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top GitHub Comments
I tought more about being able to overwrite actual form and provide our own html (via template extending, for example, or some other way):
And it would look like this:
It’d require change to
templates/index.html
by wraping it with{% block swarm_form %}{% endblock %}
. Then everything that was sent by form insideparameter
dictionary should be accessible toLoadTestShape
.By default we could of course just display
<textarea name="parameter[data]"></textarea>
that could be parsed - so if someone for any reason don’t want to be bothered with HTML modification.I could try to achieve something like that in free time, and give you some kind of response how hard was to implement that (eventually submit PR if it’d be good enough) 😃
OK I see. Sounds good. There was some previous PR IIRC about making the UI more editable.