Обсуждение: pgsql: pg_test_fsync: update output to show usecs/op clearer

Поиск
Список
Период
Сортировка

pgsql: pg_test_fsync: update output to show usecs/op clearer

От
Bruce Momjian
Дата:
pg_test_fsync: update output to show usecs/op clearer

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/095018bc32b70eff95bdf3c2959e6eef09dcfa6a

Modified Files
--------------
contrib/pg_test_fsync/pg_test_fsync.c |    2 +-
1 files changed, 1 insertions(+), 1 deletions(-)


Re: pgsql: pg_test_fsync: update output to show usecs/op clearer

От
Peter Geoghegan
Дата:
On Thu, May 2, 2013 at 7:27 AM, Bruce Momjian <bruce@momjian.us> wrote:
> pg_test_fsync: update output to show usecs/op clearer

I don't think that this is an improvement. Not everyone knows that
usec is shorthand for microsecond. If I Google usec, I see something
about the United States Enrichment Corporation, but that's about it.


--
Peter Geoghegan


Re: pgsql: pg_test_fsync: update output to show usecs/op clearer

От
Dimitri Fontaine
Дата:
Peter Geoghegan <pg@heroku.com> writes:
> On Thu, May 2, 2013 at 7:27 AM, Bruce Momjian <bruce@momjian.us> wrote:
>> pg_test_fsync: update output to show usecs/op clearer
>
> I don't think that this is an improvement. Not everyone knows that
> usec is shorthand for microsecond.

Use unicode super power and ouput µsec, as it's meant to be? Then google
is useful again, for the smaller number of people who would need it.

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


Re: pgsql: pg_test_fsync: update output to show usecs/op clearer

От
Bruce Momjian
Дата:
On Thu, May  2, 2013 at 08:38:39AM -0700, Peter Geoghegan wrote:
> On Thu, May 2, 2013 at 7:27 AM, Bruce Momjian <bruce@momjian.us> wrote:
> > pg_test_fsync: update output to show usecs/op clearer
>
> I don't think that this is an improvement. Not everyone knows that
> usec is shorthand for microsecond. If I Google usec, I see something
> about the United States Enrichment Corporation, but that's about it.

Well, we use 'usecs' all over our code, and in pg_test_timing:

    Histogram of timing durations:
    < usec   % of total      count
         1     95.86499   69510498
         2      4.13395    2997478
         4      0.00062        453
         8      0.00042        301
        16      0.00001          8
        32      0.00000          1

Microseconds just isn't going to fit there.  Postgres understands usec:

    test=> select '1 usec'::interval;
        interval
    -----------------
     00:00:00.000001
    (1 row)

I think the people running these tools are going to know usec.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +


Re: pgsql: pg_test_fsync: update output to show usecs/op clearer

От
Bruce Momjian
Дата:
On Thu, May  2, 2013 at 05:44:07PM +0200, Dimitri Fontaine wrote:
> Peter Geoghegan <pg@heroku.com> writes:
> > On Thu, May 2, 2013 at 7:27 AM, Bruce Momjian <bruce@momjian.us> wrote:
> >> pg_test_fsync: update output to show usecs/op clearer
> >
> > I don't think that this is an improvement. Not everyone knows that
> > usec is shorthand for microsecond.
>
> Use unicode super power and ouput µsec, as it's meant to be? Then google
> is useful again, for the smaller number of people who would need it.

That would be cool, but I don't think we can assume everyone running
these tools is on a UTF8-enabled terminal.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +


Re: pgsql: pg_test_fsync: update output to show usecs/op clearer

От
Andres Freund
Дата:
On 2013-05-02 12:09:22 -0400, Bruce Momjian wrote:
> On Thu, May  2, 2013 at 05:44:07PM +0200, Dimitri Fontaine wrote:
> > Peter Geoghegan <pg@heroku.com> writes:
> > > On Thu, May 2, 2013 at 7:27 AM, Bruce Momjian <bruce@momjian.us> wrote:
> > >> pg_test_fsync: update output to show usecs/op clearer
> > >
> > > I don't think that this is an improvement. Not everyone knows that
> > > usec is shorthand for microsecond.
> >
> > Use unicode super power and ouput µsec, as it's meant to be? Then google
> > is useful again, for the smaller number of people who would need it.
>
> That would be cool, but I don't think we can assume everyone running
> these tools is on a UTF8-enabled terminal.

I don't care about the symbol here, but I think psql has code to
determine that for its line drawing stuff...

Greetings,

Andres Freund

--
 Andres Freund                       http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


Re: pgsql: pg_test_fsync: update output to show usecs/op clearer

От
Bruce Momjian
Дата:
On Thu, May  2, 2013 at 06:13:11PM +0200, Andres Freund wrote:
> On 2013-05-02 12:09:22 -0400, Bruce Momjian wrote:
> > On Thu, May  2, 2013 at 05:44:07PM +0200, Dimitri Fontaine wrote:
> > > Peter Geoghegan <pg@heroku.com> writes:
> > > > On Thu, May 2, 2013 at 7:27 AM, Bruce Momjian <bruce@momjian.us> wrote:
> > > >> pg_test_fsync: update output to show usecs/op clearer
> > > >
> > > > I don't think that this is an improvement. Not everyone knows that
> > > > usec is shorthand for microsecond.
> > >
> > > Use unicode super power and ouput µsec, as it's meant to be? Then google
> > > is useful again, for the smaller number of people who would need it.
> >
> > That would be cool, but I don't think we can assume everyone running
> > these tools is on a UTF8-enabled terminal.
>
> I don't care about the symbol here, but I think psql has code to
> determine that for its line drawing stuff...

Uh, yeah, I think it does.  I question whether a command-line diagnostic
tool really should use it though.  It might also make grep of the result
difficult.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +


Re: pgsql: pg_test_fsync: update output to show usecs/op clearer

От
Dimitri Fontaine
Дата:
Bruce Momjian <bruce@momjian.us> writes:
> Uh, yeah, I think it does.  I question whether a command-line diagnostic
> tool really should use it though.  It might also make grep of the result
> difficult.

Hey, it's 2013 outside. Just saying:

   $ echo 'µsec' | grep µsec
   µsec
   $ echo 'µsec' | awk '/µsec/'
   µsec

Maybe there's no practical problem here,
--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


Re: pgsql: pg_test_fsync: update output to show usecs/op clearer

От
Bruce Momjian
Дата:
On Thu, May  2, 2013 at 06:29:34PM +0200, Dimitri Fontaine wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > Uh, yeah, I think it does.  I question whether a command-line diagnostic
> > tool really should use it though.  It might also make grep of the result
> > difficult.
>
> Hey, it's 2013 outside. Just saying:
>
>    $ echo 'µsec' | grep µsec
>    µsec
>    $ echo 'µsec' | awk '/µsec/'
>    µsec
>
> Maybe there's no practical problem here,

My point is that tools would need to adjust to output not knowing if
they are getting UTF8 output, e.g.:

    grep '(µ|u)sec'

Do any of the OS tools output UTF8 bytes as headers?  I have never seen
it.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +


Re: pgsql: pg_test_fsync: update output to show usecs/op clearer

От
Dimitri Fontaine
Дата:
Bruce Momjian <bruce@momjian.us> writes:
> My point is that tools would need to adjust to output not knowing if
> they are getting UTF8 output, e.g.:

Ah, yes. Or use "LANG=C pg_test_fsync" or the documented stanza that
always works in scripts as it forces the output to something
predictable?

--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


Re: pgsql: pg_test_fsync: update output to show usecs/op clearer

От
Bruce Momjian
Дата:
On Thu, May  2, 2013 at 06:41:53PM +0200, Dimitri Fontaine wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > My point is that tools would need to adjust to output not knowing if
> > they are getting UTF8 output, e.g.:
>
> Ah, yes. Or use "LANG=C pg_test_fsync" or the documented stanza that
> always works in scripts as it forces the output to something
> predictable?

Actually, pg_upgrade does that so it gets the output always in English
so it can do its comparisons.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +


Re: pgsql: pg_test_fsync: update output to show usecs/op clearer

От
Greg Stark
Дата:
On Thu, May 2, 2013 at 4:44 PM, Dimitri Fontaine <dimitri@2ndquadrant.fr> wrote:
> Use unicode super power and ouput µsec, as it's meant to be? Then google
> is useful again, for the smaller number of people who would need it.

The SI abbreviation would be µs actually.

I don't think it's worth spending an U+03B9 of time on this however.


--
greg