aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer/bufmgr.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-06-30 19:12:02 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-06-30 19:12:02 +0000
commit9fc25c0511b2d45f2a4eb16e8a03911eac89fb61 (patch)
tree80680edb38b910e263025ff1987bd1bf5460d817 /src/backend/storage/buffer/bufmgr.c
parent2910ccefb454759a9f598996a4be9505b388e824 (diff)
downloadpostgresql-9fc25c0511b2d45f2a4eb16e8a03911eac89fb61.tar.gz
postgresql-9fc25c0511b2d45f2a4eb16e8a03911eac89fb61.zip
Improve logging of checkpoints. Patch by Greg Smith, worked over
by Heikki and a little bit by me.
Diffstat (limited to 'src/backend/storage/buffer/bufmgr.c')
-rw-r--r--src/backend/storage/buffer/bufmgr.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index 82fa49abc48..12564a69ee4 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.222 2007/06/28 00:02:38 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.223 2007/06/30 19:12:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1096,6 +1096,12 @@ BufferSync(int flags)
if (++buf_id >= NBuffers)
buf_id = 0;
}
+
+ /*
+ * Update checkpoint statistics. As noted above, this doesn't
+ * include buffers written by other backends or bgwriter scan.
+ */
+ CheckpointStats.ckpt_bufs_written += num_written;
}
/*
@@ -1362,8 +1368,11 @@ PrintBufferLeakWarning(Buffer buffer)
void
CheckPointBuffers(int flags)
{
+ CheckpointStats.ckpt_write_t = GetCurrentTimestamp();
BufferSync(flags);
+ CheckpointStats.ckpt_sync_t = GetCurrentTimestamp();
smgrsync();
+ CheckpointStats.ckpt_sync_end_t = GetCurrentTimestamp();
}