Re: Add connection active, idle time to pg_stat_activity

From: torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>
To: Sergey Dudoladov <sergey(dot)dudoladov(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "Drouvot, Bertrand" <bdrouvot(at)amazon(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>, Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>
Subject: Re: Add connection active, idle time to pg_stat_activity
Date: 2022-07-14 03:15:24
Message-ID: a8ec82fc03dcac57998cdb31a9979cc3@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Rafia, Sergey,

+1 for adding the total_active_time and total_idle_in_transaction_time
to pg_stat_activity.

I reviewed the patch and here are some comments.

+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>total_active_time</structfield> <type>double
precision</type>
+ </para>
+ <para>
+ Time in milliseconds this backend spent in
<literal>active</literal> and
+ <literal>fastpath</literal> states.

Is 'fastpath' an abbreviation of 'fastpath function call'?
If so, I feel it's clearer '<literal>fastpath function call</literal>'
than '<literal>fastpath</literal>'.

+extern uint64 pgstat_get_my_active_time(void);
+extern uint64 pgstat_get_my_transaction_idle_time(void);

Are these functions necessary?
It seems they are not called from anywhere, doesn't it?

--
Regards,

--
Atsushi Torikoshi
NTT DATA CORPORATION

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2022-07-14 04:16:55 Re: [PoC] Improve dead tuple storage for lazy vacuum
Previous Message Masahiko Sawada 2022-07-14 03:06:07 Re: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns