r26418 - in /trunk/libsys-statistics-linux-perl: Build.PL ChangeLog META.yml README debian/changelog debian/control debian/libsys-statistics-linux-perl.docs lib/Sys/Statistics/Linux.pm
rmayorga-guest at users.alioth.debian.org
rmayorga-guest at users.alioth.debian.org
Sat Nov 1 02:29:42 UTC 2008
Author: rmayorga-guest
Date: Sat Nov 1 02:29:34 2008
New Revision: 26418
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=26418
Log:
* New upstream release
* debian/control
+ remove libmodule-build-perl, dh7 prefer MakeMaker
+ move perl from B-D-I to B-D
+ add libtest-pod-perl, libtest-pod-coverage-perl to B-D-I
+ add myself to uploaders
* remove libsys-statistics-linux-perl.docs, it only coantains README
which is a copy from the POD
Removed:
trunk/libsys-statistics-linux-perl/debian/libsys-statistics-linux-perl.docs
Modified:
trunk/libsys-statistics-linux-perl/Build.PL
trunk/libsys-statistics-linux-perl/ChangeLog
trunk/libsys-statistics-linux-perl/META.yml
trunk/libsys-statistics-linux-perl/README
trunk/libsys-statistics-linux-perl/debian/changelog
trunk/libsys-statistics-linux-perl/debian/control
trunk/libsys-statistics-linux-perl/lib/Sys/Statistics/Linux.pm
Modified: trunk/libsys-statistics-linux-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsys-statistics-linux-perl/Build.PL?rev=26418&op=diff
==============================================================================
--- trunk/libsys-statistics-linux-perl/Build.PL (original)
+++ trunk/libsys-statistics-linux-perl/Build.PL Sat Nov 1 02:29:34 2008
@@ -21,7 +21,6 @@
'Test::More' => 0,
'Time::HiRes' => 0,
'UNIVERSAL' => 0,
- 'UNIVERSAL::require' => 0,
},
);
Modified: trunk/libsys-statistics-linux-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsys-statistics-linux-perl/ChangeLog?rev=26418&op=diff
==============================================================================
--- trunk/libsys-statistics-linux-perl/ChangeLog (original)
+++ trunk/libsys-statistics-linux-perl/ChangeLog Sat Nov 1 02:29:34 2008
@@ -1,3 +1,7 @@
+0.43 Released at 2008-10-29.
+ - Kicked UNIVERSAL::require.
+ - Now it's possible to pass $sleep_time to get().
+
0.42 Released at 2008-10-06.
- Added $PAGES_TO_BYTES to Sys::Statistics::Linux::Processes.
With this variable it's possible to get bytes/kilobytes instead
Modified: trunk/libsys-statistics-linux-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsys-statistics-linux-perl/META.yml?rev=26418&op=diff
==============================================================================
--- trunk/libsys-statistics-linux-perl/META.yml (original)
+++ trunk/libsys-statistics-linux-perl/META.yml Sat Nov 1 02:29:34 2008
@@ -1,6 +1,6 @@
---
name: Sys-Statistics-Linux
-version: 0.42
+version: 0.43
author:
- Jonny Schulz
abstract: Front-end module to collect system statistics
@@ -13,11 +13,10 @@
Test::More: 0
Time::HiRes: 0
UNIVERSAL: 0
- UNIVERSAL::require: 0
provides:
Sys::Statistics::Linux:
file: lib/Sys/Statistics/Linux.pm
- version: 0.42
+ version: 0.43
Sys::Statistics::Linux::Compilation:
file: lib/Sys/Statistics/Linux/Compilation.pm
version: 0.07
Modified: trunk/libsys-statistics-linux-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsys-statistics-linux-perl/README?rev=26418&op=diff
==============================================================================
--- trunk/libsys-statistics-linux-perl/README (original)
+++ trunk/libsys-statistics-linux-perl/README Sat Nov 1 02:29:34 2008
@@ -4,7 +4,7 @@
SYNOPSIS
use Sys::Statistics::Linux;
- my $lxs = Sys::Statistics::Linux->new(
+ my %options = (
sysinfo => 1,
cpustats => 1,
procstats => 1,
@@ -19,14 +19,15 @@
processes => 1,
);
+ my $lxs = Sys::Statistics::Linux->new(\%options);
sleep 1;
-
- # $stat is a Sys::Statistics::Linux::Compilation object
my $stat = $lxs->get;
- foreach my $key ($stat->loadavg) {
- print $key, " ", $stat->loadavg($key), "\n";
- }
+ Or
+
+ my $sleep = 1;
+ my $lxs = Sys::Statistics::Linux->new(\%options);
+ my $stat = $lxs->get($sleep);
DESCRIPTION
Sys::Statistics::Linux is a front-end module and gather different linux
@@ -181,7 +182,13 @@
Call "get()" to get the collected statistics. "get()" returns a
Sys::Statistics::Linux::Compilation object.
- my $stat = $lxs->get;
+ my $lxs = Sys::Statistics::Linux->new(\%options);
+ sleep(1);
+ my $stat = $lxs->get();
+
+ Or you can pass the time to sleep with the call of "get()".
+
+ my $stat = $lxs->get($time_to_sleep);
Now the statistcs are available with
@@ -205,7 +212,6 @@
# initiate cpustats
my $lxs = Sys::Statistics::Linux->new( cpustats => 1 );
- sleep(1);
while ( 1 ) {
sleep(1800);
@@ -219,10 +225,9 @@
my $lxs = Sys::Statistics::Linux->new( cpustats => 2 );
while ( 1 ) {
- $lxs->init; # init the statistics
- sleep(1); # sleep for the deltas
- my $stat = $lxs->get; # get the statistics
- sleep(1800); # sleep until the next run
+ $lxs->init; # init the statistics
+ my $stat = $lxs->get(1); # get the statistics
+ sleep(1800); # sleep until the next run
}
If you want to write a simple command line utility that prints the
@@ -234,8 +239,7 @@
my $lxs = Sys::Statistics::Linux->new( cpustats => 1 );
while ( 1 ){
- sleep(1);
- my $cpu = $lxs->get->cpustats;
+ my $cpu = $lxs->get(1)->cpustats;
my $time = $lxs->gettime;
printf "%-20s%8s%8s%8s%8s%8s%8s%8s%8s\n",
$time, @{$cpu->{cpu}}{@order};
@@ -342,7 +346,6 @@
Test::More
Time::HiRes
UNIVERSAL
- UNIVERSAL::require
EXPORTS
No exports.
Modified: trunk/libsys-statistics-linux-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsys-statistics-linux-perl/debian/changelog?rev=26418&op=diff
==============================================================================
--- trunk/libsys-statistics-linux-perl/debian/changelog (original)
+++ trunk/libsys-statistics-linux-perl/debian/changelog Sat Nov 1 02:29:34 2008
@@ -1,3 +1,16 @@
+libsys-statistics-linux-perl (0.43-1) unstable; urgency=low
+
+ * New upstream release
+ * debian/control
+ + remove libmodule-build-perl, dh7 prefer MakeMaker
+ + move perl from B-D-I to B-D
+ + add libtest-pod-perl, libtest-pod-coverage-perl to B-D-I
+ + add myself to uploaders
+ * remove libsys-statistics-linux-perl.docs, it only coantains README
+ which is a copy from the POD
+
+ -- Rene Mayorga <rmayorga at debian.org.sv> Fri, 31 Oct 2008 19:56:08 -0600
+
libsys-statistics-linux-perl (0.42-1) unstable; urgency=low
* Initial Release. (Closes: #502237)
Modified: trunk/libsys-statistics-linux-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsys-statistics-linux-perl/debian/control?rev=26418&op=diff
==============================================================================
--- trunk/libsys-statistics-linux-perl/debian/control (original)
+++ trunk/libsys-statistics-linux-perl/debian/control Sat Nov 1 02:29:34 2008
@@ -1,10 +1,10 @@
Source: libsys-statistics-linux-perl
Section: perl
Priority: optional
-Build-Depends: debhelper (>= 7), libmodule-build-perl
-Build-Depends-Indep: perl (>= 5.6.0-12)
+Build-Depends: debhelper (>= 7)
+Build-Depends-Indep: perl (>= 5.6.0-12), libtest-pod-perl, libtest-pod-coverage-perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Gunnar Wolf <gwolf at debian.org>
+Uploaders: Gunnar Wolf <gwolf at debian.org>, Rene Mayorga <rmayorga at debian.org.sv>
Standards-Version: 3.8.0
Homepage: http://search.cpan.org/dist/Sys-Statistics-Linux/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libsys-statistics-linux-perl/
Modified: trunk/libsys-statistics-linux-perl/lib/Sys/Statistics/Linux.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsys-statistics-linux-perl/lib/Sys/Statistics/Linux.pm?rev=26418&op=diff
==============================================================================
--- trunk/libsys-statistics-linux-perl/lib/Sys/Statistics/Linux.pm (original)
+++ trunk/libsys-statistics-linux-perl/lib/Sys/Statistics/Linux.pm Sat Nov 1 02:29:34 2008
@@ -6,7 +6,7 @@
use Sys::Statistics::Linux;
- my $lxs = Sys::Statistics::Linux->new(
+ my %options = (
sysinfo => 1,
cpustats => 1,
procstats => 1,
@@ -21,14 +21,15 @@
processes => 1,
);
+ my $lxs = Sys::Statistics::Linux->new(\%options);
sleep 1;
-
- # $stat is a Sys::Statistics::Linux::Compilation object
my $stat = $lxs->get;
- foreach my $key ($stat->loadavg) {
- print $key, " ", $stat->loadavg($key), "\n";
- }
+Or
+
+ my $sleep = 1;
+ my $lxs = Sys::Statistics::Linux->new(\%options);
+ my $stat = $lxs->get($sleep);
=head1 DESCRIPTION
@@ -178,7 +179,13 @@
Call C<get()> to get the collected statistics. C<get()> returns a L<Sys::Statistics::Linux::Compilation>
object.
- my $stat = $lxs->get;
+ my $lxs = Sys::Statistics::Linux->new(\%options);
+ sleep(1);
+ my $stat = $lxs->get();
+
+Or you can pass the time to sleep with the call of C<get()>.
+
+ my $stat = $lxs->get($time_to_sleep);
Now the statistcs are available with
@@ -200,7 +207,6 @@
# initiate cpustats
my $lxs = Sys::Statistics::Linux->new( cpustats => 1 );
- sleep(1);
while ( 1 ) {
sleep(1800);
@@ -214,10 +220,9 @@
my $lxs = Sys::Statistics::Linux->new( cpustats => 2 );
while ( 1 ) {
- $lxs->init; # init the statistics
- sleep(1); # sleep for the deltas
- my $stat = $lxs->get; # get the statistics
- sleep(1800); # sleep until the next run
+ $lxs->init; # init the statistics
+ my $stat = $lxs->get(1); # get the statistics
+ sleep(1800); # sleep until the next run
}
If you want to write a simple command line utility that prints the current workload
@@ -229,8 +234,7 @@
my $lxs = Sys::Statistics::Linux->new( cpustats => 1 );
while ( 1 ){
- sleep(1);
- my $cpu = $lxs->get->cpustats;
+ my $cpu = $lxs->get(1)->cpustats;
my $time = $lxs->gettime;
printf "%-20s%8s%8s%8s%8s%8s%8s%8s%8s\n",
$time, @{$cpu->{cpu}}{@order};
@@ -337,7 +341,6 @@
Test::More
Time::HiRes
UNIVERSAL
- UNIVERSAL::require
=head1 EXPORTS
@@ -364,18 +367,14 @@
=cut
package Sys::Statistics::Linux;
-our $VERSION = '0.42';
+our $VERSION = '0.43';
use strict;
use warnings;
use Carp qw(croak);
use POSIX qw(strftime);
use UNIVERSAL;
-use UNIVERSAL::require;
use Sys::Statistics::Linux::Compilation;
-
-# save loaded modules
-my %MODS;
sub new {
my $class = shift;
@@ -429,11 +428,12 @@
if ($opts->{$opt}) {
my $package = $class.'::'.$maps->{$opt};
- # require mod if not loaded
- unless ($MODS{$package}) {
- $package->require or croak "$class: unable to load $package";
- $MODS{$package} = 1;
- }
+ # require module - require know which modules are loaded
+ # and doesn't load a module twice.
+ my $require = $package;
+ $require =~ s/::/\//g;
+ $require .= '.pm';
+ require $require;
# create a new object if the object doesn't exist
# or create a new process list object if $pids is set
@@ -459,6 +459,7 @@
my $self = shift;
my $class = ref $self;
my $maps = $self->{maps};
+
foreach my $opt (keys %{$self->{opts}}) {
if ($self->{opts}->{$opt} > 0 && UNIVERSAL::can(ref($self->{obj}->{$opt}), 'init')) {
$self->{obj}->{$opt}->init();
@@ -470,6 +471,7 @@
my ($self, $time) = @_;
sleep $time if $time;
my %stat = ();
+
foreach my $opt (keys %{$self->{opts}}) {
if ($self->{opts}->{$opt}) {
$stat{$opt} = $self->{obj}->{$opt}->get();
@@ -478,6 +480,7 @@
}
}
}
+
return Sys::Statistics::Linux::Compilation->new(\%stat);
}
More information about the Pkg-perl-cvs-commits
mailing list