Re: Log connection establishment timings - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: Log connection establishment timings
Date
Msg-id Z86FndIdheZH9hTl@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: Log connection establishment timings  (Melanie Plageman <melanieplageman@gmail.com>)
List pgsql-hackers
Hi,

On Fri, Mar 07, 2025 at 03:29:14PM -0500, Melanie Plageman wrote:
> On Fri, Mar 7, 2025 at 6:16 AM Bertrand Drouvot
> <bertranddrouvot.pg@gmail.com> wrote:
> > But at the end, what we're "really" interested in this thread, given its $SUBJECT,
> > is to actually log the timings.
> 
> I'm not sure that people would enable this option much if
> it was called ready_for_use, since just logging when we are ready for
> query is likely not that valuable.

Agreed.

> So, I would call "received" and "authorized" stages and the
> authentication ID message not a stage. I think I should not call these
> "log_connections stages" in the docs and comments and instead call
> them "log_connections options".

Makes sense to me.

> And I am wondering if the "timings" option should be called "timings"
> or "durations"? I want to convey that it is about printing connection
> setup durations and not about whether or not we measure timings. But
> log_connections=durations sounds more like it logs the total duration
> of the connection setup and not component parts...

I agree that both could be misinterpreted (even if the documentation should
clear any doubts). Anyway, it's probably better to put more details in the
option name then, something like "setup_timings" maybe?

> I actually think even if we change the option name, it could be
> valuable to have the message begin with "connection ready for use";
> otherwise, it's unclear when we are printing the message.

Good point, I do agree.

> Logging
> messages are very tied to what was happening when they were emitted.
> Usually they include some context on when they were emitted. Thus, I
> think it makes sense to somehow contextualize the message in this way
> in the text. It does make the message rather long, though...
> 

Just use "connection ready" maybe?

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Back-patch of: avoid multiple hard links to same WAL file after a crash
Next
From: Amit Kapila
Date:
Subject: Re: Parallel heap vacuum