RE: libpq debug log - Mailing list pgsql-hackers

From Iwata, Aya
Subject RE: libpq debug log
Date
Msg-id 71E660EB361DF14299875B198D4CE5423DEF2009@g01jpexmbkw25
Whole thread Raw
In response to Re: libpq debug log  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: RE: libpq debug log
RE: libpq debug log
List pgsql-hackers
Hi everyone,

I appreciate all the helpful advice.

I agree to display message more clearly. I will follow your advice.
    
I would like to add timestamp per line and when command processing function start/end.
I think it is useful to know the application process start/end for diagnosis.
So I will implement like this;

2019-03-03 07:24:54.142 UTC   PQgetResult start
2019-03-03 07:24:54.143 UTC   < 'T' 35 1 "set_config" 0 #0 25 #65535 -1 #0
2019-03-03 07:24:54.144 UTC   PQgetResult end


> > But I still don't really see a need for different levels or whatever.
> > I mean, you either want a dump of all of the protocol traffic, or you
> > don't, I think.  Or maybe I am confused as to what the goal of all
> > this really is.
> 
> Yeah, me too.  But a lot of this detail would only be useful if you were trying
> to diagnose something like a discrepancy between the server and libpq as to
> the width of some field.  And the number of users for that can be counted
> without running out of fingers.  I think what would be of use for a trace
> facility is as high-level a view as possible of the message contents.
> 
> Or, in other words: a large part of the problem with the existing PQtrace
> facility is that it *was* designed to help debug libpq itself, and that
> use-case is no longer very interesting.  We should assume that the library
> knows how to parse protocol messages.

Since I explained the reason in the previous email, I am copy-pasting it again here.

I think the purpose of the leveling is to provide an optional information for the user, 
which is useful for diagnosis during the performance deterioration.
When query delay happens, we want to know from which side(server or client) is the cause of it,
and then people want to know which process takes time.
I think the phase and time information are useful for diagnosis.
For example, when command processing function (ex. PQexec()) etc. start/end
and when client receive/send protocol messages.

So is it alright to add these information to the new/proposed PQtrace() default output?



Regards,
Aya Iwata



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Refactoring the checkpointer's fsync request queue
Next
From: Siarhei Siniak
Date:
Subject: [Issue] Can't recompile cube extension as PGXS, utils/float.h is not installed