view release on metacpan or search on metacpan
Version 0.3.3 (released July 6, 2011)
* changed ownership from Alf Wachsmann to Steven Jenkins
* incorporated patches from Jeff Blaine
Version 0.3.2 (released May 14, 2007)
* removed spurious lib subdirectory from tar file
Thanks to David Cantrell <david at cantrell.org.uk>
Version 0.3.1 (released April 4, 2007)
* changed permissions from 755 to 0755 in Makefile.PL
* ExtUtils::MakeMaker's PERL_MM_USE_DEFAULT environment variable is now obeyed
* fixed a problem to make it compile on 32 bit RHEL4
All fixes were submitted by Wolfgang Friebel <Wolfgang.Friebel at desy.de> - Thanks!
Version 0.3.0 (released April 27, 2006)
* made everything work with OpenAFS-1.4.1
* cmdebug: PrintCacheEntries() now contains the strings and not the number of the file types
* added new CallBack statistics from OpenAFS-1.4.1 file servers to xstat_fs_test()
* added example for CallBack statistics to examples/xstat_fs_test
* added new statistics "rx_nBusies", "fs_nBusies", "fs_GetCapabilities" to xstat_fs_test()
* changed call by value to call by reference in a number of functions which reduces the
LICENSES/Artistic view on Meta::CPAN
under the copyright of this Package, but belong to whoever generated
them, and may be sold commercially, and may be aggregated with this
Package. If such scripts or library files are aggregated with this
Package via the so-called "undump" or "unexec" methods of producing a
binary executable image, then distribution of such an image shall
neither be construed as a distribution of this Package nor shall it
fall under the restrictions of Paragraphs 3 and 4, provided that you do
not represent such an executable image as a Standard Version of this
Package.
7. C subroutines (or comparably compiled subroutines in other
languages) supplied by you and linked into this Package in order to
emulate subroutines and variables of the language defined by this
Package shall not be considered part of this Package, but are the
equivalent of input as in Paragraph 6, provided these subroutines do
not change the language in any way that would cause it to fail the
regression tests for the language.
8. Aggregation of this Package with a commercial distribution is always
permitted provided that the use of this Package is embedded; that is,
when no overt attempt is made to make this Package's interfaces visible
to the end user of the commercial distribution. Such use shall not be
construed as a distribution of this Package.
9. The name of the Copyright Holder may not be used to endorse or promote
LICENSES/COPYING view on Meta::CPAN
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
LICENSES/COPYING view on Meta::CPAN
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
LICENSES/IBM-LICENSE view on Meta::CPAN
"Program" means the Original Program and Contributions.
"Recipient" means anyone who receives the Program under this
Agreement, including all Contributors.
2. GRANT OF RIGHTS
a) Subject to the terms of this Agreement, each Contributor hereby
grants Recipient a non-exclusive, worldwide, royalty-free
copyright license to reproduce, prepare derivative works of,
publicly display, publicly perform, distribute and sublicense the
Contribution of such Contributor, if any, and such derivative
works, in source code and object code form.
b) Subject to the terms of this Agreement, each Contributor hereby
grants Recipient a non-exclusive, worldwide, royalty-free patent
license under Licensed Patents to make, use, sell, offer to sell,
import and otherwise transfer the Contribution of such
Contributor, if any, in source code and object code form. This
patent license shall apply to the combination of the Contribution
and the Program if, at the time the Contribution is added by the
LICENSES/IBM-LICENSE view on Meta::CPAN
Program.
Each Contributor must include the following in a conspicuous location
in the Program:
Copyright © {date here}, International Business Machines Corporation
and others. All Rights Reserved.
In addition, each Contributor must identify itself as the originator
of its Contribution, if any, in a manner that reasonably allows
subsequent Recipients to identify the originator of the Contribution.
4. COMMERCIAL DISTRIBUTION
Commercial distributors of software may accept certain
responsibilities with respect to end users, business partners and the
like. While this license is intended to facilitate the commercial use
of the Program, the Contributor who includes the Program in a
commercial product offering should do so in a manner which does not
create potential liability for other Contributors. Therefore, if a
Contributor includes the Program in a commercial product offering,
LICENSES/IBM-LICENSE view on Meta::CPAN
time after becoming aware of such noncompliance. If all Recipient's
rights under this Agreement terminate, Recipient agrees to cease use
and distribution of the Program as soon as reasonably practicable.
However, Recipient's obligations under this Agreement and any licenses
granted by Recipient relating to the Program shall continue and
survive.
IBM may publish new versions (including revisions) of this Agreement
from time to time. Each new version of the Agreement will be given a
distinguishing version number. The Program (including Contributions)
may always be distributed subject to the version of the Agreement
under which it was received. In addition, after a new version of the
Agreement is published, Contributor may elect to distribute the
Program (including its Contributions) under the new version. No one
other than IBM has the right to modify this Agreement. Except as
expressly stated in Sections 2(a) and 2(b) above, Recipient receives
no rights or licenses to the intellectual property of any Contributor
under this Agreement, whether expressly, by implication, estoppel or
otherwise. All rights in the Program not expressly granted under this
Agreement are reserved.
Makefile.PL view on Meta::CPAN
'NAME' => 'AFS::Monitor',
'VERSION' => $VERSION,
($] >= 5.005 ?
('AUTHOR' => 'Alf Wachsmann, Elizabeth Cassell, and Steven Jenkins',
'ABSTRACT' => 'Perl interface to AFS monitoring and debugging APIs'
) : () ),
'realclean' => {FILES => 'Makefile.bak pod/*.html pod/pod2htm* lib/AFS/*.pod lib/AFS/Monitor/*.pod examples/debug_out/debug examples/debug_out/outputfile lib'},
);
sub MY::postamble {
'
html: Makefile
cd pod && $(MAKE) html
pod: blib
cp pod/Monitor.pod lib/AFS/Monitor.pod
cp pod/afsmon_stats.pod lib/AFS/Monitor/afsmon_stats.pod
cp pod/afsmonitor.pod lib/AFS/Monitor/afsmonitor.pod
cp pod/cmdebug.pod lib/AFS/Monitor/cmdebug.pod
cp pod/rxdebug.pod lib/AFS/Monitor/rxdebug.pod
examples/Meltdown.pl view on Meta::CPAN
# Example:
# Meltdown.pl -s point -p 7000 -t 300
#
# Check the server 'point' on port '7000' with 5 minutes between
# rxdebug commands.
#
use blib;
use AFS::Monitor;
sub Usage {
print STDERR "\n\n$progName: collect rxdebug stats on AFS process.\n";
print STDERR "usage: $progName [options]\n";
print STDERR "options:\n";
print STDERR " -s <server> (required parameter, no default).\n";
print STDERR " -p <port> (default: 7000).\n";
print STDERR " -t <interval> (default: 1200 seconds).\n";
print STDERR " -C \n";
print STDERR " -h (help: show this help message).\n\n";
print STDERR "Example: $progName -s point -p 7000\n";
print STDERR "Collect statistics on server point for port 7000\n";
print STDERR "Refresh interval will default to 20 minutes (1200 seconds)\n\n";
exit 0;
} # Usage
sub Check_data {
#
# If a value is going to overflow the field length,
# then bump the field length to match the value.
# It won't be pretty but we'll have valid data.
#
(length $wproc > $Ln[0]) ? ($Ln[0] = length $wproc) : "";
(length $nobuf > $Ln[1]) ? ($Ln[1] = length $nobuf) : "";
(length $wpack > $Ln[2]) ? ($Ln[2] = length $wpack) : "";
(length $fpack > $Ln[3]) ? ($Ln[3] = length $fpack) : "";
(length $calls > $Ln[4]) ? ($Ln[4] = length $calls) : "";
(length $delta > $Ln[5]) ? ($Ln[5] = length $delta) : "";
(length $data > $Ln[6]) ? ($Ln[6] = length $data) : "";
(length $resend > $Ln[7]) ? ($Ln[7] = length $resend) : "";
(length $idle > $Ln[8]) ? ($Ln[8] = length $idle) : "";
} # Check_data
sub Header {
if ($csvmode != 1) {
print "\nhh:mm:ss wproc nobufs wpack fpack calls delta data resends idle\n";
} else { # assume CSV mode...
print "\nhh:mm:ss,wproc,nobufs,wpack,fpack,calls,delta,data,resends,idle\n";
}
} # Header
#
# don't buffer the output
#
examples/afsmonitor view on Meta::CPAN
{ host => "virtue.openafs.org",
dlocalAccesses => 1
}
],
);
parse_results($fsinfo, $cminfo);
}
sub parse_results {
if ($AFS::CODE) {
print "Error case: ", ref($fsinfo), "\n" if (defined($fsinfo));
print "Error case: ", ref($cminfo), "\n" if (defined($cminfo));
# die("Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n");
print "Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n";
return;
}
if ($showdump) {
examples/cmdebug view on Meta::CPAN
print "\ncmdebug -server $server -port $port\n\n";
($locks, $cache_entries) = cmdebug(server => $server,
port => $port
);
parse_result($locks, $cache_entries);
}
sub parse_result {
my $l = shift;
my $c = shift;
if ($AFS::CODE) {
print "Error case: ", ref($l), "\n" if (defined($l));
print "Error case: ", ref($c), "\n" if (defined($c));
# die("Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n");
print "Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n";
return;
}
examples/cmdebug view on Meta::CPAN
}
if ($centry->{states} & 0x80) {
print ", mapped";
}
print "\n";
}
}
}
sub print_lock {
my $lock = shift;
print "(";
if ($lock->{waitStates}) {
if($lock->{waitStates} & constant("READ_LOCK")) {
print "reader_waiting";
}
if($lock->{waitStates} & constant("WRITE_LOCK")) {
print "writer_waiting";
}
examples/rxdebug view on Meta::CPAN
rxstats => 1,
peers => 1,
long => 1,
servers => $servers,
port => $port
);
parse_results($rxdeb);
}
sub parse_results {
my $val = shift;
# if there was an error, print it and then return.
if ($AFS::CODE) {
print "Error case: ", ref($val), "\n" if (defined($val));
# die("Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n");
print "Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n";
return;
}
examples/scout view on Meta::CPAN
if ($all || $tests[2]) {
print "\n******** TEST 2: ********\n";
print "\nscout -server virtue.openafs.org\n\n";
$result = scout(server => "virtue.openafs.org");
parse_result($result);
}
sub parse_result {
my $info = shift;
if ($AFS::CODE) {
print "Error case: ", ref($info), "\n" if (defined($info));
# die("Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n");
print "Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n";
return;
}
if ($showdump) {
examples/udebug view on Meta::CPAN
print "\nudebug -server $server -port $port\n\n";
$result = udebug(server => $server,
port => $port
);
parse_result($result);
}
sub parse_result {
my $info = shift;
if ($AFS::CODE) {
print "Error case: ", ref($info), "\n" if (defined($info));
# die("Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n");
print "Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n";
return;
}
if ($showdump) {
examples/xstat_cm_test view on Meta::CPAN
print "\n******** TEST 4: ********\n";
print "\nxstat_cm_test -cmname ", $cmname[0], "\n\n";
$result = xstat_cm_test(cmname => $cmname[0]);
parse_result($result);
}
sub parse_result {
my $info = shift;
if ($AFS::CODE) {
print "Error case: ", ref($info), "\n" if (defined($info));
# die("Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n");
print "Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n";
return;
}
if ($showdump) {
examples/xstat_cm_test view on Meta::CPAN
} elsif ($host->{collectionNumber} == constant("AFSCB_XSTATSCOLL_FULL_PERF_INFO")) {
PrintFullPerfInfo($host);
} else {
printf "** Unknown collection: %d\n", $host->{collectionNumber};
}
}
}
}
sub PrintPerfInfo {
my $host = shift;
printf("AFSCB_XSTATSCOLL_PERF_INFO (coll %d) for CM %s\n[Probe 1, %s]\n\n",
$host->{collectionNumber},
$host->{hostName},
scalar localtime $host->{probeTime});
PrintOverallPerfInfo($host->{data});
}
sub PrintFullPerfInfo {
my $host = shift;
printf("AFSCB_XSTATSCOLL_FULL_PERF_INFO (coll %d) for CM %s\n[Probe 1, %s]\n\n",
$host->{collectionNumber},
$host->{hostName},
scalar localtime $host->{probeTime});
print "Overall Performance Info:\n-------------------------\n";
PrintOverallPerfInfo($host->{data}->{perf});
examples/xstat_cm_test view on Meta::CPAN
print "\n[Un]replicated accesses:\n------------------------\n";
printf("\t%d unrep, %d rep, %d reps accessed, %d max reps/ref, %d first OK\n\n",
$accessinfP->{unreplicatedRefs},
$accessinfP->{replicatedRefs},
$accessinfP->{numReplicasAccessed},
$accessinfP->{maxReplicasPerRef},
$accessinfP->{refFirstReplicaOK});
}
sub PrintOverallPerfInfo {
my $perf = shift;
printf "\t%10d numPerfCalls\n", $perf->{numPerfCalls};
printf "\t%10d epoch\n", $perf->{epoch};
printf "\t%10d numCellsVisible\n", $perf->{numCellsVisible};
printf "\t%10d numCellsContacted\n", $perf->{numCellsContacted};
printf "\t%10d dlocalAccesses\n", $perf->{dlocalAccesses};
printf "\t%10d vlocalAccesses\n", $perf->{vlocalAccesses};
printf "\t%10d dremoteAccesses\n", $perf->{dremoteAccesses};
examples/xstat_cm_test view on Meta::CPAN
PrintUpDownStats($perf->{fs_UpDown}->[1]);
print "\tVL Server up/downtimes, same cell:\n";
PrintUpDownStats($perf->{vl_UpDown}->[0]);
print "\tVL Server up/downtimes, diff cell:\n";
PrintUpDownStats($perf->{vl_UpDown}->[1]);
}
sub PrintUpDownStats {
my $updown = shift;
printf "\t\t%10d numTtlRecords\n", $updown->{numTtlRecords};
printf "\t\t%10d numUpRecords\n", $updown->{numUpRecords};
printf "\t\t%10d numDownRecords\n", $updown->{numDownRecords};
printf "\t\t%10d sumOfRecordAges\n",$updown->{sumOfRecordAges};
printf "\t\t%10d ageOfYoungestRecord\n",$updown->{ageOfYoungestRecord};
printf "\t\t%10d ageOfOldestRecord\n",$updown->{ageOfOldestRecord};
printf "\t\t%10d numDowntimeIncidents\n",$updown->{numDowntimeIncidents};
printf "\t\t%10d numRecordsNeverDown\n",$updown->{numRecordsNeverDown};
examples/xstat_cm_test view on Meta::CPAN
printf "\t\tDowntime incident distribution:\n";
printf "\t\t\t%8d: 0 times\n", $updown->{downIncidents}->[0];
printf "\t\t\t%8d: 1 time\n", $updown->{downIncidents}->[1];
printf "\t\t\t%8d: 2 .. 5 times\n", $updown->{downIncidents}->[2];
printf "\t\t\t%8d: 6 .. 10 times\n", $updown->{downIncidents}->[3];
printf "\t\t\t%8d: 10 .. 50 times\n", $updown->{downIncidents}->[4];
printf "\t\t\t%8d: > 50 times\n", $updown->{downIncidents}->[5];
}
sub PrintRPCPerfInfo {
my $rpc = shift;
print "FS Operation Timings:\n---------------------\n";
foreach (sort keys %{$rpc->{fsRPCTimes}}) {
printf "%15s: %d ops (%d OK); sum=%f, sqr=%f, min=%f, max=%f\n",
$_,
$rpc->{fsRPCTimes}->{$_}->{numOps}, $rpc->{fsRPCTimes}->{$_}->{numSuccesses},
$rpc->{fsRPCTimes}->{$_}->{sumTime}, $rpc->{fsRPCTimes}->{$_}->{sqrTime},
$rpc->{fsRPCTimes}->{$_}->{minTime}, $rpc->{fsRPCTimes}->{$_}->{maxTime};
}
examples/xstat_cm_test view on Meta::CPAN
printf "%15s: %d ops (%d OK); sum=%f, sqr=%f, min=%f, max=%f\n",
$_,
$rpc->{cmRPCTimes}->{$_}->{numOps}, $rpc->{cmRPCTimes}->{$_}->{numSuccesses},
$rpc->{cmRPCTimes}->{$_}->{sumTime}, $rpc->{cmRPCTimes}->{$_}->{sqrTime},
$rpc->{cmRPCTimes}->{$_}->{minTime}, $rpc->{cmRPCTimes}->{$_}->{maxTime};
}
}
sub PrintCallInfo {
my $host = shift;
printf "AFSCB_XSTATSCOLL_CALL_INFO (coll %d) for CM %s\n[Probe 1, %s]\n\n",
$host->{collectionNumber},
$host->{hostName},
scalar localtime $host->{probeTime};
my $data = $host->{data};
printf "\t%10d afs_init\n", $data->{afs_init};
examples/xstat_fs_test view on Meta::CPAN
if ($all || $tests[7]) {
print "\n******** TEST 7: ********\n";
print "\nxstat_fs_test -fsname ", $fsname[0], "\n\n";
$result = xstat_fs_test(fsname => $fsname[0]);
parse_result($result);
}
sub parse_result {
my $info = shift;
if ($AFS::CODE) {
print "Error case: ", ref($info), "\n" if (defined($info));
# die("Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n");
print "Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n";
return;
}
if ($showdump) {
examples/xstat_fs_test view on Meta::CPAN
} elsif($host->{collectionNumber} == constant("AFS_XSTATSCOLL_CBSTATS")) {
parse_CbCounters($host);
} else {
print "Unknown collection: $host->{collectionNumber}\n";
}
}
}
}
sub parse_CallInfo {
my $host = shift;
printf("AFS_XSTATSCOLL_CALL_INFO (coll %d) for FS %s\n[Probe 1, %s]\n\n",
$host->{collectionNumber},
$host->{hostName},
scalar localtime $host->{probeTime});
for (my $i = 0; $i < $host->{data}->{AFS_CollData_len}; $i++) {
print $host->{i}, " ";
}
print "\n";
}
sub parse_PerfInfo {
my $host = shift;
printf("AFS_XSTATSCOLL_PERF_INFO (coll %d) for FS %s\n[Probe 1, %s]\n\n",
$host->{collectionNumber},
$host->{hostName},
scalar localtime($host->{probeTime}));
parse_OverallPerfInfo($host->{data});
}
sub parse_FullPerfInfo {
my $host = shift;
printf("AFS_XSTATSCOLL_FULL_PERF_INFO (coll %d) for FS %s\n[Probe 1, %s]\n\n",
$host->{collectionNumber},
$host->{hostName},
scalar localtime($host->{probeTime}));
parse_OverallPerfInfo($host->{data});
parse_DetailedPerfInfo($host->{data});
}
sub parse_OverallPerfInfo {
my $data = shift;
printf "\t%10d numPerfCalls\n\n", $data->{numPerfCalls};
printf "\t%10d vcache_L_Entries\n", $data->{vcache_L_Entries};
printf "\t%10d vcache_L_Allocs\n", $data->{vcache_L_Allocs};
printf "\t%10d vcache_L_Gets\n", $data->{vcache_L_Gets};
printf "\t%10d vcache_L_Reads\n", $data->{vcache_L_Reads};
printf "\t%10d vcache_L_Writes\n\n", $data->{vcache_L_Writes};
examples/xstat_fs_test view on Meta::CPAN
printf "\t%10d host_HostsInSameNetOrSubnet\n", $data->{host_HostsInSameNetOrSubnet};
printf "\t%10d host_HostsInDiffSubnet\n", $data->{host_HostsInDiffSubnet};
printf "\t%10d host_HostsInDiffNetwork\n", $data->{host_HostsInDiffNetwork};
printf "\t%10d host_NumClients\n", $data->{host_NumClients};
printf "\t%10d host_ClientBlocks\n\n", $data->{host_ClientBlocks};
printf "\t%10d sysname_ID\n", $data->{sysname_ID};
}
sub parse_DetailedPerfInfo {
my $data = shift;
printf "\t%10d epoch\n", $data->{epoch};
my $rpcop = $data->{rpcOpTimes};
parse_OpTiming("FetchData", $rpcop);
parse_OpTiming("FetchACL", $rpcop);
parse_OpTiming("FetchStatus", $rpcop);
parse_OpTiming("StoreData", $rpcop);
examples/xstat_fs_test view on Meta::CPAN
parse_OpTiming("XStatsVersion", $rpcop);
parse_OpTiming("GetXStats", $rpcop);
my $xferop = $data->{xferOpTimes};
parse_XferTiming("FetchData", $xferop);
parse_XferTiming("StoreData", $xferop);
}
sub parse_CbCounters {
my $host = shift;
printf("AFS_XSTATSCOLL_CBSTATS (coll %d) for FS %s\n[Probe 1, %s]\n\n",
$host->{collectionNumber},
$host->{hostName},
scalar localtime($host->{probeTime}));
printf "\t%10d DeleteFiles\n", $host->{CbCounters}->{DeleteFiles};
printf "\t%10d DeleteCallBacks\n", $host->{CbCounters}->{DeleteCallBacks};
printf "\t%10d BreakCallBacks\n", $host->{CbCounters}->{BreakCallBacks};
examples/xstat_fs_test view on Meta::CPAN
printf "\t%10d CBsTimedOut\n", $host->{CbCounters}->{CBsTimedOut};
printf "\t%10d nbreakers\n", $host->{CbCounters}->{nbreakers};
printf "\t%10d GSS1\n", $host->{CbCounters}->{GSS1};
printf "\t%10d GSS2\n", $host->{CbCounters}->{GSS2};
printf "\t%10d GSS3\n", $host->{CbCounters}->{GSS3};
printf "\t%10d GSS4\n", $host->{CbCounters}->{GSS4};
printf "\t%10d GSS5\n", $host->{CbCounters}->{GSS5};
}
sub parse_OpTiming {
my ($name, $rpcop) = @_;
printf("%15s: %d ops (%d OK); sum=%f, sqr=%f, min=%f, max=%f\n",
$name, $rpcop->{$name}->{numOps}, $rpcop->{$name}->{numSuccesses},
$rpcop->{$name}->{sumTime}, $rpcop->{$name}->{sqrTime},
$rpcop->{$name}->{minTime}, $rpcop->{$name}->{maxTime});
}
sub parse_XferTiming {
my ($name, $xferop) = @_;
printf("%s: %d xfers (%d OK), time sum=%f, sqr=%f, min=%f, max=%f\n",
$name, $xferop->{$name}->{numXfers}, $xferop->{$name}->{numSuccesses},
$xferop->{$name}->{sumTime}, $xferop->{$name}->{sqrTime},
$xferop->{$name}->{minTime}, $xferop->{$name}->{maxTime});
printf("\t[bytes: sum=%lu, min=%d, max=%d]\n",
$xferop->{$name}->{sumBytes},
$xferop->{$name}->{minBytes},
pod/afsmon_stats.pod view on Meta::CPAN
=item *
host_HostBlocks: Blocks in use for hosts.
=item *
host_NonDeletedHosts: Non-deleted hosts.
=item *
host_HostsInSameNetOrSubnet: Hosts in same subnet as server.
=item *
host_HostsInDiffSubnet: Hosts in different subnet than server.
=item *
host_HostsInDiffNetwork: Hosts in different network than server.
=item *
host_NumClients: Number of client entries.
=item *
pod/rxdebug.pod view on Meta::CPAN
B<7009> for the NFS/AFS Translator's B<rmtsysd> daemon
=item *
B<7021> for the Backup Server (B<buserver> process)
=item *
B<7025> through B<65535> for the Backup Tape Coordinator (B<butc> process) that
has the port offset number derived by subtracting 7025 from this value
=back
=item B<nodally>
Produces output only for connections that are not in dally mode. Dally mode is
a state in which the connection is idle or waiting.
=item B<allconnections>
src/Makefile.PL view on Meta::CPAN
# change the library name of the AFS system library "libcmd"
$command = "\'s#-lcmd#$AFSPath/lib/afs/libcmd.a#\'";
system("perl -p -i.bak -e $command Makefile");
# make changes to the typemap file if Perl < 5.6.0
$command = "\'s#T_UV#T_IV#\'";
system("perl -p -i.bak -e $command typemap") unless $] >= 5.006;
sub version {
my ($testver, $compver) = @_;
$compver = $ENV{VERSION} unless defined $compver;
# Remove possible package name from both strings.
$testver =~ s/^([a-zA-Z][^-]*-)*//;
$compver =~ s/^([a-zA-Z][^-]*-)*//;
for my $char ('-', '\.') {
if ("$testver$compver" =~ /$char/) {
src/Monitor.pm view on Meta::CPAN
xstat_cm_test
);
# Other items we are prepared to export if requested
@EXPORT_OK = qw(
error_message
constant
);
sub rxdebug {
my %subreq;
# parse the arguments and build a hash to pass to the XS do_rxdebug call.
return eval {
while (@_) {
$_ = shift;
if ( @_ and $_[0] !~ /^-/ ) {
$subreq{$_} = shift;
}
else {
$subreq{$_} = 1;
}
}
my $rxd = do_rxdebug(\%subreq);
return $rxd;
}
}
sub afsmonitor {
my %subreq;
return eval {
while (@_) {
$_ = shift;
if ( @_ and $_[0] !~ /^-/ ) {
$subreq{$_} = shift;
}
else {
$subreq{$_} = 1;
}
}
my ($fs, $cm) = do_afsmonitor(\%subreq);
return ($fs, $cm);
}
}
sub cmdebug {
my %subreq;
return eval {
while (@_) {
$_ = shift;
if ( @_ and $_[0] !~ /^-/ ) {
$subreq{$_} = shift;
}
else {
$subreq{$_} = 1;
}
}
my ($locks, $cache_entries) = do_cmdebug(\%subreq);
return ($locks, $cache_entries);
}
}
sub udebug {
my %subreq;
return eval {
while (@_) {
$_ = shift;
if ( @_ and $_[0] !~ /^-/ ) {
$subreq{$_} = shift;
}
else {
$subreq{$_} = 1;
}
}
my $result = do_udebug(\%subreq);
return $result;
}
}
sub scout {
my %subreq;
return eval {
while (@_) {
$_ = shift;
if ( @_ and $_[0] !~ /^-/ ) {
$subreq{$_} = shift;
}
else {
$subreq{$_} = 1;
}
}
my $result = do_scout(\%subreq);
return $result;
}
}
sub xstat_fs_test {
my %subreq;
return eval {
while (@_) {
$_ = shift;
if ( @_ and $_[0] !~ /^-/ ) {
$subreq{$_} = shift;
}
else {
$subreq{$_} = 1;
}
}
my $result = do_xstat_fs_test(\%subreq);
return $result;
}
}
sub xstat_cm_test {
my %subreq;
return eval {
while (@_) {
$_ = shift;
if ( @_ and $_[0] !~ /^-/ ) {
$subreq{$_} = shift;
}
else {
$subreq{$_} = 1;
}
}
my $result = do_xstat_cm_test(\%subreq);
return $result;
}
}
sub AUTOLOAD {
# This AUTOLOAD is used to 'autoload' constants from the constant()
# XS function. If a constant is not found then control is passed
# to the AUTOLOAD in AutoLoader.
# taken from perl v5.005_02 for backward compatibility
my $constname;
($constname = $AUTOLOAD) =~ s/.*:://;
croak "& not defined" if $constname eq 'constant';
my $val = constant($constname, @_ ? $_[0] : 0);
src/Monitor.pm view on Meta::CPAN
goto &AutoLoader::AUTOLOAD;
}
else {
croak "Your vendor has not defined AFS macro $constname";
}
}
{
no strict 'refs';
# Fixed between 5.005_53 and 5.005_61
if ($] >= 5.00561) {
*$AUTOLOAD = sub () { $val };
}
else {
*$AUTOLOAD = sub { $val };
}
}
goto &$AUTOLOAD;
}
bootstrap AFS::Monitor $VERSION;
# Preloaded methods go here. Autoload methods go after __END__, and are
# processed by the autosplit program.
src/Monitor.xs view on Meta::CPAN
int *lastHostType;
struct afsmon_hostEntry **last_hostEntry;
int *fs_showDefault;
int *cm_showDefault;
short *fs_showFlags;
short *cm_showFlags;
struct afsmon_hostEntry **FSnameList;
struct afsmon_hostEntry **CMnameList;
{
char buff1[256] = ""; /* for error messages */
char buff2[256] = ""; /* for error messages returned from subroutines */
FILE *configFD = 0; /* config file descriptor */
char line[4 * CFG_STR_LEN]; /* a line of config file */
char opcode[CFG_STR_LEN]; /* specifies type of config entry */
char arg1[CFG_STR_LEN]; /* hostname or qualifier (fs/cm?) */
char arg2[CFG_STR_LEN]; /* threshold variable */
char arg3[CFG_STR_LEN]; /* threshold value */
char arg4[CFG_STR_LEN]; /* user's handler */
struct afsmon_hostEntry *curr_host = 0;
struct hostent *he = 0; /* hostentry to resolve host name */
char *handlerPtr = 0; /* ptr to pass theresh handler string */
src/Monitor.xs view on Meta::CPAN
hv_store(RETVAL, "currentTrans", 12, newSViv(udebug.currentTrans), 0);
if (udebug.currentTrans) {
hv_store(RETVAL, "writeTrans", 10, newSViv(udebug.writeTrans), 0);
SYNCTID = newHV();
hv_store(SYNCTID, "epoch", 5, newSViv(udebug.syncTid.epoch), 0);
hv_store(SYNCTID, "counter", 7, newSViv(udebug.syncTid.counter), 0);
hv_store(RETVAL, "syncTid", 7, newRV_inc((SV*)SYNCTID), 0);
}
if (int32p || udebug.amSyncSite) {
/* now do the subcalls */
SERVERS = newAV();
for ( i=0; ; i++ ) {
#ifdef USE_VOTEXDEBUG
isClone = 0;
code = VOTE_XSDebug(tconn, i, &usdebug, &isClone);
if (code < 0) {
if ( oldServer ) { /* pre 3.5 server */
ubik_sdebug * ptr = &usdebug;
memset(&usdebug, 0, sizeof(usdebug));
src/ppport.h view on Meta::CPAN
PL_curcop->cop_line = PL_copline;
PL_hints &= ~HINT_BLOCK_SCOPE;
if (stash)
PL_curstash = PL_curcop->cop_stash = stash;
newSUB(
#if (PERL_VERSION < 3) || ((PERL_VERSION == 3) && (PERL_SUBVERSION < 22))
/* before 5.003_22 */
start_subparse(),
#else
# if (PERL_VERSION == 3) && (PERL_SUBVERSION == 22)
/* 5.003_22 */
start_subparse(0),
# else
/* 5.003_23 onwards */
start_subparse(FALSE, 0),
# endif
#endif
newSVOP(OP_CONST, 0, newSVpv(name,0)),
newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */
newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
);
PL_hints = oldhints;
PL_curcop->cop_stash = old_cop_stash;
src/t/Monitor.t view on Meta::CPAN
use lib qw(../../inc ../inc ./inc);
use Test::More tests => 11;
BEGIN {
use_ok('AFS::Monitor', qw(error_message constant));
}
# Some very basic tests first:
sub foo { return &AFS::Monitor::RX_CALL_CLEARED }
# test error_message
is(error_message(267274), 'Unknown code pt 10 (267274)', 'Return Code 267274');
# test subroutine returning a constant
is(foo(42,17), 64, 'Sub Foo returns constant (2 args)');
is(foo(42), 64, 'Sub Foo returns constant (1 arg)');
is(foo(), 64, 'Sub Foo returns constant (no args)');
# test constant
is(constant('RX_CONN_DESTROY_ME'), 2, 'Constant RX_CONN_DESTROY_ME');
is(constant('RX_CONN_DESTROY_ME', 2), 2, 'Constant RX_CONN_DESTROY_ME with argument');
isnt(constant('zzz'), 2, 'Unknown Constant zzz');
# test AUTOLOAD running function "constant"