Re: pgbench stats per script & other stuff

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@postgresql.org>
Date: 2015-07-21T18:41:35Z
Lists: pgsql-hackers

Attachments

>> [...] and that a subsequent -w modifies the meaning of the 
>> script-specifiying argument already read. That strikes me as a very 
>> unintuitive interface.
>
> Ok, I understand this "afterward modification" objection.
>
> What if the -w would be required *before*, and supply a weight for (the 
> first/maybe all) script(s) specified *afterwards*, so it does not modify 
> something already provided? I think it would be more intuitive, or at least 
> less surprising.

Here is a v3 which does that. If there is a better idea, do not hesitate!

  sh> ./pgbench -w 9 -f one.sql -f now.sql -T 2 -P 1 --per-script-stats
  starting vacuum...end.
  progress: 1.0 s, 24536.0 tps, lat 0.039 ms stddev 0.024
  progress: 2.0 s, 25963.8 tps, lat 0.038 ms stddev 0.015
  transaction type: multiple scripts
  scaling factor: 1
  query mode: simple
  number of clients: 1
  number of threads: 1
  duration: 2 s
  number of transactions actually processed: 50501
  latency average = 0.039 ms
  latency stddev = 0.020 ms
  tps = 25249.464772 (including connections establishing)
  tps = 25339.454154 (excluding connections establishing)
  SQL script 0, weight 9: one.sql
   - 45366 transactions (89.8% of total, tps = 22682.070035)
   - latency average = 0.038 ms
   - latency stddev = 0.016 ms
  SQL script 1, weight 1: now.sql
   - 5135 transactions (10.2% of total, tps = 2567.394737)
   - latency average = 0.044 ms
   - latency stddev = 0.041 ms

-- 
Fabien.

Commits

  1. pgbench: Allow changing weights for scripts