Configuring Postgres Workload Report v1

pwr configuration file

To reduce the number of command-line arguments needed when executing pwr, you can use a configuration file to specify options that always have the same value and whose values differ from the default.

During execution, pwr looks for an existing configuration file in ~/.pwr.conf and /etc/pwr.conf, in that order, and uses the first one found. However, if the --config option specifies a configuration file, that value overrides the default locations.

The installation package creates a template for the configuration file in /etc/pwr.conf.templ. We recommend copying this file to one of the two places where pwr looks for a configuration file and editing the options in the template as necessary.

You can configure the following options.

input_dir

Identifies an existing directory where the edb_wait_states contents of a Lasso report are located. This option is used mainly for pwr report execution (see Using Postgres Workload Report).

output_dir

Specifies where to output reports. During execution, Postgres Workload Report tries to create the directory if it doesn't exist.

report_name

Provides the name of the report files generated. Usually, you specify this option from the command line because different reports typically have different names.

log_file

Provides the full path to the file where PWR writes the stdout and stderr logs.

log_level

Specifies the logging level to use when running Postgres Workload Report. The following are valid values, listed from more verbose to less verbose:

`DEBUG`
`INFO` (default if not specified)
`WARNING`
`ERROR`
`CRITICAL`

See the Python logging documentation for more information about log levels.

log_format

Provides the format of the log messages that are written to the log file. See the Python logging documentation for more information on log formatting.

assets_dir

Identifies the directory where you can find the Jinja templates used to format the HTML output and the CSS used for PDF output. Typically, the directory to use by default is /usr/share/pwr/assets, which contains the assets provided with the edb-pwr package.