Thread: Re: pgbench: Improve result outputs related to failed transactinos

Re: pgbench: Improve result outputs related to failed transactinos

From
Tatsuo Ishii
Date:
>> > I overlooked the "NaN% of total" in per-script results.
>> > I think this NaN also should be avoided.
>> > 
>> > I fixed  the number of transactions in per-script results to include
>> > skipped and failed transactions. It prevents to print  "total of NaN%"
>> > when any transactions are not successfully  processed. 
>> 
>> Thanks for the fix. Here is the new run with the v2 patch. The result
>> looks good to me.
>> 
>> src/bin/pgbench/pgbench -p 11002 -c1 -t 1 -f c.sql -f d.sql  --failures-detailed -r test
>> pgbench (18devel)
>> starting vacuum...end.
>> transaction type: multiple scripts
>> scaling factor: 1
>> query mode: simple
>> number of clients: 1
>> number of threads: 1
>> maximum number of tries: 1
>> number of transactions per client: 1
>> number of transactions actually processed: 1/1
>> number of failed transactions: 0 (0.000%)
>> number of serialization failures: 0 (0.000%)
>> number of deadlock failures: 0 (0.000%)
>> latency average = 2.434 ms
>> initial connection time = 2.117 ms
>> tps = 410.846343 (without initial connection time)
>> SQL script 1: c.sql
>>  - weight: 1 (targets 50.0% of total)
>>  - 1 transactions (100.0% of total)
>>  - number of transactions actually pocessed: 1 (tps = 410.846343)
>>  - number of failed transactions: 0 (0.000%)
>>  - number of serialization failures: 0 (0.000%)
>>  - number of deadlock failures: 0 (0.000%)
>>  - latency average = 2.419 ms
>>  - latency stddev = 0.000 ms
>>  - statement latencies in milliseconds and failures:
>>          0.187           0  begin;
>>          0.153           0  set transaction isolation level serializable;
>>          0.977           0  insert into t1 select max(i)+1,2 from t1;
>>          1.102           0  end;
>> SQL script 2: d.sql
>>  - weight: 1 (targets 50.0% of total)
>>  - 0 transactions (0.0% of total)
>>  - statement latencies in milliseconds and failures:
>>          0.000           0  begin;
>>          0.000           0  set transaction isolation level serializable;
>>          0.000           0  insert into t1 select max(i)+1,2 from t1;
>>          0.000           0  end;
>> 
>> > Although it breaks the back-compatibility, this seems reasonable
>> > modification because not only succeeded transactions but also skips and
>> > failures ones are now handled and reported for each script.  Also, the
>> > number of transactions actually processed per-script and TPS based on
>> > it are now output explicitly in a separate line.
>> 
>> Okay for me as long as the patch is pushed to master branch.
>> 
>> A small comment on the comments in the patch: pgindent dislikes some
>> of the comment indentation styles. See attached pgindent.txt. Although
>> such a small defect would be fixed by committers when a patch gets
>> committed anyway, you might want to help committers beforehand.
> 
> Thank you for your comments.
> I've attached a updated patch that I applied pgindent.

The patch looks good to me. If there's no objection, I will commit and
push the patch to master branch. I don't think this should be
back-patched since it modifies the user visible behavior of pgbench.

Best reagards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp



Re: pgbench: Improve result outputs related to failed transactinos

From
Tatsuo Ishii
Date:
>>> Thanks for the fix. Here is the new run with the v2 patch. The result
>>> looks good to me.
>>> 
>>> src/bin/pgbench/pgbench -p 11002 -c1 -t 1 -f c.sql -f d.sql  --failures-detailed -r test
>>> pgbench (18devel)
>>> starting vacuum...end.
>>> transaction type: multiple scripts
>>> scaling factor: 1
>>> query mode: simple
>>> number of clients: 1
>>> number of threads: 1
>>> maximum number of tries: 1
>>> number of transactions per client: 1
>>> number of transactions actually processed: 1/1
>>> number of failed transactions: 0 (0.000%)
>>> number of serialization failures: 0 (0.000%)
>>> number of deadlock failures: 0 (0.000%)
>>> latency average = 2.434 ms
>>> initial connection time = 2.117 ms
>>> tps = 410.846343 (without initial connection time)
>>> SQL script 1: c.sql
>>>  - weight: 1 (targets 50.0% of total)
>>>  - 1 transactions (100.0% of total)
>>>  - number of transactions actually pocessed: 1 (tps = 410.846343)
>>>  - number of failed transactions: 0 (0.000%)
>>>  - number of serialization failures: 0 (0.000%)
>>>  - number of deadlock failures: 0 (0.000%)
>>>  - latency average = 2.419 ms
>>>  - latency stddev = 0.000 ms
>>>  - statement latencies in milliseconds and failures:
>>>          0.187           0  begin;
>>>          0.153           0  set transaction isolation level serializable;
>>>          0.977           0  insert into t1 select max(i)+1,2 from t1;
>>>          1.102           0  end;
>>> SQL script 2: d.sql
>>>  - weight: 1 (targets 50.0% of total)
>>>  - 0 transactions (0.0% of total)
>>>  - statement latencies in milliseconds and failures:
>>>          0.000           0  begin;
>>>          0.000           0  set transaction isolation level serializable;
>>>          0.000           0  insert into t1 select max(i)+1,2 from t1;
>>>          0.000           0  end;
>>> 
>>> > Although it breaks the back-compatibility, this seems reasonable
>>> > modification because not only succeeded transactions but also skips and
>>> > failures ones are now handled and reported for each script.  Also, the
>>> > number of transactions actually processed per-script and TPS based on
>>> > it are now output explicitly in a separate line.
>>> 
>>> Okay for me as long as the patch is pushed to master branch.
>>> 
>>> A small comment on the comments in the patch: pgindent dislikes some
>>> of the comment indentation styles. See attached pgindent.txt. Although
>>> such a small defect would be fixed by committers when a patch gets
>>> committed anyway, you might want to help committers beforehand.
>> 
>> Thank you for your comments.
>> I've attached a updated patch that I applied pgindent.
> 
> The patch looks good to me. If there's no objection, I will commit and
> push the patch to master branch. I don't think this should be
> back-patched since it modifies the user visible behavior of pgbench.

Patch pushed.

Best reagards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp



Re: pgbench: Improve result outputs related to failed transactinos

From
Yugo NAGATA
Date:
On Fri, 11 Oct 2024 13:54:54 +0900 (JST)
Tatsuo Ishii <ishii@postgresql.org> wrote:

> >>> Thanks for the fix. Here is the new run with the v2 patch. The result
> >>> looks good to me.
> >>> 
> >>> src/bin/pgbench/pgbench -p 11002 -c1 -t 1 -f c.sql -f d.sql  --failures-detailed -r test
> >>> pgbench (18devel)
> >>> starting vacuum...end.
> >>> transaction type: multiple scripts
> >>> scaling factor: 1
> >>> query mode: simple
> >>> number of clients: 1
> >>> number of threads: 1
> >>> maximum number of tries: 1
> >>> number of transactions per client: 1
> >>> number of transactions actually processed: 1/1
> >>> number of failed transactions: 0 (0.000%)
> >>> number of serialization failures: 0 (0.000%)
> >>> number of deadlock failures: 0 (0.000%)
> >>> latency average = 2.434 ms
> >>> initial connection time = 2.117 ms
> >>> tps = 410.846343 (without initial connection time)
> >>> SQL script 1: c.sql
> >>>  - weight: 1 (targets 50.0% of total)
> >>>  - 1 transactions (100.0% of total)
> >>>  - number of transactions actually pocessed: 1 (tps = 410.846343)
> >>>  - number of failed transactions: 0 (0.000%)
> >>>  - number of serialization failures: 0 (0.000%)
> >>>  - number of deadlock failures: 0 (0.000%)
> >>>  - latency average = 2.419 ms
> >>>  - latency stddev = 0.000 ms
> >>>  - statement latencies in milliseconds and failures:
> >>>          0.187           0  begin;
> >>>          0.153           0  set transaction isolation level serializable;
> >>>          0.977           0  insert into t1 select max(i)+1,2 from t1;
> >>>          1.102           0  end;
> >>> SQL script 2: d.sql
> >>>  - weight: 1 (targets 50.0% of total)
> >>>  - 0 transactions (0.0% of total)
> >>>  - statement latencies in milliseconds and failures:
> >>>          0.000           0  begin;
> >>>          0.000           0  set transaction isolation level serializable;
> >>>          0.000           0  insert into t1 select max(i)+1,2 from t1;
> >>>          0.000           0  end;
> >>> 
> >>> > Although it breaks the back-compatibility, this seems reasonable
> >>> > modification because not only succeeded transactions but also skips and
> >>> > failures ones are now handled and reported for each script.  Also, the
> >>> > number of transactions actually processed per-script and TPS based on
> >>> > it are now output explicitly in a separate line.
> >>> 
> >>> Okay for me as long as the patch is pushed to master branch.
> >>> 
> >>> A small comment on the comments in the patch: pgindent dislikes some
> >>> of the comment indentation styles. See attached pgindent.txt. Although
> >>> such a small defect would be fixed by committers when a patch gets
> >>> committed anyway, you might want to help committers beforehand.
> >> 
> >> Thank you for your comments.
> >> I've attached a updated patch that I applied pgindent.
> > 
> > The patch looks good to me. If there's no objection, I will commit and
> > push the patch to master branch. I don't think this should be
> > back-patched since it modifies the user visible behavior of pgbench.
> 
> Patch pushed.

Thanks!

Regards,
Yugo Nagata


-- 
Yugo NAGATA <nagata@sraoss.co.jp>



Re: pgbench: Improve result outputs related to failed transactinos

From
Alexander Lakhin
Date:
Hello Tatsuo-san,

11.10.2024 07:54, Tatsuo Ishii wrote:
>>>> ...
>>>>   - number of transactions actually pocessed: 1 (tps = 410.846343)
>>>> ...
> Patch pushed.

Please consider fixing a typo sneaked in that commit: pocessed -> processed?

Best regards,
Alexander



Re: pgbench: Improve result outputs related to failed transactinos

From
Tatsuo Ishii
Date:
Hello Alexander,

> Hello Tatsuo-san,
> 
> 11.10.2024 07:54, Tatsuo Ishii wrote:
>>>>> ...
>>>>>   - number of transactions actually pocessed: 1 (tps = 410.846343)
>>>>> ...
>> Patch pushed.
> 
> Please consider fixing a typo sneaked in that commit: pocessed ->
> processed?

Thank you for the report! I have pushed a fix.

Best reagards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp