|
| 1 | +>>> import sys |
| 2 | +>>> import pytest |
| 3 | +>>> if sys.version_info >= (3, 13): |
| 4 | +... pytest.skip("only applies for Python version < 3.13") |
| 5 | +... |
| 6 | + |
| 7 | +>>> from pgactivity import cli |
| 8 | +>>> parser = cli.get_parser() |
| 9 | +>>> parser.print_help() |
| 10 | +usage: pytest [options] [connection string] |
| 11 | +<BLANKLINE> |
| 12 | +htop like application for PostgreSQL server activity monitoring. |
| 13 | +<BLANKLINE> |
| 14 | +Configuration: |
| 15 | + -P PROFILE, --profile PROFILE |
| 16 | + Configuration profile matching a PROFILE.conf file in |
| 17 | + ${XDG_CONFIG_HOME:~/.config}/pg_activity/ or |
| 18 | + /etc/pg_activity/, or a built-in profile. |
| 19 | +<BLANKLINE> |
| 20 | +Options: |
| 21 | + --blocksize BLOCKSIZE |
| 22 | + Filesystem blocksize (default: 4096). |
| 23 | + --rds Enable support for AWS RDS (implies --no-tempfiles and |
| 24 | + filters out the rdsadmin database from space |
| 25 | + calculation). |
| 26 | + --output FILEPATH Store running queries as CSV. |
| 27 | + --db-size, --no-db-size |
| 28 | + Enable/disable total size of DB. |
| 29 | + --tempfiles, --no-tempfiles |
| 30 | + Enable/disable tempfile count and size. |
| 31 | + --walreceiver, --no-walreceiver |
| 32 | + Enable/disable walreceiver checks. |
| 33 | + -w, --wrap-query Wrap query column instead of truncating. |
| 34 | + --duration-mode DURATION_MODE |
| 35 | + Duration mode. Values: 1-QUERY(default), |
| 36 | + 2-TRANSACTION, 3-BACKEND. |
| 37 | + --min-duration SECONDS |
| 38 | + Don't display queries with smaller than specified |
| 39 | + duration (in seconds). |
| 40 | + --filter FIELD:REGEX Filter activities with a (case insensitive) regular |
| 41 | + expression applied on selected fields. Known fields |
| 42 | + are: dbname. |
| 43 | + --debug-file DEBUG_FILE |
| 44 | + Enable debug and write it to DEBUG_FILE. |
| 45 | + --version show program's version number and exit. |
| 46 | + --help Show this help message and exit. |
| 47 | +<BLANKLINE> |
| 48 | +Connection Options: |
| 49 | + connection string A valid connection string to the database, e.g.: |
| 50 | + 'host=HOSTNAME port=PORT user=USER dbname=DBNAME'. |
| 51 | + -h HOSTNAME, --host HOSTNAME |
| 52 | + Database server host or socket directory. |
| 53 | + -p PORT, --port PORT Database server port. |
| 54 | + -U USERNAME, --username USERNAME |
| 55 | + Database user name. |
| 56 | + -d DBNAME, --dbname DBNAME |
| 57 | + Database name to connect to. |
| 58 | +<BLANKLINE> |
| 59 | +Process table display options: |
| 60 | + These options may be used hide some columns from the processes table. |
| 61 | +<BLANKLINE> |
| 62 | + --pid, --no-pid Enable/disable PID. |
| 63 | + --database, --no-database |
| 64 | + Enable/disable DATABASE. |
| 65 | + --user, --no-user Enable/disable USER. |
| 66 | + --client, --no-client |
| 67 | + Enable/disable CLIENT. |
| 68 | + --cpu, --no-cpu Enable/disable CPU%. |
| 69 | + --mem, --no-mem Enable/disable MEM%. |
| 70 | + --read, --no-read Enable/disable READ/s. |
| 71 | + --write, --no-write Enable/disable WRITE/s. |
| 72 | + --time, --no-time Enable/disable TIME+. |
| 73 | + --wait, --no-wait Enable/disable W. |
| 74 | + --app-name, --no-app-name |
| 75 | + Enable/disable APP. |
| 76 | +<BLANKLINE> |
| 77 | +Header display options: |
| 78 | + --no-inst-info Hide instance information. |
| 79 | + --no-sys-info Hide system information. |
| 80 | + --no-proc-info Hide workers process information. |
| 81 | +<BLANKLINE> |
| 82 | +Other display options: |
| 83 | + --hide-queries-in-logs |
| 84 | + Disable log_min_duration_statements and |
| 85 | + log_min_duration_sample for pg_activity. |
| 86 | + --refresh REFRESH Refresh rate. Values: 0.5, 1, 2, 3, 4, 5 (default: 2). |
| 87 | +<BLANKLINE> |
| 88 | +The connection string can be in the form of a list of Key/Value parameters or |
| 89 | +an URI as described in the PostgreSQL documentation. The parsing is delegated |
| 90 | +to the libpq: different versions of the client library may support different |
| 91 | +formats or parameters (for example, connection URIs are only supported from |
| 92 | +libpq 9.2). |
0 commit comments