diff options
Diffstat (limited to 'src/perl/LogSummary/t')
-rw-r--r-- | src/perl/LogSummary/t/GNUmakefile | 12 | ||||
-rw-r--r-- | src/perl/LogSummary/t/app/20081125.0 | bin | 0 -> 483152 bytes | |||
-rw-r--r-- | src/perl/LogSummary/t/app/20081125.index | bin | 0 -> 272 bytes | |||
-rw-r--r-- | src/perl/LogSummary/t/app/20081125.meta | bin | 0 -> 379 bytes | |||
-rw-r--r-- | src/perl/LogSummary/t/app/20081126.0 | bin | 0 -> 481124 bytes | |||
-rw-r--r-- | src/perl/LogSummary/t/app/20081126.index | bin | 0 -> 252 bytes | |||
-rw-r--r-- | src/perl/LogSummary/t/app/20081126.meta | bin | 0 -> 323 bytes | |||
-rw-r--r-- | src/perl/LogSummary/t/app/GNUmakefile | 13 | ||||
-rw-r--r-- | src/perl/LogSummary/t/db/20081125.0 | bin | 0 -> 1451420 bytes | |||
-rw-r--r-- | src/perl/LogSummary/t/db/20081125.index | bin | 0 -> 472 bytes | |||
-rw-r--r-- | src/perl/LogSummary/t/db/20081125.meta | bin | 0 -> 554 bytes | |||
-rw-r--r-- | src/perl/LogSummary/t/db/20081126.0 | bin | 0 -> 1440428 bytes | |||
-rw-r--r-- | src/perl/LogSummary/t/db/20081126.index | bin | 0 -> 492 bytes | |||
-rw-r--r-- | src/perl/LogSummary/t/db/20081126.meta | bin | 0 -> 704 bytes | |||
-rw-r--r-- | src/perl/LogSummary/t/db/GNUmakefile | 13 | ||||
-rw-r--r-- | src/perl/LogSummary/t/test.t | 41 |
16 files changed, 79 insertions, 0 deletions
diff --git a/src/perl/LogSummary/t/GNUmakefile b/src/perl/LogSummary/t/GNUmakefile new file mode 100644 index 0000000..6c00e8d --- /dev/null +++ b/src/perl/LogSummary/t/GNUmakefile @@ -0,0 +1,12 @@ +TOPDIR = ../../../.. +include $(TOPDIR)/src/include/builddefs +LSRCFILES = test.t +SUBDIRS = app db + +default: + +include $(BUILDRULES) + +install: + +default_pcp install_pcp: diff --git a/src/perl/LogSummary/t/app/20081125.0 b/src/perl/LogSummary/t/app/20081125.0 Binary files differnew file mode 100644 index 0000000..43e5f4a --- /dev/null +++ b/src/perl/LogSummary/t/app/20081125.0 diff --git a/src/perl/LogSummary/t/app/20081125.index b/src/perl/LogSummary/t/app/20081125.index Binary files differnew file mode 100644 index 0000000..76eb3b9 --- /dev/null +++ b/src/perl/LogSummary/t/app/20081125.index diff --git a/src/perl/LogSummary/t/app/20081125.meta b/src/perl/LogSummary/t/app/20081125.meta Binary files differnew file mode 100644 index 0000000..5007180 --- /dev/null +++ b/src/perl/LogSummary/t/app/20081125.meta diff --git a/src/perl/LogSummary/t/app/20081126.0 b/src/perl/LogSummary/t/app/20081126.0 Binary files differnew file mode 100644 index 0000000..9563c3c --- /dev/null +++ b/src/perl/LogSummary/t/app/20081126.0 diff --git a/src/perl/LogSummary/t/app/20081126.index b/src/perl/LogSummary/t/app/20081126.index Binary files differnew file mode 100644 index 0000000..d5d7fa6 --- /dev/null +++ b/src/perl/LogSummary/t/app/20081126.index diff --git a/src/perl/LogSummary/t/app/20081126.meta b/src/perl/LogSummary/t/app/20081126.meta Binary files differnew file mode 100644 index 0000000..b60336c --- /dev/null +++ b/src/perl/LogSummary/t/app/20081126.meta diff --git a/src/perl/LogSummary/t/app/GNUmakefile b/src/perl/LogSummary/t/app/GNUmakefile new file mode 100644 index 0000000..8309f9c --- /dev/null +++ b/src/perl/LogSummary/t/app/GNUmakefile @@ -0,0 +1,13 @@ +TOPDIR = ../../../../.. +include $(TOPDIR)/src/include/builddefs +LSRCFILES = \ + 20081125.meta 20081125.index 20081125.0 \ + 20081126.meta 20081126.index 20081126.0 + +default: + +include $(BUILDRULES) + +install: + +default_pcp install_pcp: diff --git a/src/perl/LogSummary/t/db/20081125.0 b/src/perl/LogSummary/t/db/20081125.0 Binary files differnew file mode 100644 index 0000000..5c8d606 --- /dev/null +++ b/src/perl/LogSummary/t/db/20081125.0 diff --git a/src/perl/LogSummary/t/db/20081125.index b/src/perl/LogSummary/t/db/20081125.index Binary files differnew file mode 100644 index 0000000..450dd1a --- /dev/null +++ b/src/perl/LogSummary/t/db/20081125.index diff --git a/src/perl/LogSummary/t/db/20081125.meta b/src/perl/LogSummary/t/db/20081125.meta Binary files differnew file mode 100644 index 0000000..52f8376 --- /dev/null +++ b/src/perl/LogSummary/t/db/20081125.meta diff --git a/src/perl/LogSummary/t/db/20081126.0 b/src/perl/LogSummary/t/db/20081126.0 Binary files differnew file mode 100644 index 0000000..758c6ae --- /dev/null +++ b/src/perl/LogSummary/t/db/20081126.0 diff --git a/src/perl/LogSummary/t/db/20081126.index b/src/perl/LogSummary/t/db/20081126.index Binary files differnew file mode 100644 index 0000000..eac9dbb --- /dev/null +++ b/src/perl/LogSummary/t/db/20081126.index diff --git a/src/perl/LogSummary/t/db/20081126.meta b/src/perl/LogSummary/t/db/20081126.meta Binary files differnew file mode 100644 index 0000000..835e3be --- /dev/null +++ b/src/perl/LogSummary/t/db/20081126.meta diff --git a/src/perl/LogSummary/t/db/GNUmakefile b/src/perl/LogSummary/t/db/GNUmakefile new file mode 100644 index 0000000..8309f9c --- /dev/null +++ b/src/perl/LogSummary/t/db/GNUmakefile @@ -0,0 +1,13 @@ +TOPDIR = ../../../../.. +include $(TOPDIR)/src/include/builddefs +LSRCFILES = \ + 20081125.meta 20081125.index 20081125.0 \ + 20081126.meta 20081126.index 20081126.0 + +default: + +include $(BUILDRULES) + +install: + +default_pcp install_pcp: diff --git a/src/perl/LogSummary/t/test.t b/src/perl/LogSummary/t/test.t new file mode 100644 index 0000000..816c114 --- /dev/null +++ b/src/perl/LogSummary/t/test.t @@ -0,0 +1,41 @@ +# Before `make install' is performed this script should be runnable with +# `make test'. After `make install' it should work as `perl test.t' + +######################### + +# change 'tests => 1' to 'tests => last_test_to_print'; + +use Test; +BEGIN { plan tests => 15 }; +use PCP::LogSummary; +ok(1); # If we made it this far, we're ok. + +######################### + +my $archive = 't/db/20081125'; +my @metrics = ( 'kernel.all.cpu.user', 'kernel.all.cpu.sys' ); +my $results = PCP::LogSummary->new($archive, \@metrics); +ok(1, defined($results), "log summarised"); + +foreach my $metric ( sort keys %$results ) { + my $summary = $$results{$metric}; + #print("metric=", $metric, "\n"); + #print(" average=", $$summary{'average'}, "\n"); + #print(" samples=", $$summary{'samples'}, "\n"); + ok(1, ($$summary{'samples'} == 5758), "samples verified"); + ok(1, ($$summary{'average'} > 0), "average lower bounds check"); + ok(1, ($$summary{'average'} < 1), "average upper bounds check") ; +} + +$results = PCP::LogSummary->new($archive, \@metrics, '@09:00', '@17:00'); +ok(1, defined($results), "restricted log summarised"); + +foreach my $metric ( sort keys %$results ) { + my $summary = $$results{$metric}; + #print("metric=", $metric, "\n"); + #print(" average=", $$summary{'average'}, "\n"); + #print(" samples=", $$summary{'samples'}, "\n"); + ok(1, ($$summary{'samples'} == 1919), "restricted samples verified"); + ok(1, ($$summary{'average'} > 0), "average lower bounds check"); + ok(1, ($$summary{'average'} < 1), "average upper bounds check") ; +} |