PATCH: pgbench - logging aggregated info and transactions at the same time

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: PATCH: pgbench - logging aggregated info and transactions at the same time
Date: 2015-03-08 22:01:33
Message-ID: 54FCC6BD.7050209@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

another thing that I find annoying on pgbench is that you can either log
aggregated summary (per interval) or detailed transaction info (possibly
sampled), but not both at the same time.

That's annoying because what I generally use the aggregated info, but
sometimes the transaction info would be handy too for verification and
further analysis.

Attached patch makes that possible by decoupling these two kinds of
logging. Up to now, '--agg-interval' option required '-l'. When both
options were used, aggregated data were logged. When only '-l' was used,
per-transaction info was logged. The patch makes those two options
independent.

When '-l' is used, per-transaction info (possibly for only a sample of
transactions, when --sample-rate is used) is written into
pgbench_log.PID.THREAD files.

When '--agg-interval' is used, aggregated info is collected and written
into pgbench_agg_log.PID.THREAD files.

It's possible to use all three options at the same time - in that case,
the sampling is only applied to the per-transaction logs. The aggregated
log will contain data from all the transactions.

This produces one log per thread, but combining this with the other
pgbench patch (log merge) should be trivial.

--
Tomas Vondra http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
pgbench-dual-logging-v1.patch text/x-diff 9.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2015-03-08 23:13:24 Re: Strange debug message of walreciver?
Previous Message Tomas Vondra 2015-03-08 20:29:15 PATCH: pgbench - merging transaction logs