[Bug 27048] New: Add timestamps to verbose output of rebuild_zebra.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 Bug ID: 27048 Summary: Add timestamps to verbose output of rebuild_zebra.pl Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz It would be helpful to have timestamps added to the verbose option of rebuild_zebra.pl to see how long the rebuild has been running. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@ptfs-europe |ity.org |.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 113773 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113773&action=edit Bug 27048: Add basic timekeeping to rebuild_zebra -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113773|0 |1 is obsolete| | --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 113780 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113780&action=edit Bug 27048: Add basic timekeeping to rebuild_zebra This patch adds a start time, end time and elapsed times on the 'records exported' lines to the verbose output of the rebuild_zebra.pl script. Test plan 1/ Run rebuild_zebra.pl -a -b -v 2/ Note the new timestamps included on the verbose output 3/ Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ian.bays@ptfs-europe.com, | |jon.turner@ptfs-europe.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jesse@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Comment on attachment 113780 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113780 Bug 27048: Add basic timekeeping to rebuild_zebra Review of attachment 113780: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=27048&attachment=113780) ----------------------------------------------------------------- ::: misc/migration_tools/rebuild_zebra.pl @@ +848,5 @@
+ 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_pretty $elapsed_pretty"; +}
Why not just use DateTime->now()->strftime("%H:%M:%S")? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113780|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 115931 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115931&action=edit Bug 27048: Add basic timekeeping to rebuild_zebra This patch adds a start time, end time and elapsed times on the 'records exported' lines to the verbose output of the rebuild_zebra.pl script. Test plan 1/ Run rebuild_zebra.pl -a -b -v 2/ Note the new timestamps included on the verbose output 3/ Signoff Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to David Cook from comment #3)
Comment on attachment 113780 [details] [review] Bug 27048: Add basic timekeeping to rebuild_zebra
Review of attachment 113780 [details] [review]: -----------------------------------------------------------------
::: misc/migration_tools/rebuild_zebra.pl @@ +848,5 @@
+ 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_pretty $elapsed_pretty"; +}
Why not just use DateTime->now()->strftime("%H:%M:%S")?
Martin, can you answer David's question please? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This works well, still wondering about comment#3 - Failing QA to get attention :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- (In reply to David Cook from comment #3)
Comment on attachment 113780 [details] [review] Bug 27048: Add basic timekeeping to rebuild_zebra
Review of attachment 113780 [details] [review]: -----------------------------------------------------------------
::: misc/migration_tools/rebuild_zebra.pl @@ +848,5 @@
+ 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_pretty $elapsed_pretty"; +}
Why not just use DateTime->now()->strftime("%H:%M:%S")?
No major reason for using POSIX.. mostly I was avoiding more DateTime use.. but as it's a single call it's not terrible so can be swapped if needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I have a better answer now.. 1. Because there is already president for using POSIX in the script 2. Because if we were switching to DateTime we should use dt_from_string to localise and be consistent with the rest of Koha. 3. Because DateTime::Durations don't print nicely without importing DateTime::Format::Duration which would add another dependency for a reasonably trivial functionality. 4. Because I hoped to 'keep it simple' by just working in seconds.. which it did. I've tried to write a patch to switch to using DateTime and it ends up requiring extra dependencies, looking worse in the output and more complicated to work with :( -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 117201 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117201&action=edit Bug 27048: (follow-up) Use DateTime instead of POSIX This introduces additional dependancies and builds DateTime objects multiple times.. I'm not sure it's worth it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 --- Comment #10 from David Cook <dcook@prosentient.com.au> --- I think I must not have paid enough attention to the patch the first time around. I thought you were just adding timestamps to the loglines. I didn't realize that you were tracking elapsed time as well. I would do it differently but I'm not the one writing the code. I'll accept the reasons for using POSIX over DateTime, so no complaint from me. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115931|0 |1 is obsolete| | Attachment #117201|0 |1 is obsolete| | --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 117418 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117418&action=edit Bug 27048: Add basic timekeeping to rebuild_zebra This patch adds a start time, end time and elapsed times on the 'records exported' lines to the verbose output of the rebuild_zebra.pl script. Test plan 1/ Run rebuild_zebra.pl -a -b -v 2/ Note the new timestamps included on the verbose output 3/ Signoff Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I have obsoleted the datetime patch. I had already tested this before without and found it working well. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- 60 seconds: exporting authority 13:06:38 [1:0] 61 seconds: exporting authority 13:05:30 [1:1] 54321 seconds: exporting authority 13:07:06 [15:5:21] It's not displayed as a duration and it's confusing IMO. It should at least display the HH, MM and SS parts on 2 digits. Why not "15 hours, 5 minutes, 21 seconds" instead? Or "15h 5m 21s"? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Jonathan Druart from comment #13)
60 seconds: exporting authority 13:06:38 [1:0] 61 seconds: exporting authority 13:05:30 [1:1] 54321 seconds: exporting authority 13:07:06 [15:5:21]
It's not displayed as a duration and it's confusing IMO. It should at least display the HH, MM and SS parts on 2 digits. Why not "15 hours, 5 minutes, 21 seconds" instead? Or "15h 5m 21s"?
Hm, you are right. I guess my test db was too small, so the big numbers didn't make me suspicious. I think the second format you suggest would be better. Or: Duration: 00:00:02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 117452 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117452&action=edit Bug 27048: (follow-up) Correction to elapsed printing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Fix the duration printing to take the form [00:00:07] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 --- Comment #17 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Martin, don't you think we should add a "elapsed" or "duration" to explain what it is? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117452|0 |1 is obsolete| | --- Comment #18 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 117617 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117617&action=edit Bug 27048: (follow-up) Correction to elapsed printing JD Amended patch: Remove perlcritic error "$d" is declared but not used at line 839, column 5. Unused variables clutter code and make it harder to read. (Severity: 3) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 --- Comment #19 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m Version(s)|21.05.00 |21.05.00,20.11.04 released in| | --- Comment #20 from Fridolin Somers <fridolin.somers@biblibre.com> --- Nice little enhancement, I choose to backport. Pushed to 20.11.x for 20.11.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27048 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com Resolution|--- |FIXED Status|Pushed to stable |RESOLVED --- Comment #21 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Enhancement, not backported t0 20.05 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org