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

Allow reading config parameters from environment variables #558

Open
bpkroth opened this issue Sep 20, 2024 · 0 comments
Open

Allow reading config parameters from environment variables #558

bpkroth opened this issue Sep 20, 2024 · 0 comments

Comments

@bpkroth
Copy link
Collaborator

bpkroth commented Sep 20, 2024

Rather than generating a new config for each experiment, it can sometimes be useful to templatize a config with some external scripts.

Even more useful would be to support templated configs via benchbase directly, reading the values out of environment variables, or else substituting with defaults.

For instance:

<?xml version="1.0"?>
<parameters>
    <template>true</template>

    <!-- Connection details -->
    <type>POSTGRES</type>
    <driver>org.postgresql.Driver</driver>
    <url>jdbc:postgresql://${BENCHBASE_SERVER_ADDRESS:localhost}:5432/benchbase?sslmode=disable&amp;ApplicationName=tpcc&amp;reWriteBatchedInserts=true</url>
    <username>${BENCHBASE_USERNAME:admin}</username>
    <password>${BENCHBASE_PASSWORD:password}</password>
    <reconnectOnConnectionFailure>true</reconnectOnConnectionFailure>
    <isolation>TRANSACTION_SERIALIZABLE</isolation>
    <batchsize>128</batchsize>

    <!-- Scale factor is the number of warehouses in TPCC -->
    <scalefactor>${BENCHBASE_SCALEFACTOR:1}</scalefactor>

    <!-- The workload -->
    <terminals>1</terminals>
    <works>
        <work>
            <time>${BENCHBASE_TIME:60}</time>
            <rate>${BENCHBASE_RATE:10000}</rate>
        </work>
    </works>

    <!-- ... -->
</parameters>
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

No branches or pull requests

1 participant