4
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
5
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
6
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
10
use warnings FATAL => 'all';
11
use English qw(-no_match_vars);
12
use Test::More tests => 5;
14
use TCPRequestAggregator;
17
my $in = "t/lib/samples/simple-tcprequests/";
20
# Check that I can parse a simple log and aggregate it into 100ths of a second
21
$p = new TCPRequestAggregator(interval => '.01', quantile => '.99');
25
file => "$in/simpletcp-requests001.txt",
27
{ ts => '1301957863.82',
28
concurrency => '0.346932',
29
throughput => '1800.173395',
32
weighted_time => '0.003469',
33
sum_time => '0.003492',
34
variance_mean => '0.000022',
35
quantile_time => '0.000321',
36
obs_time => '0.009999',
37
busy_time => '0.002861',
40
{ ts => '1301957863.83',
41
concurrency => '0.649048',
42
throughput => '1600.001526',
45
weighted_time => '0.006490',
46
sum_time => '0.011227',
47
variance_mean => '0.004070',
48
quantile_time => '0.007201',
49
obs_time => '0.010000',
50
busy_time => '0.004933',
53
{ ts => '1301957863.84',
54
concurrency => '1.000000',
55
throughput => '0.000000',
58
weighted_time => '0.004759',
59
sum_time => '0.000000',
60
variance_mean => '0.000000',
61
quantile_time => '0.000000',
62
obs_time => '0.004759',
63
busy_time => '0.004759',
69
# Check that I can parse a log whose first event is ID = 0, and whose events all
70
# fit within one time interval.
71
$p = new TCPRequestAggregator(interval => '.01', quantile => '.99');
74
file => "$in/simpletcp-requests002.txt",
76
{ ts => '1301957863.82',
77
concurrency => '0.353948',
78
throughput => '1789.648311',
81
weighted_time => '0.003362',
82
variance_mean => '0.000022',
83
sum_time => '0.003362',
84
quantile_time => '0.000321',
85
obs_time => '0.009499',
86
busy_time => '0.002754',
92
# #############################################################################
94
# #############################################################################
98
open STDERR, '>', \$output;
99
$p->_d('Complete test coverage');
103
qr/Complete test coverage/,