Thread: statistics collector: number of function calls

statistics collector: number of function calls

From
Markus Bertheau
Date:
Hi,

I'd find it useful if the statistics collector (or someone else) counted
the number of times a function was called (or whether it was called at
all). Given that PL/pgSQL-Functions are compiled only at the first call
this would provide for a possibility to check whether every function has
been used and therefore compiled successfully during a test run of an
application.

Is something like this planned or already available, but hidden well?

Thanks

--
Markus Bertheau <twanger@bluetwanger.de>


Re: statistics collector: number of function calls

From
mike g
Date:
Hello,

It is possible to enable the statements issued against the db to be
logged in postgresql.conf(log_statement = true).  Depending on the OS
then you can filter the logs or maybe create a Perl script to scan the
logs.

HTH.


On Mon, 2004-07-12 at 10:08, Markus Bertheau wrote:
> Hi,
>
> I'd find it useful if the statistics collector (or someone else) counted
> the number of times a function was called (or whether it was called at
> all). Given that PL/pgSQL-Functions are compiled only at the first call
> this would provide for a possibility to check whether every function has
> been used and therefore compiled successfully during a test run of an
> application.
>
> Is something like this planned or already available, but hidden well?
>
> Thanks

Re: statistics collector: number of function calls

From
Markus Bertheau
Date:
В Втр, 13.07.2004, в 04:43, mike g пишет:
> Hello,
>
> It is possible to enable the statements issued against the db to be
> logged in postgresql.conf(log_statement = true).  Depending on the OS
> then you can filter the logs or maybe create a Perl script to scan the
> logs.

Does that help when functions call other functions? The second function
will be nowhere in the logs, right?

--
Markus Bertheau <twanger@bluetwanger.de>


Re: statistics collector: number of function calls

From
Mike G
Date:
I believe you are correct.  I will check my logs later.  If you have access to the code you could add individual
sequenceswithin each procedures and use those as counters. 

On Tue, Jul 13, 2004 at 10:07:33AM +0200, Markus Bertheau wrote:
> В Втр, 13.07.2004, в 04:43, mike g пишет:
> > Hello,
> >
> > It is possible to enable the statements issued against the db to be
> > logged in postgresql.conf(log_statement = true).  Depending on the OS
> > then you can filter the logs or maybe create a Perl script to scan the
> > logs.
>
> Does that help when functions call other functions? The second function
> will be nowhere in the logs, right?
>
> --
> Markus Bertheau <twanger@bluetwanger.de>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

Re: statistics collector: number of function calls

From
Markus Bertheau
Date:
В Срд, 14.07.2004, в 03:35, Mike G пишет:
> I believe you are correct.  I will check my logs later.  If you have
> access to the code you could add individual sequences within each
> procedures and use those as counters.

This is a very odd and costly way, which is why I asked if the
statistics collector couldn't do that job. It's an interesting number.

Is something like that planned in PostgreSQL?

Thanks

--
Markus Bertheau <twanger@bluetwanger.de>


Re: statistics collector: number of function calls

From
mike g
Date:
AFAIK nothing along those lines is planned.  I have been reading lists
for a few months and nothing in the TODO currently.  7.5 will have more
detail in the logs but probably not what you are looking for.

You can plead your case in the hacker mailing list and perhaps they will
add it to the todo list.  A patch would be welcomed as well.

Mike


On Tue, 2004-07-13 at 21:08, Markus Bertheau wrote:
> В Срд, 14.07.2004, в 03:35, Mike G пишет:
> > I believe you are correct.  I will check my logs later.  If you have
> > access to the code you could add individual sequences within each
> > procedures and use those as counters.
>
> This is a very odd and costly way, which is why I asked if the
> statistics collector couldn't do that job. It's an interesting number.
>
> Is something like that planned in PostgreSQL?
>
> Thanks