[Pgpool-hackers] pcp verbose display

Tatsuo Ishii ishii at sraoss.co.jp
Fri Aug 13 22:49:51 UTC 2010


> Here is a patch that allows pcp_node_info and pcp_proc_info to have a
> verbose ouput. Here is an example:
> 
> $ pcp_node_info --verbose 10 localhost 9898 postgres hogehoge 0
> Hostname: host1
> Username: 5432
> Port    : 1
> Weight  : 1073741823.500000
> 
> 
> Comments?

Great! Output for Username and Port seems a little bit wreired?

And following one line patch would more user friendly output for
weiight, i.e. 0-1 range value, rather than 0-RANDMAX value. If you
like, Please commit along with above.

Sample output;
$ ./pcp_node_info 1 localhost 9898 postgres pgpoolAdmin 1
localhost 5434 2 0.333333

Index: pcp_node_info.c
===================================================================
RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_node_info.c,v
retrieving revision 1.5
diff -c -r1.5 pcp_node_info.c
*** pcp_node_info.c	3 Aug 2010 09:01:40 -0000	1.5
--- pcp_node_info.c	13 Aug 2010 22:47:18 -0000
***************
*** 138,144 ****
  			   backend_info->backend_hostname,
  			   backend_info->backend_port,
  			   backend_info->backend_status,
! 			   backend_info->backend_weight);
  
  		free(backend_info);
  	}
--- 138,144 ----
  			   backend_info->backend_hostname,
  			   backend_info->backend_port,
  			   backend_info->backend_status,
! 			   backend_info->backend_weight/RAND_MAX);
  
  		free(backend_info);
  	}


--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


More information about the Pgpool-hackers mailing list