diff options
author | Jan Wieck <JanWieck@Yahoo.com> | 2001-06-22 19:16:24 +0000 |
---|---|---|
committer | Jan Wieck <JanWieck@Yahoo.com> | 2001-06-22 19:16:24 +0000 |
commit | 8d80b0d980c327edf162e20fdc829559e8aff224 (patch) | |
tree | cdd7d11b95a539d7dd771c80e5e1535c75af8b6c /src/backend/storage/buffer/bufmgr.c | |
parent | 7d6e28149ea699b28773eefa48acc449b67d6ff4 (diff) | |
download | postgresql-8d80b0d980c327edf162e20fdc829559e8aff224.tar.gz postgresql-8d80b0d980c327edf162e20fdc829559e8aff224.zip |
Statistical system views (yet without the config stuff, but
it's hard to keep such massive changes in sync with the tree
so I need to get it in and work from there now).
Jan
Diffstat (limited to 'src/backend/storage/buffer/bufmgr.c')
-rw-r--r-- | src/backend/storage/buffer/bufmgr.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 06abd2e8675..8970c907a8b 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.112 2001/06/09 18:16:57 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.113 2001/06/22 19:16:22 wieck Exp $ * *------------------------------------------------------------------------- */ @@ -55,6 +55,8 @@ #include "utils/relcache.h" #include "catalog/pg_database.h" +#include "pgstat.h" + #define BufferGetLSN(bufHdr) \ (*((XLogRecPtr*)MAKE_PTR((bufHdr)->data))) @@ -147,6 +149,7 @@ ReadBufferInternal(Relation reln, BlockNumber blockNum, if (isLocalBuf) { ReadLocalBufferCount++; + pgstat_count_buffer_read(&reln->pgstat_info, reln); /* Substitute proper block number if caller asked for P_NEW */ if (blockNum == P_NEW) { @@ -156,11 +159,15 @@ ReadBufferInternal(Relation reln, BlockNumber blockNum, } bufHdr = LocalBufferAlloc(reln, blockNum, &found); if (found) + { LocalBufferHitCount++; + pgstat_count_buffer_hit(&reln->pgstat_info, reln); + } } else { ReadBufferCount++; + pgstat_count_buffer_read(&reln->pgstat_info, reln); /* Substitute proper block number if caller asked for P_NEW */ if (blockNum == P_NEW) { @@ -175,7 +182,10 @@ ReadBufferInternal(Relation reln, BlockNumber blockNum, SpinAcquire(BufMgrLock); bufHdr = BufferAlloc(reln, blockNum, &found); if (found) + { BufferHitCount++; + pgstat_count_buffer_hit(&reln->pgstat_info, reln); + } } /* At this point we do NOT hold the bufmgr spinlock. */ |