Skip to content

Commit

Permalink
Merge pull request #5380 from EnterpriseDB/dev/pgcp-58
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-heyer authored Mar 12, 2024
2 parents c17e5bb + 5baa5d2 commit 517e432
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions product_docs/docs/pwr/1/configuring.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,60 @@ navTitle: "Configuring"
description: "How to configure Postgres Workload Report after installation"
---

## `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.
## Configuration file locations

Postgres Workload Report looks for a configuration file in the following places, and uses the first one found:

1. The file named in the `--config` command-line option, if given.
2. The file named in the `PWR_CONFIG_FILE` environment variable, if set.
3. `~/.pwr.conf`.
4. `/etc/pwr.conf`.

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.
two places where Postgres Workload Report looks for a configuration file by default (locations #3 or #4 in the previous list), and editing the options in the template as necessary.

You can configure the following options.
!!! Note
If no configuration file is found, Postgres Workload Report assumes the default value for all options, which can still be overriden via the corresponding command-line options. See [Using Postgres Workload Report](using/) for more on using command-line options.
!!!

## Configuration file 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](using)).
An existing directory where the `edb_wait_states` portion of a Lasso report are located. This option is used mainly for `pwr report` execution (see [Using Postgres Workload Report](using)).

### `output_dir`

Specifies where to output reports. During execution, Postgres Workload Report tries to create the directory if it doesn't exist.
Location of the directory where Postgres Workload Report writes report files. Executing `pwr` will create this 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.
The name of the report files generated. Usually, you would specify this option on the command line because different reports typically have different names.

Don't include a file extension; an appropriate extension will be added will be added based on the output format(s) specified on the command line (`--pdf` adds `.pdf`, `--html` adds `.html`, and so on).

### `log_file`

Provides the full path to the file where PWR writes the `stdout` and `stderr` logs.
The full path to the file where Postgres Workload Report 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:
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`
- `DEBUG`
- `INFO` (default if not specified)
- `WARNING`
- `ERROR`
- `CRITICAL`

See [the Python logging](https://docs.python.org/3/library/logging.html#logging-levels) 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](https://docs.python.org/3/library/logging.html#logrecord-attributes) documentation for more information on log formatting.
The format of the log messages that are written to the log file. See [the Python logging](https://docs.python.org/3/library/logging.html#logrecord-attributes) 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.
The directory containing the Jinja templates used to format the HTML output and the CSS used for PDF output. The default value is `/usr/share/pwr/assets`, which contains the assets provided with the `edb-pwr` package.

1 comment on commit 517e432

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.