Commit 10a5b35a authored by David Rowley's avatar David Rowley

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
parent 62e221e1
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
#include "utils/memutils.h" #include "utils/memutils.h"
#include "utils/ps_status.h" #include "utils/ps_status.h"
#include "utils/relmapper.h" #include "utils/relmapper.h"
#include "utils/pg_rusage.h"
#include "utils/snapmgr.h" #include "utils/snapmgr.h"
#include "utils/timestamp.h" #include "utils/timestamp.h"
...@@ -7169,6 +7170,9 @@ StartupXLOG(void) ...@@ -7169,6 +7170,9 @@ StartupXLOG(void)
{ {
ErrorContextCallback errcallback; ErrorContextCallback errcallback;
TimestampTz xtime; TimestampTz xtime;
PGRUsage ru0;
pg_rusage_init(&ru0);
InRedo = true; InRedo = true;
...@@ -7435,8 +7439,9 @@ StartupXLOG(void) ...@@ -7435,8 +7439,9 @@ StartupXLOG(void)
} }
ereport(LOG, ereport(LOG,
(errmsg("redo done at %X/%X", (errmsg("redo done at %X/%X system usage: %s",
(uint32) (ReadRecPtr >> 32), (uint32) ReadRecPtr))); (uint32) (ReadRecPtr >> 32), (uint32) ReadRecPtr,
pg_rusage_show(&ru0))));
xtime = GetLatestXTime(); xtime = GetLatestXTime();
if (xtime) if (xtime)
ereport(LOG, ereport(LOG,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment