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/tcop/postgres.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/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 476c2f72c3a..e75e66b6d10 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.223 2001/06/20 18:07:55 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.224 2001/06/22 19:16:23 wieck Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -66,6 +66,7 @@ #include "mb/pg_wchar.h" #endif +#include "pgstat.h" /* ---------------- * global variables @@ -1710,7 +1711,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha if (!IsUnderPostmaster) { puts("\nPOSTGRES backend interactive interface "); - puts("$Revision: 1.223 $ $Date: 2001/06/20 18:07:55 $\n"); + puts("$Revision: 1.224 $ $Date: 2001/06/22 19:16:23 $\n"); } /* @@ -1727,6 +1728,13 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE); + /* ---------- + * Tell the statistics collector that we're alive and + * to which database we belong. + * ---------- + */ + pgstat_bestart(); + /* * POSTGRES main processing loop begins here * @@ -1812,10 +1820,23 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha */ ReadyForQuery(whereToSendOutput); + /* ---------- + * Tell the statistics collector what we've collected + * so far. + * ---------- + */ + pgstat_report_tabstat(); + if (IsTransactionBlock()) + { set_ps_display("idle in transaction"); + pgstat_report_activity("<IDLE> in transaction"); + } else + { set_ps_display("idle"); + pgstat_report_activity("<IDLE>"); + } /* * (2) deal with pending asynchronous NOTIFY from other backends, @@ -1866,6 +1887,12 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha * 'F' indicates a fastpath call. */ case 'F': + /* ---------- + * Tell the collector what we're doing + * ---------- + */ + pgstat_report_activity("<FASTPATH> function call"); + /* start an xact for this function invocation */ start_xact_command(); @@ -1906,6 +1933,8 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha if (Show_query_stats) ResetUsage(); + pgstat_report_activity(parser_input->data); + pg_exec_query_string(parser_input->data, whereToSendOutput, QueryContext); |