aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2020-09-16 11:25:46 +1200
committerDavid Rowley <drowley@postgresql.org>2020-09-16 11:25:46 +1200
commit10a5b35a0061d9747ac7594c5e6faa0513276593 (patch)
treee9814576969b08885fe9a23a7b8046b03876a492
parent62e221e1c01e3985d2b8e4b68c364f8486c327ab (diff)
downloadpostgresql-10a5b35a0061d9747ac7594c5e6faa0513276593.tar.gz
postgresql-10a5b35a0061d9747ac7594c5e6faa0513276593.zip
Report resource usage at the end of recovery
Reporting this has been rather useful in some recent recovery speedup work. It also seems like something that will be useful to the average DBA too. Author: David Rowley Reviewed-by: Thomas Munro Discussion: https://postgr.es/m/CAApHDvqYVORiZxq2xPvP6_ndmmsTkvr6jSYv4UTNaFa5i1kd%3DQ%40mail.gmail.com
-rw-r--r--src/backend/access/transam/xlog.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index a38371a64f9..61754312e26 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -76,6 +76,7 @@
#include "utils/memutils.h"
#include "utils/ps_status.h"
#include "utils/relmapper.h"
+#include "utils/pg_rusage.h"
#include "utils/snapmgr.h"
#include "utils/timestamp.h"
@@ -7169,6 +7170,9 @@ StartupXLOG(void)
{
ErrorContextCallback errcallback;
TimestampTz xtime;
+ PGRUsage ru0;
+
+ pg_rusage_init(&ru0);
InRedo = true;
@@ -7435,8 +7439,9 @@ StartupXLOG(void)
}
ereport(LOG,
- (errmsg("redo done at %X/%X",
- (uint32) (ReadRecPtr >> 32), (uint32) ReadRecPtr)));
+ (errmsg("redo done at %X/%X system usage: %s",
+ (uint32) (ReadRecPtr >> 32), (uint32) ReadRecPtr,
+ pg_rusage_show(&ru0))));
xtime = GetLatestXTime();
if (xtime)
ereport(LOG,