diff options
| author | Tatsuo Ishii <ishii@postgresql.org> | 2007-04-06 09:16:16 +0000 |
|---|---|---|
| committer | Tatsuo Ishii <ishii@postgresql.org> | 2007-04-06 09:16:16 +0000 |
| commit | e574f2a029d707201aad307983fa74972aceab4a (patch) | |
| tree | 6297847d5c2982b798e0a0a7ebc8ab4f29f8df14 /contrib/pgbench/pgbench.c | |
| parent | 7e96269a82d0f92db6066b1e30df5931ac1ad130 (diff) | |
| download | postgresql-e574f2a029d707201aad307983fa74972aceab4a.tar.gz | |
Enhance pgbench -l option to add timestamp. Patch contributed by Greg
Smith. Along with Japanese doc updation by Tasuo Ishii.
> This patch changes the way pgbench outputs its latency log files so that
> every transaction gets a timestamp and notes which transaction type was
> executed. It's a one-line change that just dumps some additional
> information that was already sitting in that area of code. I also made a
> couple of documentation corrections and clarifications on some of the more
> confusing features of pgbench.
>
> It's straightforward to parse log files in this format to analyze what
> happened during the test at a higher level than was possible with the
> original format. You can find some rough sample code to convert this
> latency format into CVS files and then into graphs at
> http://www.westnet.com/~gsmith/content/postgresql/pgbench.htm which I'll
> be expanding on once I get all my little patches sent in here.
Diffstat (limited to 'contrib/pgbench/pgbench.c')
| -rw-r--r-- | contrib/pgbench/pgbench.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c index 369b7669f1..2ffd24b25b 100644 --- a/contrib/pgbench/pgbench.c +++ b/contrib/pgbench/pgbench.c @@ -1,5 +1,5 @@ /* - * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.63 2007/04/06 08:49:44 ishii Exp $ + * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.64 2007/04/06 09:16:16 ishii Exp $ * * pgbench: a simple benchmark program for PostgreSQL * written by Tatsuo Ishii @@ -469,7 +469,8 @@ top: diff = (int) (now.tv_sec - st->txn_begin.tv_sec) * 1000000.0 + (int) (now.tv_usec - st->txn_begin.tv_usec); - fprintf(LOGFILE, "%d %d %.0f\n", st->id, st->cnt, diff); + fprintf(LOGFILE, "%d %d %.0f %d %ld %ld\n", + st->id, st->cnt, diff, st->use_file, now.tv_sec,now.tv_usec); } if (commands[st->state]->type == SQL_COMMAND) |
