Forum Discussion
Alok_3817
Nimbostratus
May 10, 2010Unit for the Stats pulled by using i Control
Hi,
I am pulling the Global Stats using iControl for 9.4
I get the low and hight values and I create the 64 bit values.... but i am confused as what is the Unit of measurement
Like STATISTIC_CLI...
Alok_3817
Nimbostratus
May 13, 2010I understand ... will try and incorporate that, also, I used the iControl Script in perl for the TMM CPU usage
The script is below
$Stats = SOAP::Lite
-> uri('urn:iControl:System/Statistics')
-> proxy("$sProtocol://$sHost:$sPort/iControl/iControlPortal.cgi");
$soapresponse = $Stats->get_all_tmm_statistics();
$TMMStatistics = $soapresponse->result;
@TMMStatisticEntry = @{$TMMStatistics->{"statistics"}};
for $i (0 .. scalar(@TMMStatisticEntry)-1)
{
$tmm = @TMMStatisticEntry[$i];
@tmm_id[$i] = $tmm->{"tmm_id"};
@StatisticArray = @{$tmm->{"statistics"}};
foreach $stat (@StatisticArray)
{
$type = $stat->{"type"};
if ($type eq "STATISTIC_MEMORY_USED_BYTES")
{
$value = $stat->{"value"};
$low = $value->{"low"};
$high = $value->{"high"};
@usedmem[$i] = ($high<<32)|$low;
}
elsif ($type eq "STATISTIC_MEMORY_TOTAL_BYTES")
{
$value = $stat->{"value"};
$low = $value->{"low"};
$high = $value->{"high"};
@totmem[$i] = ($high<<32)|$low;
}
elsif ($type eq "STATISTIC_TM_TOTAL_CYCLES")
{
$value = $stat->{"value"};
$low = $value->{"low"};
$high = $value->{"high"};
@totalcycle_min[$i] = ($high<<32)|$low;
}
elsif ($type eq "STATISTIC_TM_IDLE_CYCLES")
{
$value = $stat->{"value"};
$low = $value->{"low"};
$high = $value->{"high"};
@idlecycle_min[$i] = ($high<<32)|$low;
}
elsif ($type eq "STATISTIC_TM_SLEEP_CYCLES")
{
$value = $stat->{"value"};
$low = $value->{"low"};
$high = $value->{"high"};
@sleepcycle_min[$i] = ($high<<32)|$low;
}
}
}
sleep 10;
$soapresponse = $Stats->get_all_tmm_statistics();
$TMMStatistics = $soapresponse->result;
@TMMStatisticEntry = @{$TMMStatistics->{"statistics"}};
for $i (0 .. scalar(@TMMStatisticEntry)-1)
{
$tmm = @TMMStatisticEntry[$i];
$tmm_id = $tmm->{"tmm_id"};
@StatisticArray = @{$tmm->{"statistics"}};
foreach $stat (@StatisticArray)
{
$type = $stat->{"type"};
if ($type eq "STATISTIC_TM_TOTAL_CYCLES")
{
$value = $stat->{"value"};
$low = $value->{"low"};
$high = $value->{"high"};
@totalcycle_max[$i] = ($high<<32)|$low;
}
elsif ($type eq "STATISTIC_TM_IDLE_CYCLES")
{
$value = $stat->{"value"};
$low = $value->{"low"};
$high = $value->{"high"};
@idlecycle_max[$i] = ($high<<32)|$low;
}
elsif ($type eq "STATISTIC_TM_SLEEP_CYCLES")
{
$value = $stat->{"value"};
$low = $value->{"low"};
$high = $value->{"high"};
@sleepcycle_max[$i] = ($high<<32)|$low;
}
}
}
for $i (0 .. scalar(@TMMStatisticEntry)-1)
{
print "\nTMM ID\t\t\t: @tmm_id[$i]";
print "\nUsed Memory\t\t: @usedmem[$i]";
print "\nTotal Memory\t\t: @totmem[$i]";
$deltaidle=("@idlecycle_max[$i]"-"@idlecycle_min[$i]");
$deltatotal=("@totalcycle_max[$i]"-"@totalcycle_min[$i]");
$deltasleep=("@sleepcycle_max[$i]"-"@sleepcycle_min[$i]");
print "\n\n*** $deltaidle \t $deltatotal \t $deltasleep ***\n";
$CPUPercent=((("$deltatotal"-("$deltaidle"+"$deltasleep"))/("$deltatotal"))*100);
print "\nPercentage CPU\t\t: $CPUPercent %";
}
I have played around with the sleep values, but I am getting the output some times as 3 - 4 % (which is correct), but many a time the value is greater than 100%, some times even 300% , which is unbelievable ... is there some thing wrong I am doing ?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