dbstress icon indicating copy to clipboard operation
dbstress copied to clipboard

Passing unit config via env variables

Open semberal opened this issue 10 years ago • 2 comments

Currently, if you don't want to hardcode password in the scenario configuration YAML, you can use --password cmdline parameter, which can be used to set password for all the units. It is not flexible enough as it should be possible to pass different passwords for different units.

The new solution should use environment variables like this: dbstress_${unit_name}_${property}=${value}.

semberal avatar Jan 01 '16 16:01 semberal

Hi, I have made little different implementation for environment variables. Env vars refenrences are in config file like

unit_name: unit4 description: foo test query: select * from foobar_table uri: ${DB_URL} driver_class: ${DB_DRIVER} username: ${DB_USER} password: ${DB_PASSWD} parallel_connections: 10 repeats: 100 connection_timeout: 3000

If this meets requirements enough, maybe i can make pull request?

JukkaUusisalo avatar Oct 09 '19 14:10 JukkaUusisalo

Hello,

the is close to what I wanted, but the problem is that this implementation does not allow different credentials for different units. For example, you cannot have unit1 with password foo and unit2 with password bar. Maybe such flexibility is not needed, though, and we would be fine with env vars like that.

Could you send a PR, please? I will take a look. I also think the env vars should be prefixed with DBSTRESS_. Thank you!

semberal avatar Oct 12 '19 17:10 semberal