Skip to content
This repository was archived by the owner on Jul 6, 2021. It is now read-only.

Commit 7125ad7

Browse files
committed
Provide the "full" example
Currently, from README.md it is not really obvious that two snapshots are needed, and, which is even more important, that postgres-checkup should be executed for all nodes (the master + all its replicas). This change solves it.
1 parent 20b8f05 commit 7125ad7

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

README.md

+38-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,44 @@ For example: in half a year we can switch to "epoch number `2`".
130130
`-h db2.vpn.local` means: try to connect to host via SSH and then use remote `psql` command to perform checks.
131131
If SSH is not available the local 'psql' will be used (non-psql reports will be skipped).
132132

133-
As a result of postgres-checkup we have got two directories with .json files and .md files:
133+
For comprehensive analysis, it is recommended to run the tool on the master and
134+
all its replicas – postgres-checkup is able to combine all the information from
135+
multiple nodes to a single report.
136+
137+
Some reports (such as K003) require two snapshots, to calculate "deltas" of
138+
metrics. So, for better results, use the following example, executing it during peak working
139+
hours, with `$DISTANCE` values from 10 min to a few hours:
140+
141+
```bash
142+
$DISTANCE="1800" # 30 minutes
143+
144+
# Assuming that db2 is the master, db3 and db4 are its replicas
145+
for host in db2.vpn.local db3.vpn.local db4.vpn.local; do
146+
./checkup \
147+
-h "$host" \
148+
-p 5432 \
149+
--username postgres \
150+
--dbname postgres \
151+
--project prod1 \
152+
-e 1 \
153+
--file resources/checks/K000_query_analysis.sh # the first snapshot is needed only for reports K***
154+
done
155+
156+
sleep "$DISTANCE"
157+
158+
for host in db2.vpn.local db3.vpn.local db4.vpn.local; do
159+
./checkup \
160+
-h "$host" \
161+
-p 5432 \
162+
--username postgres \
163+
--dbname postgres \
164+
--project prod1 \
165+
-e 1
166+
done
167+
```
168+
169+
As a result of execution, two directories containing .json and .md files will
170+
be created:
134171

135172
```bash
136173
./artifacts/prod1/json_reports/1_2018_12_06T14_12_36_+0300/

0 commit comments

Comments
 (0)