From 145289281683f8d13f6a6909c7c379dc598a4666 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Wed, 5 Apr 2006 11:47:12 +0200 Subject: Incorporate a patch to write a timestamp for every new line of the test that is executed. This makes it possible make a graph (with for example gnuplot) of a test run and spot where most time is consumed. Add the new code inside an "#if 0" until it's portable. --- client/mysqltest.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/client/mysqltest.c b/client/mysqltest.c index 33170d32adf..49e3097421a 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -4501,6 +4501,35 @@ static void init_var_hash(MYSQL *mysql) DBUG_VOID_RETURN; } +static void mark_progress(int line) +{ +#if 0 + static FILE* fp = NULL; + static double first; + + struct timeval tv; + double now; + + if (!fp) + { + + fp = fopen("/tmp/mysqltest_progress.log", "wt"); + + if (!fp) + { + abort(); + } + + gettimeofday(&tv, NULL); + first = tv.tv_sec * 1e6 + tv.tv_usec; + } + + gettimeofday(&tv, NULL); + now = tv.tv_sec * 1e6 + tv.tv_usec; + + fprintf(fp, "%d %f\n", parser.current_line, (now - first) / 1e6); +#endif +} int main(int argc, char **argv) { @@ -4851,6 +4880,7 @@ int main(int argc, char **argv) } parser.current_line += current_line_inc; + mark_progress(parser.current_line); } start_lineno= 0; -- cgit v1.2.1