Bugzilla – Attachment 67499 Details for
Bug 19190
Silly calculation of average time in touch_all scripts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19190: Silly calculation of average time in touch_all scripts
Bug-19190-Silly-calculation-of-average-time-in-tou.patch (text/plain), 2.06 KB, created by
Marcel de Rooy
on 2017-10-02 08:33:21 UTC
(
hide
)
Description:
Bug 19190: Silly calculation of average time in touch_all scripts
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-10-02 08:33:21 UTC
Size:
2.06 KB
patch
obsolete
>From 28b9ce4df8fc887048e86750955b653ee5fe3ee0 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 28 Aug 2017 11:59:19 +0200 >Subject: [PATCH] Bug 19190: Silly calculation of average time in touch_all > scripts >Content-Type: text/plain; charset=utf-8 > >When you want to calculate average time, do not divide count by time :) > >Test plan: >Run the script with a where condition and verbose option and see that >the average time is meaningful. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: David Bourgault <david.bourgault@inlibro.com> >--- > misc/maintenance/touch_all_biblios.pl | 2 +- > misc/maintenance/touch_all_items.pl | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/misc/maintenance/touch_all_biblios.pl b/misc/maintenance/touch_all_biblios.pl >index d091089..b6a5add 100755 >--- a/misc/maintenance/touch_all_biblios.pl >+++ b/misc/maintenance/touch_all_biblios.pl >@@ -99,7 +99,7 @@ my $endtime = time(); > my $time = $endtime-$startime; > my $accuracy = ($goodcount / $totalcount) * 100; # this is a percentage > my $averagetime = 0; >-unless ($time == 0) { $averagetime = $totalcount / $time; }; >+$averagetime = $time / $totalcount if $totalcount; > print "Good: $goodcount, Bad: $badcount (of $totalcount) in $time seconds\n"; > printf "Accuracy: %.2f%%\nAverage time per record: %.6f seconds\n", $accuracy, $averagetime if (defined $verbose); > >diff --git a/misc/maintenance/touch_all_items.pl b/misc/maintenance/touch_all_items.pl >index fdbce5c..64c70e3 100755 >--- a/misc/maintenance/touch_all_items.pl >+++ b/misc/maintenance/touch_all_items.pl >@@ -98,7 +98,7 @@ my $endtime = time(); > my $time = $endtime-$startime; > my $accuracy = ($goodcount / $totalcount) * 100; # this is a percentage > my $averagetime = 0; >-unless ($time == 0) {$averagetime = $totalcount / $time;}; >+$averagetime = $time / $totalcount if $totalcount; > print "Good: $goodcount, Bad: $badcount (of $totalcount) in $time seconds\n"; > printf "Accuracy: %.2f%%\nAverage time per record: %.6f seconds\n", $accuracy, $averagetime if (defined $verbose); > >-- >2.1.4
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 19190
:
66550
|
66551
|
67332
|
67499
|
67500
|
67752
|
67753