summaryrefslogtreecommitdiff
path: root/src/perl/LogSummary/extract.pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/perl/LogSummary/extract.pl')
-rwxr-xr-xsrc/perl/LogSummary/extract.pl18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/perl/LogSummary/extract.pl b/src/perl/LogSummary/extract.pl
new file mode 100755
index 0000000..1165a7b
--- /dev/null
+++ b/src/perl/LogSummary/extract.pl
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use PCP::LogSummary;
+
+my $archive = 't/db/20081125';
+my @metrics = ( 'kernel.all.cpu.user', 'kernel.all.cpu.idle',
+ 'kernel.all.cpu.intr', 'kernel.all.cpu.sys' );
+my $results = PCP::LogSummary->new($archive, \@metrics, '@09:00', '@17:00');
+#my $results = PCP::LogSummary->new($archive, \@metrics);
+
+foreach my $metric ( keys %$results ) {
+ my $summary = $$results{$metric};
+ print "metric=", $metric, "\n";
+ print " average=", $$summary{'average'}, "\n";
+ print " samples=", $$summary{'samples'}, "\n";
+}