Monty Taylor recently took my import progress patch and ported it into Drizzle.  I managed to spot a small bug in his conversion so took a bzr branch and fixed it.  I then spoke to Jay Pipes who suggested I could improve it by making it take a parameter which would be the number of lines per output (rather than fixed at 1000 for the original patch).

After I made the improvement I have started taking on more work for the Drizzle project in my spare time and have somehow got myself into the top 20 contributors.  But that is another story.

I have now taken my work on Drizzle for the import progress patch and ported it back to MySQL 5.1.30 in a new patch which can be found here.  This patch now has the parameter "--show-progress-size=#" where # is the number of lines per output.

For example:

shell> mysql --show-progress-size=1500 < input-file.sql
Processing line: 1500
Processing line: 3000
...

With MySQL I have used \r so the progress shows on a single line.  With Drizzle \n is used for gettext compatibility.

Comments:

Neat. We just implemented something sort of like this last month, but using a wrapper script that counts bytes piped to "mysql". fdstat stdin and you can figure out if it's a pipe or not and show a nice "x of y" progress bar. estimated time to completion is kind of problematic though.

Posted by Andrew on January 17, 2009 at 06:59 PM GMT #

Hi Andrew,
Harrison Fisk stated another way of doing this by using a utility called 'bar' at:
http://blogs.sun.com/LinuxJedi/entry/mysql_import_progress#comments

Posted by LinuxJedi on January 17, 2009 at 07:07 PM GMT #

Hi Andrew -

Please use one of the public channels to contribute code to MySQL. These are "internals" and the "bugs db" channels.

This way people can more openly discuss the patch you're proposing here.

You're a Sun employee and have no need for an SCA.

Take a look here; http://forge.mysql.com/wiki/Contributing_Code

Once you do that, please attach a comment here so people know how to track the "destiny" of this contribution w.r.t. MySQL.

Regards,
Masood

Posted by M. Mortazavi on March 30, 2009 at 07:19 AM BST #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by LinuxJedi