Bugzilla – Attachment 113826 Details for
Bug 27059
Adding elapsed times/durations to updatedatabase would be nice.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27059: Add elapsed times to updatedatabase.pl
Bug-27059-Add-elapsed-times-to-updatedatabasepl.patch (text/plain), 2.86 KB, created by
Martin Renvoize (ashimema)
on 2020-11-19 16:06:34 UTC
(
hide
)
Description:
Bug 27059: Add elapsed times to updatedatabase.pl
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-11-19 16:06:34 UTC
Size:
2.86 KB
patch
obsolete
>From 140329fa3ff74e57a5abadbdbc5dfdf9aa6f3f41 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 19 Nov 2020 16:00:18 +0000 >Subject: [PATCH] Bug 27059: Add elapsed times to updatedatabase.pl > >--- > installer/data/mysql/updatedatabase.pl | 32 ++++++++++++++++++++++---- > 1 file changed, 27 insertions(+), 5 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index b524fad3a6..841b20844e 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -23500,6 +23500,7 @@ sub SetVersion { > C4::Context::clear_syspref_cache(); # invalidate cached preferences > } > >+my $start_time = time; > sub NewVersion { > my ( $DBversion, $bug_number, $descriptions ) = @_; > >@@ -23509,27 +23510,48 @@ sub NewVersion { > $descriptions = [ $descriptions ]; > } > my $first = 1; >- my $time = POSIX::strftime("%H:%M:%S",localtime); >+ my ( $seconds, $time, $elapsed ) = get_timestrings(); > for my $description ( @$descriptions ) { > if ( @$descriptions > 1 ) { > if ( $first ) { > unless ( $bug_number ) { >- say sprintf "Upgrade to %s done [%s]: %s", $DBversion, $time, $description; >+ say sprintf "Upgrade to %s done [%s %s]: %s", $DBversion, $time, $elapsed, $description; > } else { >- say sprintf "Upgrade to %s done [%s]: Bug %5s - %s", $DBversion, $time, $bug_number, $description; >+ say sprintf "Upgrade to %s done [%s %s]: Bug %5s - %s", $DBversion, $time, $elapsed, $bug_number, $description; > } > } else { > say sprintf "\t\t\t\t\t\t - %s", $description; > } > } else { > unless ( $bug_number ) { >- say sprintf "Upgrade to %s done [%s]: %s", $DBversion, $time, $description; >+ say sprintf "Upgrade to %s done [%s %s]: %s", $DBversion, $time, $elapsed, $description; > } else { >- say sprintf "Upgrade to %s done [%s]: Bug %5s - %s", $DBversion, $time, $bug_number, $description; >+ say sprintf "Upgrade to %s done [%s %s]: Bug %5s - %s", $DBversion, $time, $elapsed, $bug_number, $description; > } > } > $first = 0; > } >+ $start_time = $seconds; >+} >+ >+sub get_timestrings { >+ use integer; >+ my $now = time; >+ my $elapsed = $now - $start_time; >+ local $_ = $elapsed; >+ my ( $d, $h, $m, $s ); >+ $s = $_ % 60; >+ $_ /= 60; >+ $m = $_ % 60; >+ $_ /= 60; >+ $h = $_ % 24; >+ $_ /= 24; >+ $d = $_; >+ >+ my $now_pretty = POSIX::strftime("%H:%M:%S",localtime($now)); >+ my $elapsed_pretty = $d ? "($d:$h:$m:$s)" : $h ? "($h:$m:$s)" : $m ? "($m:$s)" : "($s)"; >+ >+ return ( $now, $now_pretty, $elapsed_pretty); > } > > =head2 CheckVersion >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27059
:
113826
|
113896