Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
641912b4
Commit
641912b4
authored
Apr 30, 2007
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix oversight in my patch of yesterday: forgot to ensure that stats would
still be forced out at backend exit.
parent
957d08c8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
src/backend/postmaster/pgstat.c
src/backend/postmaster/pgstat.c
+6
-5
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+2
-2
src/include/pgstat.h
src/include/pgstat.h
+2
-2
No files found.
src/backend/postmaster/pgstat.c
View file @
641912b4
...
...
@@ -13,7 +13,7 @@
*
* Copyright (c) 2001-2007, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.15
4 2007/04/30 03:23:49
tgl Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.15
5 2007/04/30 16:37:08
tgl Exp $
* ----------
*/
#include "postgres.h"
...
...
@@ -615,7 +615,7 @@ void allow_immediate_pgstat_restart(void)
* ----------
*/
void
pgstat_report_tabstat
(
void
)
pgstat_report_tabstat
(
bool
force
)
{
static
TimestampTz
last_report
=
0
;
TimestampTz
now
;
...
...
@@ -627,10 +627,11 @@ pgstat_report_tabstat(void)
/*
* Don't send a message unless it's been at least PGSTAT_STAT_INTERVAL
* msec since we last sent one.
* msec since we last sent one
, or the caller wants to force stats out
.
*/
now
=
GetCurrentTransactionStopTimestamp
();
if
(
!
TimestampDifferenceExceeds
(
last_report
,
now
,
PGSTAT_STAT_INTERVAL
))
if
(
!
force
&&
!
TimestampDifferenceExceeds
(
last_report
,
now
,
PGSTAT_STAT_INTERVAL
))
return
;
last_report
=
now
;
...
...
@@ -1491,7 +1492,7 @@ pgstat_beshutdown_hook(int code, Datum arg)
{
volatile
PgBackendStatus
*
beentry
=
MyBEEntry
;
pgstat_report_tabstat
();
pgstat_report_tabstat
(
true
);
/*
* Clear my status entry, following the protocol of bumping st_changecount
...
...
src/backend/tcop/postgres.c
View file @
641912b4
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.53
2 2007/04/16 18:21:07
tgl Exp $
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.53
3 2007/04/30 16:37:08
tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
...
...
@@ -3444,7 +3444,7 @@ PostgresMain(int argc, char *argv[], const char *username)
}
else
{
pgstat_report_tabstat
();
pgstat_report_tabstat
(
false
);
set_ps_display
(
"idle"
,
false
);
pgstat_report_activity
(
"<IDLE>"
);
...
...
src/include/pgstat.h
View file @
641912b4
...
...
@@ -5,7 +5,7 @@
*
* Copyright (c) 2001-2007, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/include/pgstat.h,v 1.5
7 2007/03/30 18:34:55 mha
Exp $
* $PostgreSQL: pgsql/src/include/pgstat.h,v 1.5
8 2007/04/30 16:37:08 tgl
Exp $
* ----------
*/
#ifndef PGSTAT_H
...
...
@@ -416,7 +416,7 @@ extern void PgstatCollectorMain(int argc, char *argv[]);
*/
extern
void
pgstat_ping
(
void
);
extern
void
pgstat_report_tabstat
(
void
);
extern
void
pgstat_report_tabstat
(
bool
force
);
extern
void
pgstat_vacuum_tabstat
(
void
);
extern
void
pgstat_drop_database
(
Oid
databaseid
);
extern
void
pgstat_drop_relation
(
Oid
relid
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment