public inbox for [email protected]
help / color / mirror / Atom feedFrom: Nitin Jadhav <[email protected]>
To: PostgreSQL Hackers <[email protected]>
Subject: Refactor statistics collector, backend status reporting and command progress reporting
Date: Tue, 1 Mar 2022 23:42:02 +0530
Message-ID: <CAMm1aWY-N+u7+=FZaVMS2ioaqezxj9wfSpoB5i+_jT-H4GDNtQ@mail.gmail.com> (raw)
Hi,
Following are the files related to PostgreSQL statistics collector,
backend status reporting and command progress reporting.
pgstat.[ch] - Definitions for the PostgreSQL statistics collector daemon.
backend_status.[ch] - Definitions related to backend status reporting.
backend_progress.[ch] - Definitions related to command progress reporting.
progress.h - Constants used with the progress reporting facilities
defined in backend_status.h
pgstatfuncs.c - Functions for accessing the statistics collector data
There is a scope for some refactoring here even though the backend
status and command progress related code is separated from pgstat.c.
1) There is a lot of confusion between progress.h and
backend_progress.h. Why 2 header files required for the same
functionality? I feel progress.h can be merged with
backend_progress.h.
2) The access functions related to statistics collector are included
in pgstatfuncs.c file. This also contains the access functions related
to backend status and backend progress. I feel the access function
related to backend status should go in backend_status.c and the access
functions related to backend progress should go in backend progress.c
file. If the size grows in future then we can create new files for
access functions (like backend_status_funcs.c and
backend_progress_funcs.c).
3) There is a dependency between backend status and command progress
reporting but the corresponding functions are separated into 2
different files. It is better to define a new structure named
'PgBackendProgress' in backend_progress.h which consists of
'st_progress_command', 'st_progress_command_target' and
'st_progress_param'. Include a variable of type 'PgBackendProgress' as
a member of 'PgBackendStatus' structure.
Please share your thoughts.
If required, I would like to work on the patch.
Thanks & Regards,
Nitin Jadhav
view thread (2+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Refactor statistics collector, backend status reporting and command progress reporting
In-Reply-To: <CAMm1aWY-N+u7+=FZaVMS2ioaqezxj9wfSpoB5i+_jT-H4GDNtQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox