diff options
author | unknown <msvensson@neptunus.(none)> | 2006-04-05 11:47:12 +0200 |
---|---|---|
committer | unknown <msvensson@neptunus.(none)> | 2006-04-05 11:47:12 +0200 |
commit | 224b63e3782fcf66c365f3d297985ecca0b2cccd (patch) | |
tree | 7905875a4752da48d4b54f9ca8d735efbdcbe63d /client | |
parent | 6d5997b05ee30f1da8cb076c146a0cb162fd6500 (diff) | |
download | mariadb-git-224b63e3782fcf66c365f3d297985ecca0b2cccd.tar.gz |
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:
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.
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.c | 30 |
1 files changed, 30 insertions, 0 deletions
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; |