]> granicus.if.org Git - pgbadger/commitdiff
Add test on pgbouncer log parser.
authorGilles Darold <gilles@darold.net>
Wed, 12 Sep 2018 18:55:07 +0000 (20:55 +0200)
committerGilles Darold <gilles@darold.net>
Wed, 12 Sep 2018 18:55:07 +0000 (20:55 +0200)
t/03_consistency.t
t/fixtures/pgbouncer.log.gz [new file with mode: 0644]

index 2cffc7750321d876965b0263a66f88cc8833b7fb..04458e858e76ea560d135e65bd127d6fd71630eb 100755 (executable)
@@ -1,9 +1,9 @@
-use Test::Simple tests => 5;
+use Test::Simple tests => 6;
 use JSON::XS;
 
 my $json = new JSON::XS;
 
-my $LOG = 't/fixtures/light.postgres.log.bz2';
+my $LOG = 't/fixtures/light.postgres.log.bz2 t/fixtures/pgbouncer.log.gz';
 my $BIN = 'out.bin';
 my $OUT = 'out.json';
 
@@ -26,5 +26,7 @@ ok( $json_ref->{overall_stat}{histogram}{query_total} == 629, "Consistent query_
 
 ok( $json_ref->{overall_stat}{peak}{"2017-09-06 08:48:45"}{write} == 1, "Consistent peak write");
 
+ok( $json_ref->{pgb_session_info}{chronos}{20180912}{16}{count} == 63943, "pgBouncer connections");
+
 `rm -f $OUT`;
 
diff --git a/t/fixtures/pgbouncer.log.gz b/t/fixtures/pgbouncer.log.gz
new file mode 100644 (file)
index 0000000..20a1b10
Binary files /dev/null and b/t/fixtures/pgbouncer.log.gz differ