Re: Generate pg_stat_get_xact*() functions with Macros

2023-03-27 Thread Drouvot, Bertrand
On 3/28/23 12:41 AM, Michael Paquier wrote: On Mon, Mar 27, 2023 at 07:08:51PM +0900, Michael Paquier wrote: The patch has one mistake: PG_STAT_GET_XACT_FUNCENTRY_FLOAT8_MS does not need a slash on its last line or it would include the next, empty line. This could lead to mistakes (no need

Re: Generate pg_stat_get_xact*() functions with Macros

2023-03-27 Thread Michael Paquier
On Mon, Mar 27, 2023 at 07:08:51PM +0900, Michael Paquier wrote: > The patch has one mistake: PG_STAT_GET_XACT_FUNCENTRY_FLOAT8_MS does > not need a slash on its last line or it would include the next, empty > line. This could lead to mistakes (no need to send a new patch just > for that).

Re: Generate pg_stat_get_xact*() functions with Macros

2023-03-27 Thread Michael Paquier
On Mon, Mar 27, 2023 at 10:11:21AM +0200, Drouvot, Bertrand wrote: > Please find attached V2 adding pg_stat_get_xact_function_total_time() > and pg_stat_get_xact_function_self_time() to the party. The patch has one mistake: PG_STAT_GET_XACT_FUNCENTRY_FLOAT8_MS does not need a slash on its last

Re: Generate pg_stat_get_xact*() functions with Macros

2023-03-27 Thread Drouvot, Bertrand
On 3/27/23 9:23 AM, Michael Paquier wrote: On Mon, Mar 27, 2023 at 08:54:13AM +0200, Drouvot, Bertrand wrote: Yes, something like V1 up-thread was doing. I think it can be added with your current proposal. Sure, I can write that. Or perhaps you'd prefer write something yourself? Please

Re: Generate pg_stat_get_xact*() functions with Macros

2023-03-27 Thread Michael Paquier
On Mon, Mar 27, 2023 at 08:54:13AM +0200, Drouvot, Bertrand wrote: > Yes, something like V1 up-thread was doing. I think it can be added with your > current proposal. Sure, I can write that. Or perhaps you'd prefer write something yourself? -- Michael signature.asc Description: PGP signature

Re: Generate pg_stat_get_xact*() functions with Macros

2023-03-27 Thread Drouvot, Bertrand
On 3/27/23 8:40 AM, Michael Paquier wrote: On Mon, Mar 27, 2023 at 07:45:26AM +0200, Drouvot, Bertrand wrote: Thanks! LGTM, but what about also taking care of pg_stat_get_xact_function_total_time() and pg_stat_get_xact_function_self_time() while at it? With a macro that uses

Re: Generate pg_stat_get_xact*() functions with Macros

2023-03-27 Thread Michael Paquier
On Mon, Mar 27, 2023 at 07:45:26AM +0200, Drouvot, Bertrand wrote: > Thanks! LGTM, but what about also taking care of > pg_stat_get_xact_function_total_time() > and pg_stat_get_xact_function_self_time() while at it? With a macro that uses INSTR_TIME_GET_MILLISEC() to cope with instr_time? Why

Re: Generate pg_stat_get_xact*() functions with Macros

2023-03-26 Thread Drouvot, Bertrand
Hi, On 3/27/23 3:20 AM, Michael Paquier wrote: On Sat, Mar 25, 2023 at 11:50:50AM +0900, Michael Paquier wrote: On Fri, Mar 24, 2023 at 06:58:30AM +0100, Drouvot, Bertrand wrote: - Does not include the refactoring for pg_stat_get_xact_function_total_time(),

Re: Generate pg_stat_get_xact*() functions with Macros

2023-03-26 Thread Michael Paquier
On Sat, Mar 25, 2023 at 11:50:50AM +0900, Michael Paquier wrote: > On Fri, Mar 24, 2023 at 06:58:30AM +0100, Drouvot, Bertrand wrote: >> - Does not include the refactoring for >> pg_stat_get_xact_function_total_time(), >> pg_stat_get_xact_function_self_time(), >> pg_stat_get_function_total_time()

Re: Generate pg_stat_get_xact*() functions with Macros

2023-03-24 Thread Michael Paquier
On Fri, Mar 24, 2023 at 06:58:30AM +0100, Drouvot, Bertrand wrote: > - Does not include the refactoring for pg_stat_get_xact_tuples_inserted(), > pg_stat_get_xact_tuples_updated() and pg_stat_get_xact_tuples_deleted() (as > they depend of [2] mentioned above) > > - Does not include the

Re: Generate pg_stat_get_xact*() functions with Macros

2023-03-24 Thread Drouvot, Bertrand
Hi, On 3/24/23 1:04 AM, Michael Paquier wrote: On Thu, Mar 02, 2023 at 08:39:14AM +0100, Drouvot, Bertrand wrote: Yeah, there is some dependencies around this one. [1]: depends on it Current one depends of [2], [3] and [4] Waiting on Author is then the right state, thanks for having moved it

Re: Generate pg_stat_get_xact*() functions with Macros

2023-03-23 Thread Michael Paquier
On Thu, Mar 02, 2023 at 08:39:14AM +0100, Drouvot, Bertrand wrote: > Yeah, there is some dependencies around this one. > > [1]: depends on it > Current one depends of [2], [3] and [4] > > Waiting on Author is then the right state, thanks for having moved it to that > state. > > [1]: >

Re: Generate pg_stat_get_xact*() functions with Macros

2023-03-01 Thread Drouvot, Bertrand
Hi, On 3/1/23 8:54 PM, Gregory Stark (as CFM) wrote: Looks like you have a path forward on this and it's not ready to commit yet? In which case I'll mark it Waiting on Author? Yeah, there is some dependencies around this one. [1]: depends on it Current one depends of [2], [3] and [4]

Re: Generate pg_stat_get_xact*() functions with Macros

2023-03-01 Thread Gregory Stark (as CFM)
Looks like you have a path forward on this and it's not ready to commit yet? In which case I'll mark it Waiting on Author? On Fri, 13 Jan 2023 at 13:38, Andres Freund wrote: > > On 2023-01-13 10:36:49 +0100, Drouvot, Bertrand wrote: > > > I'll first look at 1). > > Makes sense. > > > And it

Re: Generate pg_stat_get_xact*() functions with Macros

2023-01-13 Thread Andres Freund
Hi, On 2023-01-13 10:36:49 +0100, Drouvot, Bertrand wrote: > > > > Although I suspect this actually hints at an architectural thing that > > > > could be > > > > fixed better: Perhaps we should replace find_tabstat_entry() with a > > > > version > > > > returning a fully "reconciled"

Re: Generate pg_stat_get_xact*() functions with Macros

2023-01-13 Thread Drouvot, Bertrand
Hi, On 1/12/23 7:24 PM, Andres Freund wrote: Hi, On 2023-01-12 08:38:57 +0100, Drouvot, Bertrand wrote: On 1/11/23 11:59 PM, Andres Freund wrote: Now that this patch renames some fields I don't mind renaming the fields - the prefixes really don't provide anything useful. But it's not clear

Re: Generate pg_stat_get_xact*() functions with Macros

2023-01-12 Thread Andres Freund
Hi, On 2023-01-12 08:38:57 +0100, Drouvot, Bertrand wrote: > On 1/11/23 11:59 PM, Andres Freund wrote: > > > Now that this patch renames some fields > > > > I don't mind renaming the fields - the prefixes really don't provide > > anything > > useful. But it's not clear why this is related to

Re: Generate pg_stat_get_xact*() functions with Macros

2023-01-11 Thread Drouvot, Bertrand
Hi, On 1/11/23 11:59 PM, Andres Freund wrote: Hi, Michael, CCing you because of the point about PG_STAT_GET_DBENTRY_FLOAT8 below. On 2023-01-05 14:48:39 +0100, Drouvot, Bertrand wrote: While at it, I also took the opportunity to create the macros for pg_stat_get_xact_function_total_time(),

Re: Generate pg_stat_get_xact*() functions with Macros

2023-01-11 Thread Andres Freund
Hi, Michael, CCing you because of the point about PG_STAT_GET_DBENTRY_FLOAT8 below. On 2023-01-05 14:48:39 +0100, Drouvot, Bertrand wrote: > While at it, I also took the opportunity to create the macros for > pg_stat_get_xact_function_total_time(), > pg_stat_get_xact_function_self_time() and

Re: Generate pg_stat_get_xact*() functions with Macros

2023-01-06 Thread Drouvot, Bertrand
Hi, On 1/6/23 12:21 AM, Andres Freund wrote: Hi, On 2023-01-05 15:19:54 -0500, Corey Huinker wrote: It does get me wondering, however, if we reordered the three typedefs to group like-typed registers together, we could make them an array with the names becoming defined constant index values

Re: Generate pg_stat_get_xact*() functions with Macros

2023-01-06 Thread Drouvot, Bertrand
Hi, On 1/5/23 9:19 PM, Corey Huinker wrote: I like code cleanups like this. It makes sense, it results in less code, and anyone doing a `git grep pg_stat_get_live_tuples` will quickly find the macro definition. Unsurprisingly, it passes `make check-world`. So I think it's good to go

Re: Generate pg_stat_get_xact*() functions with Macros

2023-01-05 Thread Andres Freund
Hi, On 2023-01-05 15:19:54 -0500, Corey Huinker wrote: > It does get me wondering, however, if we reordered the three typedefs to > group like-typed registers together, we could make them an array with the > names becoming defined constant index values (or keeping them via a union), > then the

Re: Generate pg_stat_get_xact*() functions with Macros

2023-01-05 Thread Corey Huinker
On Thu, Jan 5, 2023 at 8:50 AM Drouvot, Bertrand < bertranddrouvot...@gmail.com> wrote: > Hi hackers, > > Please find attached a patch proposal to $SUBJECT. > > This is the same kind of work that has been done in 83a1a1b566 and > 8018ffbf58 but this time for the > pg_stat_get_xact*() functions

Generate pg_stat_get_xact*() functions with Macros

2023-01-05 Thread Drouvot, Bertrand
Hi hackers, Please find attached a patch proposal to $SUBJECT. This is the same kind of work that has been done in 83a1a1b566 and 8018ffbf58 but this time for the pg_stat_get_xact*() functions (as suggested by Andres in [1]). The function names remain the same, but some fields have to be