Skip to content

Allow reading config parameters from environment variables #558

@bpkroth

Description

@bpkroth

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions