Forum Discussion
Ray_Morris_7896
Nimbostratus
Aug 02, 2006get_member_statistics example
Hello,
The SDK gives good examples of how to use ITCMLocalLBPool, but there is no example for the gathering of statistics for pool members (it only shows pool stats and I can find no other references in the forums). I'm looking for an example of how to use get_member_statistics for my pool members.
I'm confused about what parameters to pass on (ie: pool.get_member_statistics(???))
I am new to developing, and therefore can't backtrack my way into the correct answer.
Thank you for your time.
- Do you need to request a specific pool member to get the statistics on? It is probabaly easier to use the ITCMLocalLB::Pool::get_all_member_statistics() that takes as input a pool name and will return a list of all MemberStatisticEntry structures with the member's IPPortDefinition as well as the statistics.
$soapResponse = $Pool->get_all_member_statistics( SOAP::Data->name(pool_name => "my_pool") ); @MemberStatisticsEntryList = @{$soapResponse}; print "Pool my_pool\n"; foreach $MemberStatisticEntry (@MemberStatisticsEntryList) { $IPPortDefinition = $MemberStatisticsEntry->{"member_definition"} $addr = $IPPortDefinition->{"address"}; $port = $IPPortDefinition->{"port"}; print " member: $addr:$port\n"; $stats = $MemberStatisticsEntry->{"stats"}; $thruput_stats = $stats->{"thruput_stats"}; $bits_in = $thruput_stats->{"bits_in"}; ... print " bits_in: $bits_in\n"; $connection_stats = $stats->{"connection_stats"}; $current_connections = $connection_stats->{"current_connections"}; ... print " cur_con: $current_connections\n"; }
$IPPortDefinition = { address => "10.10.10.10", port => 80 }; push @MemberDefList, $IPPortDefinition $soapResponse = $Pool->get_member_statistics( SOAP::Data->name(pool_name => "my_pool"), SOAP::Data->name(member_defs => [@MemberDefList]) ); ...
- Ray_Morris_7896
Nimbostratus
Thanks Joe,Pool.ITCMLocalLBPoolMemberStatisticsEntry [] memstats = LocalLBPool.get_all_member_statistics(pool_name); for(int j=0; j{ string memAddr = memstats[j].member_definition.address; trow = new TableRow(); tcell = new TableCell(); tcell.Controls.Add(new LiteralControl(memAddr.ToString())); trow.Cells.Add(tcell); Table1.Rows.Add(trow); }
- Ray_Morris_7896
Nimbostratus
I fixed it. I had my syntax wrong in setting up LocalLBPool. It should have been:Pool.ITCMLocalLBPool LocalLBPool = new Pool.ITCMLocalLBPool();
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects