[Pgpool-hackers] Admin interface, statistics views, etc

Guillaume Lelarge guillaume at lelarge.info
Sun Jul 25 12:49:40 UTC 2010


Le 22/07/2010 00:07, Guillaume Lelarge a écrit :
> Le 21/07/2010 10:11, Tatsuo Ishii a écrit :
>>>> I would add pgsql_pid to pcp_proc_info anyway but in the mean time I
>>>> understand your concern about pcp API (it's a shame that libppcp API
>>>> is not documented anywhere BTW).
>>>
>>> OK, that would be good to have (the psql_pid column).
>>>
>>>> I admit that SELECT or SHOW is easier to use for appIications such as
>>>> pgAdmin. So I do not object to add new SELECT or SHOW command you
>>>> proposed. Would you like to create patches for this?
>>>
>>> Yeah, I will work on it right away. My patches for pgAdmin can wait, but
>>> the one for pgPool can't if you want to get a release out at the end of the
>>> month. I can also work on the documentation for the libppcp API. But first,
>>> the SHOW statement.
>>
>> Great. I and Kitagawa are working hard but it seems the actual release
>> timing delays... like mid of August. Probably submitting by the end of
>> July is enough.
> 
> OK, no problem.
> 
> I worked a bit on it tonight. I began with something really simple:
> "show pool_version". And it works :)
> 
> guillaume at laptop:~/freeprojects/cvs.pgpool/head/pgpool-II$ psql -p 9999
> postgres
> psql (9.0beta3)
> Saisissez « help » pour l'aide.
> 
> postgres=# show pool_version;
>       pool_version
> ------------------------
>  3.0-dev (umiyameboshi)
> (1 ligne)
> 
> 
> Next "show pool_processes", and "show pools". Not really sure if I need
> to make a difference.
> 

OK, here is my WIP patch. I send it to get advice, comments, in order to
finish it.

The patch attached handles four more SHOW commands. Of course, "SHOW
pool_status" is still available.

"SHOW pool_version" shows the version of pgPool-II:

postgres=# show pool_version;
      pool_version
------------------------
 3.0-dev (umiyameboshi)
(1 row)

"SHOW pool_nodes" shows every configured nodes:

postgres=# show pool_nodes;
 hostname  | port | status |     lb_weight
-----------+------+--------+-------------------
 127.0.0.1 | 5432 | 2      | 2147483647.000000
(1 row)

"SHOW pool_processes" shows every process of pgPool-II:

postgres=# SHOW pool_processes;
 pool_pid | database | username  | start_time | create_time | pool_counter
----------+----------+-----------+------------+-------------+--------------
 4918     |          |           | 1280061734 | 0           | 0
[... cut ...]
 4923     |          |           | 1280061734 | 0           | 0
 4924     | b1       | guillaume | 1280061734 | 1280061768  | 1
 4925     | b1       | guillaume | 1280061734 | 1280061915  | 1
 4926     |          |           | 1280061734 | 0           | 0
 4927     |          |           | 1280061734 | 0           | 0
 4928     | b1       | guillaume | 1280061734 | 1280061750  | 2
 4929     |          |           | 1280061734 | 0           | 0
 4930     | postgres | guillaume | 1280061734 | 1280061798  | 1
 4931     |          |           | 1280061734 | 0           | 0
[... cut ...]
 4939     |          |           | 1280061734 | 0           | 0
 4940     | b1       | guillaume | 1280061734 | 1280061914  | 1
 4941     |          |           | 1280061734 | 0           | 0
[... cut ...]
 4948     |          |           | 1280061734 | 0           | 0
 4949     | b2       | guillaume | 1280061734 | 1280061755  | 1
(32 rows)

And finally, "SHOW pools", which shows every connection to PostgreSQL,
active or not:

postgres=# SHOW pool_pools;
 pool_pid | pool_id | database | username  | start_time | create_time |
pool_counter
----------+---------+----------+-----------+------------+-------------+--------------
[... cut ...]
 4923     | 0       |          |           | 1280061734 | 0           | 0
 4923     | 1       |          |           | 1280061734 | 0           | 0
 4923     | 2       |          |           | 1280061734 | 0           | 0
 4923     | 3       |          |           | 1280061734 | 0           | 0
 4924     | 0       | b1       | guillaume | 1280061734 | 1280061768  | 1
 4924     | 1       |          |           | 1280061734 | 0           | 0
 4924     | 2       |          |           | 1280061734 | 0           | 0
 4924     | 3       |          |           | 1280061734 | 0           | 0
 4925     | 0       | b1       | guillaume | 1280061734 | 1280061915  | 1
 4925     | 1       |          |           | 1280061734 | 0           | 0
 4925     | 2       |          |           | 1280061734 | 0           | 0
 4925     | 3       |          |           | 1280061734 | 0           | 0
[... cut ...]
 4928     | 0       | b1       | guillaume | 1280061734 | 1280061750  | 2
 4928     | 1       |          |           | 1280061734 | 0           | 0
[... cut ...]
 4929     | 3       |          |           | 1280061734 | 0           | 0
 4930     | 0       | postgres | guillaume | 1280061734 | 1280061798  | 1
 4930     | 1       |          |           | 1280061734 | 0           |
[... cut ...]
0
 4939     | 3       |          |           | 1280061734 | 0           | 0
 4940     | 0       | b1       | guillaume | 1280061734 | 1280061914  | 1
 4940     | 1       |          |           | 1280061734 | 0           |
[... cut ...]
 4948     | 3       |          |           | 1280061734 | 0           | 0
 4949     | 0       | b2       | guillaume | 1280061734 | 1280061755  | 1
 4949     | 1       |          |           | 1280061734 | 0           | 0
 4949     | 2       |          |           | 1280061734 | 0           | 0
 4949     | 3       |          |           | 1280061734 | 0           | 0
(128 rows)

AFAICT, it works really good. We still miss pgsql_pid. And should I add
some other reports? what do other people need?


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgpool_show.patch
Type: text/x-diff
Size: 34511 bytes
Desc: not available
URL: <http://pgfoundry.org/pipermail/pgpool-hackers/attachments/20100725/2a840339/attachment-0001.bin>


More information about the Pgpool-hackers mailing list