Re: Statistics Extraction
- From: Purl Gurl <purlgurl@xxxxxxxxxxxx>
- Date: Tue, 23 Jan 2007 16:21:19 -0800
doni wrote:
(snipped)
I wanted to extract specific information of MAC and PHY statistics from
the statistics log file.
MAC statistics:
0 frames with invalid header
546 confirmed frames sent succesfully
#!perl
&Query;
sub Query
{
my ($yes_no);
print "Statistics To Search: MAC PHY Network?\n";
$search = <STDIN>;
chomp $search;
print "Search $search correct? Yes No?\n";
$yes_no = <STDIN>;
if (!($yes_no =~ /yes/i))
{ &Query; }
elsif (!($search =~ /mac|phy|network/i))
{ print "Incorrect Statistics To Search\n"; &Query; }
else
{
print "Enter Search Terms: ";
$search_terms = <STDIN>;
if (!($search_terms))
{ &Query; }
else
{ chomp ($search_terms); &Search; }
}
}
sub Search
{
$search_terms =~ tr/A-Z/a-z/;
if ($search =~ /mac/i)
{
print "\n";
while (<DATA>)
{
if (index ($_, "PHY") > -1)
{ print "\nFinished Searching MAC"; last; }
if (index ($_, $search_terms) > -1)
{ print $_; }
}
}
elsif ($search =~ /phy/i)
{
my ($phy);
print "\n";
while (<DATA>)
{
if (index ($_, "Network") > -1)
{ print "\nFinished Searching PHY"; last; }
if (index ($_, "PHY") > -1)
{ $phy = "true"; }
if ($phy eq "true")
{
if (index ($_, $search_terms) > -1)
{ print $_; }
}
}
}
else
{
my ($network);
print "\n";
while (<DATA>)
{
if (index ($_, "Network") > -1)
{ $network = "true"; }
if ($network eq "true")
{
if (index ($_, $search_terms) > -1)
{ print $_; }
}
}
print "\nFinished Searching Network";
}
}
__DATA__
MAC statistics:
0 frames with invalid header
546 confirmed frames sent succesfully
1693 confirmed frames sent unsuccesfully
542 confirmed frames received
4597 total frames received
851 data packets received
549 packets sent successfully
152 packets sent unsuccessfully
763 packets queued by network layer
61 packet transmissions timed out
0 packets with invalid length
0 out of order fragments received
87 duplicate fragments received
0 partial packets received
4 packet reassemblies timed out
0 no buffers
PHY statistics:
3404 frames transmitted
105 transmits aborted due to rx
0 transmit errors
0 late transmits
11 tx buffer loads interrupted
0 tx buffer load failures
4598 receive interrupts
4598 frames received
0 received frames lost
0 zero length frames received
0 receive cmd errors
Network statistics:
851 total packets received
0 bad packet length
0 bad version number
0 outgoing packets with no route
0 input packets with bad destination address
0 input packets from wrong channel
0 packets dropped for exceeding TTL
0 packets dropped due to full socket buffers
0 packets dropped due to no receiver
0 packets dropped due to running out of memory
762 total packets sent
549 packets succesfully transmitted
213 packets sent unsuccessfully
--
Purl Gurl
.
- Follow-Ups:
- Re: Statistics Extraction
- From: John Bokma
- Re: Statistics Extraction
- From: Purl Gurl
- Re: Statistics Extraction
- References:
- Statistics Extraction
- From: doni
- Statistics Extraction
- Prev by Date: Re: perl regexp question
- Next by Date: Re: Statistics Extraction
- Previous by thread: Re: Statistics Extraction
- Next by thread: Re: Statistics Extraction
- Index(es):
Relevant Pages
|