Fix bug 821717: pt-tcp-model --type=requests crashes.

This commit is contained in:
Daniel Nichter
2011-10-11 08:31:42 -06:00
parent ccd1a2a7f8
commit 7da33234f5
5 changed files with 55 additions and 4 deletions

View File

@@ -9,7 +9,7 @@ BEGIN {
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use Test::More tests => 1;
use Test::More tests => 2;
use PerconaTest;
shift @INC; # our unshift (above)
@@ -18,7 +18,8 @@ shift @INC; # PerconaTest's unshift
require "$trunk/bin/pt-tcp-model";
my @args = qw();
my $in = "$trunk/t/lib/samples/simple-tcpdump/";
my $in1 = "$trunk/t/lib/samples/simple-tcpdump/";
my $in2 = "$trunk/t/pt-tcp-model/samples/in/";
my $out = "t/pt-tcp-model/samples/out/";
my $output = '';
@@ -27,12 +28,21 @@ my $output = '';
# ############################################################################
ok(
no_diff(
sub { pt_tcp_model::main(@args, "$in/simpletcp001.txt") },
sub { pt_tcp_model::main(@args, "$in1/simpletcp001.txt") },
"$out/simpletcp001.txt",
),
'Analysis for simpletcp001.txt'
);
ok(
no_diff(
sub { pt_tcp_model::main(@args, "$in2/sorted001.txt",
qw(--type requests --run-time 1)) },
"$out/sorted001.txt",
),
'Analysis for sorted001.txt (issue 1341)'
);
# #############################################################################
# Done.
# #############################################################################

View File

@@ -0,0 +1,33 @@
0 1318341891.407876 1318341891.407998 0.000122 127.0.0.1:59243
1 1318341891.408318 1318341891.408583 0.000265 127.0.0.1:59243
2 1318341893.456477 1318341893.456928 0.000451 127.0.0.1:59243
3 1318341893.457328 1318341893.457576 0.000248 127.0.0.1:59243
4 1318341893.461037 1318341893.461795 0.000758 127.0.0.1:59243
5 1318341893.462275 1318341893.463729 0.001454 127.0.0.1:59243
6 1318341893.464039 1318341893.464166 0.000127 127.0.0.1:59243
7 1318341893.464443 1318341893.464798 0.000355 127.0.0.1:59243
8 1318341893.464923 1318341893.465028 0.000105 127.0.0.1:59243
9 1318341893.465207 1318341893.465301 0.000094 127.0.0.1:59243
10 1318341893.465408 1318341893.465503 0.000095 127.0.0.1:59243
11 1318341893.465618 1318341893.465712 0.000094 127.0.0.1:59243
12 1318341893.465860 1318341893.465952 0.000092 127.0.0.1:59243
13 1318341893.466155 1318341893.466391 0.000236 127.0.0.1:59243
14 1318341893.466546 1318341893.466663 0.000117 127.0.0.1:59243
15 1318341893.466983 1318341893.467085 0.000102 127.0.0.1:59243
16 1318341893.467190 1318341893.467284 0.000094 127.0.0.1:59243
17 1318341893.467392 1318341893.467851 0.000459 127.0.0.1:59243
18 1318341893.468247 1318341893.468354 0.000107 127.0.0.1:59243
19 1318341893.468475 1318341893.468573 0.000098 127.0.0.1:59243
20 1318341893.468710 1318341893.468805 0.000095 127.0.0.1:59243
21 1318341893.468920 1318341893.469310 0.000390 127.0.0.1:59243
22 1318341893.469572 1318341893.469670 0.000098 127.0.0.1:59243
23 1318341893.469863 1318341893.469968 0.000105 127.0.0.1:59243
24 1318341893.470155 1318341893.470362 0.000207 127.0.0.1:59243
25 1318341893.470495 1318341893.470737 0.000242 127.0.0.1:59243
26 1318341893.470921 1318341893.471029 0.000108 127.0.0.1:59243
27 1318341893.471247 1318341893.471454 0.000207 127.0.0.1:59243
28 1318341893.471655 1318341893.471752 0.000097 127.0.0.1:59243
29 1318341897.750127 1318341897.752687 0.002560 127.0.0.1:59243
30 1318341900.468642 1318341900.472179 0.003537 127.0.0.1:59243
31 1318341906.516355 1318341906.521779 0.005424 127.0.0.1:59243
32 1318341914.969460 1318341914.972640 0.003180 127.0.0.1:59243

View File

@@ -0,0 +1,6 @@
1318341891 0.00 1.256 2 2 0.000387 0.000387 0.000387 0.000026 0.000265 1.592124
1318341893 0.00 6.750 27 27 0.006635 0.006635 0.006635 0.000328 0.001454 4.000000
1318341897 0.00 0.333 1 1 0.002560 0.002560 0.002560 0.000000 0.002560 3.000000
1318341900 0.00 0.167 1 1 0.003537 0.003537 0.003537 0.000000 0.003537 6.000000
1318341906 0.00 0.125 1 1 0.005424 0.005424 0.005424 0.000000 0.005424 8.000000
1318341914 0.00 1.028 1 1 0.003180 0.003180 0.003180 0.000000 0.003180 0.972640