Skip to content

Commit 10576bd

Browse files
committed
Make t/42prof_data.t more informative
1 parent e400f87 commit 10576bd

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

Changes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ DBI::Changes - List of significant changes to the DBI
66

77
=cut
88

9+
=head2 Changes in DBI 1.633
10+
11+
Made t/42prof_data.t more informative
12+
913
=head2 Changes in DBI 1.632 - 5th Nov 2014
1014

1115
Fixed risk of memory corruption with many arguments to methods

t/42prof_data.t

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,15 @@ my $dbh = DBI->connect("dbi:ExampleP:", '', '',
3838
{ RaiseError=>1, Profile=>"6/DBI::ProfileDumper/File:$prof_file" });
3939
isa_ok( $dbh, 'DBI::db', 'Created connection' );
4040

41-
# do a little work, but enough to ensure we don't get 0's on systems with low res timers
42-
foreach (1..6) {
41+
require DBI::Profile;
42+
DBI::Profile->import(qw(dbi_time));
43+
44+
# do enough work to avoid 0's on systems that are very fast or have low res timers
45+
my $t1 = dbi_time();
46+
foreach (1..20) {
4347
$dbh->do("set dummy=$_");
4448
my $sth = $dbh->prepare($sql);
45-
for my $loop (1..50) {
49+
for my $loop (1..90) {
4650
$sth->execute(".");
4751
$sth->fetchrow_hashref;
4852
$sth->finish;
@@ -51,6 +55,8 @@ foreach (1..6) {
5155
}
5256
$dbh->disconnect;
5357
undef $dbh;
58+
my $t2 = dbi_time();
59+
note sprintf "DBI work done in %fs (%f - %f)", $t2-$t1, $t2, $t1;
5460

5561

5662
# wrote the profile to disk?

0 commit comments

Comments
 (0)