Re: review: pgbench - aggregation of info written into log

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: andrew(at)dunslane(dot)net
Cc: tv(at)fuzzy(dot)cz, pgsql-hackers(at)postgresql(dot)org
Subject: Re: review: pgbench - aggregation of info written into log
Date: 2013-01-17 01:05:16
Message-ID: 20130117.100516.994140325882071407.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>> It seems instr_time.h on Windows simply does not provide current
>> timestamp. From pgbench.c:
>>
>> /*
>> * if transaction finished, record the time it took in the log
>> */
>> if (logfile && commands[st->state + 1] == NULL)
>> {
>> instr_time now;
>> instr_time diff;
>> double usec;
>>
>> INSTR_TIME_SET_CURRENT(now);
>> diff = now;
>> INSTR_TIME_SUBTRACT(diff, st->txn_begin);
>> usec = (double) INSTR_TIME_GET_MICROSEC(diff);
>>
>> #ifndef WIN32
>> /* This is more than we really ought to know about instr_time */
>> fprintf(logfile, "%d %d %.0f %d %ld %ld\n",
>> st->id, st->cnt, usec, st->use_file,
>> (long) now.tv_sec, (long) now.tv_usec);
>> #else
>> /* On Windows, instr_time doesn't provide a timestamp anyway */
>> fprintf(logfile, "%d %d %.0f %d 0 0\n",
>> st->id, st->cnt, usec, st->use_file);
>> #endif
>> }
>
>
> This might be way more than we want to do, but there is an article
> that describes some techniques for doing what seems to be missing
> (AIUI):
>
> <http://msdn.microsoft.com/en-us/magazine/cc163996.aspx>

Even this would be doable, I'm afraid it may not fit in 9.3 if we
think about the current status of CF. So our choice would be:

1) Postpone the patch to 9.4

2) Commit the patch in 9.3 without Windows support

I personally am ok with #2. We traditionally avoid particular paltform
specific features on PostgreSQL. However I think the policiy could be
losen for contrib staffs. Also pgbench is just a client program. We
could always use pgbench on UNIX/Linux if we truely need the feature.

What do you think?
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2013-01-17 01:20:26 Re: review: pgbench - aggregation of info written into log
Previous Message Jeff Janes 2013-01-17 01:04:05 Re: Parallel query execution