Re: Log connection establishment timings

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Guillaume Lelarge <guillaume(at)lelarge(dot)info>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Daniel Gustafsson <daniel(at)yesql(dot)se>, andrey(dot)chudnovskiy(at)microsoft(dot)com, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Subject: Re: Log connection establishment timings
Date: 2025-03-10 06:24:29
Message-ID: Z86FndIdheZH9hTl@ip-10-97-1-34.eu-west-3.compute.internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)pg(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2025-03-10 06:28:38 Re: Parallel heap vacuum
Previous Message Michael Paquier 2025-03-10 06:21:04 Re: Back-patch of: avoid multiple hard links to same WAL file after a crash