AIX-Perfstat
view release on metacpan or search on metacpan
0.01 Mon Jul 10 15:22:28 2006
- original version; created by h2xs 1.23 with options
-A -n AIX::Perfstat
0.02 Thu Jul 20 18:22:52 2006
- Added an example Perl script, updated the documentation,
and updated the copyright in all the files.
0.03 Fri Jul 28 11:58:53 MDT 2006
- Fixed network interface tests. Commented out some tests
not working on all AIX. Will look into this later.
0.04 Wed Sep 24 16:55:50 MDT 2008
- Added restrictions for OS and perfstat library, so that
CPAN Testers don't report failures on unsupported platforms.
0.04.1 Tue Sep 30 09:09:36 MDT 2008
- Fix the version number and the changelog.
perfstat_netinterface_total()
perfstat_netinterface()
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
DEPENDENCIES
This module requires these other modules and libraries:
libperfstat.so - Available from AIX install media as bos.perf.libperfstat.bff
COPYRIGHT AND LICENCE
inc/Devel/CheckLib.pm view on Meta::CPAN
=head1 FUNCTIONS
All of these take the same named parameters and are exported by default.
To avoid exporting them, C<use Devel::CheckLib ()>.
=head2 assert_lib
This takes several named parameters, all of which are optional, and dies
with an error message if any of the libraries listed can
not be found. B<Note>: dying in a Makefile.PL or Build.PL may provoke
a 'FAIL' report from CPAN Testers' automated smoke testers. Use
C<check_lib_or_exit> instead.
The named parameters are:
=over
=item lib
Must be either a string with the name of a single
library or a reference to an array of strings of library names. Depending
inc/Devel/CheckLib.pm view on Meta::CPAN
or die "CheckLib: $! restoring STDERR handle";
return $rv;
}
=head1 PLATFORMS SUPPORTED
You must have a C compiler installed. We check for C<$Config{cc}>,
both literally as it is in Config.pm and also in the $PATH.
It has been tested with varying degrees on rigourousness on:
=over
=item gcc (on Linux, *BSD, Mac OS X, Solaris, Cygwin)
=item Sun's compiler tools on Solaris
=item IBM's tools on AIX
=item Microsoft's tools on Windows
inc/Devel/CheckLib.pm view on Meta::CPAN
=item MinGW on Windows (with Strawberry Perl)
=item Borland's tools on Windows
=back
=head1 WARNINGS, BUGS and FEEDBACK
This is a very early release intended primarily for feedback from
people who have discussed it. The interface may change and it has
not been adequately tested.
Feedback is most welcome, including constructive criticism.
Bug reports should be made using L<http://rt.cpan.org/> or by email.
When submitting a bug report, please include the output from running:
perl -V
perl -MDevel::CheckLib -e0
=head1 SEE ALSO
inc/Devel/CheckLib.pm view on Meta::CPAN
L<Devel::CheckOS>
L<Probe::Perl>
=head1 AUTHORS
David Cantrell E<lt>david@cantrell.org.ukE<gt>
David Golden E<lt>dagolden@cpan.orgE<gt>
Thanks to the cpan-testers-discuss mailing list for prompting us to write it
in the first place;
to Chris Williams for help with Borland support.
=head1 COPYRIGHT and LICENCE
Copyright 2007 David Cantrell. Portions copyright 2007 David Golden.
This module is free-as-in-speech software, and may be used, distributed,
and modified under the same conditions as perl itself.
--nochanges don't suggest changes
--nofilter don't filter input files
--list-provided list provided API
--list-unsupported list unsupported API
--api-info=name show Perl API portability information
=head1 COMPATIBILITY
This version of F<ppport.h> is designed to support operation with Perl
installations back to 5.003, and has been tested up to 5.9.3.
=head1 OPTIONS
=head2 --help
Display a brief usage summary.
=head2 --patch=I<file>
If this option is given, a single patch file will be created if
The result will usually be a list of patches suggesting changes
that should at least be acceptable, if not necessarily the most
efficient solution, or a fix for all possible problems.
If you know that your XS module uses features only available in
newer Perl releases, if you're aware that it uses C++ comments,
and if you want all suggestions as a single patch file, you could
use something like this:
perl ppport.h --compat-version=5.6.0 --cplusplus --patch=test.diff
If you only want your code to be scanned without any suggestions
for changes, use:
perl ppport.h --nochanges
You can specify a different C<diff> program or options, using
the C<--diff> option:
perl ppport.h --diff='diff -C 10'
to display information for all known API elements.
=head1 BUGS
If this version of F<ppport.h> is causing failure during
the compilation of this module, please check if newer versions
of either this module or C<Devel::PPPort> are available on CPAN
before sending a bug report.
If F<ppport.h> was generated using the latest version of
C<Devel::PPPort> and is causing failure of this module, please
file a bug report using the CPAN Request Tracker at L<http://rt.cpan.org/>.
Please include the following information:
=over 4
=item 1.
The complete output from running "perl -V"
=item 4.
A full log of the build that failed.
=item 5.
Any other information that you think could be relevant.
=back
For the latest version of this code, please get the C<Devel::PPPort>
module from CPAN.
=head1 COPYRIGHT
Version 3.x, Copyright (c) 2004-2005, Marcus Holland-Moritz.
Version 2.x, Copyright (C) 2001, Paul Marquess.
Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
if (s == send)
return 0;
/* next must be digit or the radix separator or beginning of infinity */
if (isDIGIT(*s)) {
/* UVs are at least 32 bits, so the first 9 decimal digits cannot
overflow. */
UV value = *s - '0';
/* This construction seems to be more optimiser friendly.
(without it gcc does the isDIGIT test and the *s - '0' separately)
With it gcc on arm is managing 6 instructions (6 cycles) per digit.
In theory the optimiser could deduce how far to unroll the loop
before checking for overflow. */
if (++s < send) {
int digit = *s - '0';
if (digit >= 0 && digit <= 9) {
value = value * 10 + digit;
if (++s < send) {
digit = *s - '0';
if (digit >= 0 && digit <= 9) {
t/AIX-Perfstat.t view on Meta::CPAN
#
#
# Copyright (C) 2006 by Richard Holden
#
# This library is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself.
#
#######################################################################
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl AIX-Perfstat.t'
#########################
use Test::More;
BEGIN { use_ok('AIX::Perfstat') };
#########################
use AIX::Perfstat;
########################
#Compute number of tests to run.
plan tests => @AIX::Perfstat::METHODS + 0;
########################
foreach my $method (@AIX::Perfstat::METHODS)
{
can_ok('AIX::Perfstat', $method);
}
#
#
# Copyright (C) 2006 by Richard Holden
#
# This library is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself.
#
#######################################################################
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl cpu.t'
#########################
use warnings;
use strict;
use Test::More;
BEGIN { use_ok('AIX::Perfstat') };
#########################
use AIX::Perfstat;
########################
#Compute number of tests to run.
plan tests => 20;
########################
#Using anonymous blocks to avoid polluting the symbol table.
{
my $x = AIX::Perfstat::cpu_total();
ok( defined $x, 'cpu_total returned a defined value');
ok( exists $x->{'ncpus'} );
ok( exists $x->{'description'} );
cmp_ok(AIX::Perfstat::cpu_count(), '==', `lsdev -C -c processor | wc -l`, 'cpu_count agrees with the commandline lsdev count of processors');
{
my $cpu_count = AIX::Perfstat::cpu_count();
cmp_ok(@{AIX::Perfstat::cpu()}+0, '==', 1, 'cpu called with default arguments returns 1 record');
cmp_ok(@{AIX::Perfstat::cpu($cpu_count)} + 0, '==', $cpu_count, 'cpu called with cpu_count for desired number returns cpu_count records');
cmp_ok(@{AIX::Perfstat::cpu($cpu_count+1)} +0, '==', $cpu_count, 'cpu called with cpu_count +1 for desired number returns cpu_count records');
ok( !defined(AIX::Perfstat::cpu(1,"Foo")), 'cpu called with name that does not exist returns undef');
SKIP: {
skip "These tests rely on having more than one processor\n", 2 if ($cpu_count < 2);
my $name = "";
my $x = AIX::Perfstat::cpu(1,$name);
cmp_ok($name, 'eq', "proc1", 'cpu called with a variable of the empty string returns the second processor name in $name');
$name = "proc0";
$x = AIX::Perfstat::cpu(1,$name);
cmp_ok($name, 'eq', "proc1", 'cpu called with a variable of the first processor name returns the second processor name in $name');
}
#setup name so we are asking for the last processor.
#
#
# Copyright (C) 2006 by Richard Holden
#
# This library is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself.
#
#######################################################################
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl disk.t'
#########################
use Test::More;
BEGIN { use_ok('AIX::Perfstat') };
#########################
use AIX::Perfstat;
########################
#Compute number of tests to run.
plan tests => 15; #18
########################
#Using anonymous blocks to avoid polluting the symbol table.
{
my $x = AIX::Perfstat::disk_total();
ok( defined $x, 'disk_total returned a defined value');
ok( exists $x->{'number'} );
ok( exists $x->{'size'} );
cmp_ok(AIX::Perfstat::disk_count(), '==', `lsdev -C -t scsd | wc -l` + `lsdev -C -t osdisk | wc -l`, 'disk_count agrees with the commandline lsdev count of disks');
{
my $disk_count = AIX::Perfstat::disk_count();
cmp_ok(@{AIX::Perfstat::disk()}+0, '==', 1, 'disk called with default arguments returns 1 record');
cmp_ok(@{AIX::Perfstat::disk($disk_count)} + 0, '==', $disk_count, 'disk called with disk_count for desired number returns disk_count records');
cmp_ok(@{AIX::Perfstat::disk($disk_count+1)} +0, '==', $disk_count, 'disk called with disk_count +1 for desired number returns disk_count records');
ok( !defined(AIX::Perfstat::disk(1,"Foo")), 'disk called with name that does not exist returns undef');
# SKIP: {
# skip "These tests rely on having more than one disk\n", 2 if ($disk_count < 2);
#
# my $name = "";
# my $x = AIX::Perfstat::disk(1,$name);
# cmp_ok($name, 'eq', "hdisk1", 'disk called with a variable of the empty string returns the second disk name in $name');
# $name = "hdisk0";
# $x = AIX::Perfstat::disk(1,$name);
# cmp_ok($name, 'eq', "hdisk1", 'disk called with a variable of the first disk name returns the second disk name in $name');
# }
# #setup name so we are asking for the last disk.
#
#
# Copyright (C) 2006 by Richard Holden
#
# This library is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself.
#
#######################################################################
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl memory.t'
#########################
use Test::More;
BEGIN { use_ok('AIX::Perfstat') };
#########################
use AIX::Perfstat;
########################
#Compute number of tests to run.
plan tests => 2;
########################
#Using anonymous blocks to avoid polluting the symbol table.
{
my $x = AIX::Perfstat::memory_total();
ok( defined $x, 'memory_total returned a defined value');
ok( exists $x->{'virt_total'} );
}
t/netinterface.t view on Meta::CPAN
#
#
# Copyright (C) 2006 by Richard Holden
#
# This library is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself.
#
#######################################################################
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl netinterface.t'
#########################
use Test::More;
BEGIN { use_ok('AIX::Perfstat') };
#########################
use AIX::Perfstat;
########################
#Compute number of tests to run.
plan tests => 18;
########################
#Using anonymous blocks to avoid polluting the symbol table.
{
my $x = AIX::Perfstat::netinterface_total();
ok( defined $x, 'netinterface_total returned a defined value');
ok( exists $x->{'number'} );
ok( exists $x->{'ipackets'} );
t/netinterface.t view on Meta::CPAN
cmp_ok(AIX::Perfstat::netinterface_count(), '==', `ifconfig -l | sed -e 's/ /\\\n/g' | wc -l`, 'netinterface_count agrees with the commandline ifconfig count of network interfaces');
{
my $netinterface_count = AIX::Perfstat::netinterface_count();
cmp_ok(@{AIX::Perfstat::netinterface()}+0, '==', 1, 'netinterface called with default arguments returns 1 record');
cmp_ok(@{AIX::Perfstat::netinterface($netinterface_count)} + 0, '==', $netinterface_count, 'netinterface called with netinterface_count for desired number returns netinterface_count records');
cmp_ok(@{AIX::Perfstat::netinterface($netinterface_count+1)} +0, '==', $netinterface_count, 'netinterface called with netinterface_count +1 for desired number returns netinterface_count records');
ok( !defined(AIX::Perfstat::netinterface(1,"Foo")), 'netinterface called with name that does not exist returns undef');
SKIP: {
skip "These tests rely on having more than one netinterface\n", 2 if ($netinterface_count < 2);
my $name = "";
my $x = AIX::Perfstat::netinterface(1,$name);
if ($netinterface_count == 2)
{
#We probably only have en0 and lo0
cmp_ok($name, 'eq', "lo0", 'netinterface called with a variable of the empty string returns the second netinterface name in $name');
$name = "en0";
$x = AIX::Perfstat::netinterface(1,$name);
( run in 0.329 second using v1.01-cache-2.11-cpan-87723dcf8b7 )