Skip Menu |

This queue is for tickets about the Linux-Statistics CPAN distribution.

Report information
The Basics
Id: 17570
Status: resolved
Priority: 0/
Queue: Linux-Statistics

People
Owner: Nobody in particular
Requestors: SAPER [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.12
Fixed in: (no value)



Subject: [patch] Documentation patch
Hello, Attached is a patch that corrects the formatting of the documentation and also add Test::More in the prerequisites. -- Close the world, txEn eht nepO.
Subject: Linux-Statistics-1.12-doc+Makefile.PL.patch
diff -ru Linux-Statistics-1.12-orig/lib/Linux/Statistics.pm Linux-Statistics-1.12/lib/Linux/Statistics.pm --- Linux-Statistics-1.12-orig/lib/Linux/Statistics.pm 2006-01-14 22:31:00.000000000 +0100 +++ Linux-Statistics-1.12/lib/Linux/Statistics.pm 2006-02-10 11:41:59.008704803 +0100 @@ -4,46 +4,46 @@ =head1 SYNOPSIS -use Linux::Statistics; + use Linux::Statistics; -my $obj = Linux::Statistics->new( SysInfo => 1, - ProcStats => 1, - MemStats => 1, - PgSwStats => 1, - NetStats => 1, - SockStats => 1, - DiskStats => 1, - DiskUsage => 1, - LoadAVG => 1, - FileStats => 1, - Processes => 1, - TimeStamp => 1 ); + my $obj = Linux::Statistics->new( SysInfo => 1, + ProcStats => 1, + MemStats => 1, + PgSwStats => 1, + NetStats => 1, + SockStats => 1, + DiskStats => 1, + DiskUsage => 1, + LoadAVG => 1, + FileStats => 1, + Processes => 1, + TimeStamp => 1 ); -sleep(1); + sleep(1); -my $stats = $obj->getStats; + my $stats = $obj->getStats; =head1 DESCRIPTION This module collects system statistics like processor workload, memory usage and other -system informations from the /proc filesystem. It is tested on x86 hardware with the +system informations from the F</proc> filesystem. It is tested on x86 hardware with the distributions SuSE, SLES (s390 and s390x), Red Hat, Debian and Mandrake on kernel versions 2.4 and 2.6 but should also running on other linux distributions with the same kernel release number. To run this module it is necessary to start it as root or another user -with the authorization to read the /proc filesystem and the /etc/passwd file. +with the authorization to read the F</proc> filesystem and the F</etc/passwd> file. =head2 NOTE -The method new() checks the options and initialize different statitistics if they're required. -If you want to get useful statistics for the options ProcStats, NetStats, DiskStats, PgSwStats -and Processes then it's necessary to sleep for a while - at least one second - between the calls -of new() and getStats(). If you shouldn't do that it's possible that this statistics will be null. +The method C<new()> checks the options and initialize different statitistics if they're required. +If you want to get useful statistics for the options C<ProcStats>, C<NetStats>, C<DiskStats>, C<PgSwStats> +and C<Processes> then it's necessary to sleep for a while - at least one second - between the calls +of C<new()> and C<getStats()>. If you shouldn't do that it's possible that this statistics will be null. The reason is that this statistics are deltas since the last time that the new method was called -and the call of getStats(). +and the call of C<getStats()>. -The getStats() function collects the requested informations and actualize the initalized values. -This way making it possible that the method new() doesn't must called again and again if you want -to collect the statistics in a loop. The exception is that you must call the method new() if you +The C<getStats()> function collects the requested informations and actualize the initalized values. +This way making it possible that the method C<new()> doesn't must called again and again if you want +to collect the statistics in a loop. The exception is that you must call the method C<new()> if you want to add or remove a option. =head1 OPTIONS @@ -52,8 +52,8 @@ =head2 SysInfo -Generated from I</proc/sys/kernel/hostname> *domainname *ostype *osrelease *version -and I</proc/sysinfo>, I</proc/cpuinfo>, I</proc/meminfo>, I</proc/uptime>. +Generated from F</proc/sys/kernel/{hostname,domainname,ostype,osrelease,version}> +and F</proc/sysinfo>, F</proc/cpuinfo>, F</proc/meminfo>, F</proc/uptime>. Hostname - This is the host name. Domain - This is the host domain name. @@ -70,7 +70,7 @@ =head2 ProcStats -Generated from I</proc/stat>. +Generated from F</proc/stat>. User - Percentage of CPU utilization at the user level. Nice - Percentage of CPU utilization at the user level with nice priority. @@ -82,7 +82,7 @@ =head2 MemStats -Generated from I</proc/meminfo>. +Generated from F</proc/meminfo>. MemUsed - Total size of used memory in kilobytes. MemFree - Total size of free memory in kilobytes. @@ -97,7 +97,7 @@ =head2 PgSwStats -Generated from I</proc/stat> or I</proc/vmstat>. +Generated from F</proc/stat> or F</proc/vmstat>. PageIn - Number of kilobytes the system has paged in from disk per second. PageOut - Number of kilobytes the system has paged out to disk per second. @@ -106,7 +106,7 @@ =head2 NetStats -Generated from I</proc/net/dev>. +Generated from F</proc/net/dev>. RxBytes - Number of bytes received per second. RxPackets - Number of packets received per second. @@ -134,7 +134,7 @@ =head2 SockStats -Generated from I</proc/net/sockstat>. +Generated from F</proc/net/sockstat>. Used - Total number of used sockets. Tcp - Number of tcp sockets in use. @@ -144,7 +144,7 @@ =head2 DiskStats -Generated from I</proc/diskstats> or I</proc/partitions>. +Generated from F</proc/diskstats> or F</proc/partitions>. Major - The mayor number of the disk Minor - The minor number of the disk @@ -168,7 +168,7 @@ =head2 DiskUsage -Generated with I</bin/df -k>. +Generated with C</bin/df -k>. Total - The total size of the disk. Usage - The used disk space in kilobytes. @@ -188,7 +188,7 @@ =head2 FileStats -Generated with I</proc/sys/fs/file-nr>, I</proc/sys/fs/inode-nr> and I</proc/sys/fs/dentry-state>. +Generated with F</proc/sys/fs/file-nr>, F</proc/sys/fs/inode-nr> and F</proc/sys/fs/dentry-state>. fHandlesAlloc - Number of allocated file handles. fHandlesFree - Number of free file handles. @@ -203,7 +203,7 @@ =head2 Processes -Generated with I</proc/E<lt>numberE<gt>/statm>, I</proc/E<lt>numberE<gt>/stat>, I</proc/E<lt>numberE<gt>/status>, I</proc/E<lt>numberE<gt>/cmdline> and I</etc/passwd>. +Generated with F</proc/E<lt>numberE<gt>/statm>, F</proc/E<lt>numberE<gt>/stat>, F</proc/E<lt>numberE<gt>/status>, F</proc/E<lt>numberE<gt>/cmdline> and F</etc/passwd>. PPid - The parent process ID of the process. Owner - The owner name of the process. @@ -240,14 +240,14 @@ =head2 TimeStamp -Generated with I<localtime(time)>. +Generated with C<localtime(time)>. Date - The current date. Time - The current time. =head1 EXAMPLES -=head4 A very simple perl script could looks like this: +A very simple perl script could looks like this: #!/usr/bin/perl -w use strict; @@ -266,7 +266,7 @@ print " Total $stats->{ProcStats}->{Total}\n"; print " New $stats->{ProcStats}->{New}\n"; -=head4 Or this: +Or this: #!/usr/bin/perl -w use strict; @@ -290,7 +290,7 @@ print ' ' x 2, "$key", ' ' x (30-length($key)), "$value\n"; } -=head4 This also: +This also: #!/usr/bin/perl -w use strict; @@ -309,7 +309,7 @@ print "\n"; } -=head4 You can also collect the statistics in a loop: +You can also collect the statistics in a loop: #!/usr/bin/perl -w use strict; @@ -332,7 +332,7 @@ print "\n"; } -=head4 It is also possible to create a hash reference with options. +It is also possible to create a hash reference with options. my $options = { SysInfo => 1, @@ -353,7 +353,7 @@ sleep(1); my $stats = $obj->getStats; -=head4 If you're not sure you can use the the Data::Dumper module to learn more about the hash structure. +If you're not sure you can use the the C<Data::Dumper> module to learn more about the hash structure. #!/usr/bin/perl -w use strict; @@ -366,25 +366,27 @@ print Dumper($stats); -=head4 You can find a very simple script for tests under the installation directory -Linux-Statistics-<version>/tests/. The script called SimpleCheck.pl and shows you the collected -data with Data::Dumper. +You can find a very simple script for tests under the installation directory +F<Linux-Statistics-E<lt>versionE<gt>/tests/>. The script called F<SimpleCheck.pl> and shows you the collected +data with C<Data::Dumper>. -=head4 Have a lot of fun with this module :-) +Have a lot of fun with this module C<:-)> =head1 SEE ALSO -The manpage of proc(5) or I</usr/src/linux/Documentation/filesystems/proc.txt>. +B<proc(5)> + +F</usr/src/linux/Documentation/filesystems/proc.txt> =head1 REPORTING BUGS Please report all bugs to <jschulz@bloonix.de>. You can send me additional informations generated by a script if you like. -The script lie under the Linus-Statistics-<VERSION>/Checks/ directory and it -called ProcCheck.pl. This script generates an output for all statistics -with Data::Dumper and an output of all necessary files from the /proc filesystem. -The output file called output_proc_check.txt. +The script lie under the F<Linus-Statistics-E<lt>VERSIONE<gt>/Checks/> directory and it +called F<ProcCheck.pl>. This script generates an output for all statistics +with C<Data::Dumper> and an output of all necessary files from the F</proc> filesystem. +The output file called F<output_proc_check.txt>. =head1 EXPANSIONS diff -ru Linux-Statistics-1.12-orig/Makefile.PL Linux-Statistics-1.12/Makefile.PL --- Linux-Statistics-1.12-orig/Makefile.PL 2006-01-14 22:30:27.000000000 +0100 +++ Linux-Statistics-1.12/Makefile.PL 2006-02-10 11:20:36.298929791 +0100 @@ -4,5 +4,8 @@ WriteMakefile( 'NAME' => 'Linux::Statistics', 'VERSION_FROM' => 'lib/Linux/Statistics.pm', - 'PREREQ_PM' => {} + 'ABSTRACT_FROM' => 'lib/Linux/Statistics.pm', + 'PREREQ_PM' => { + 'Test::More' => '0', + } );
On Fr. 10. Feb. 2006, 09:11:37, SAPER wrote: Show quoted text
> Hello, > > Attached is a patch that corrects the formatting of the documentation > and also add Test::More in the prerequisites.
Hi Saper, a lot of thanks for your report. Cheers, Jonny