Re: Add connection active, idle time to pg_stat_activity

Поиск
Список
Период
Сортировка
От Sergey Dudoladov
Тема Re: Add connection active, idle time to pg_stat_activity
Дата
Msg-id CAA8Fd-oS8WHe5n6bWZWW07+65dk4p+njCRCV0hMDYPVc-9c0pQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add connection active, idle time to pg_stat_activity  ("Drouvot, Bertrand" <bdrouvot@amazon.com>)
Ответы Re: Add connection active, idle time to pg_stat_activity  (Aleksander Alekseev <aleksander@timescale.com>)
Re: Add connection active, idle time to pg_stat_activity  (torikoshia <torikoshia@oss.nttdata.com>)
Список pgsql-hackers
Hello,

thanks for the helpful review. I have incorporated most of the
suggestions into the patch. I have also rebased and tested the patch
on top of the current master (2cd2569c72b89200).

> +       int64           active_time_diff = 0;
> +       int64           transaction_idle_time_diff = 0;
>
> I think here we can use only a single variable say "state_time_diff" for
> example, as later only one of those two is incremented anyway.

I have written it this way to avoid cluttering the critical section
between PGSTAT_(BEGIN|END)_WRITE_ACTIVITY.
With two variable one can leave only actual increments in the section
and check conditions / call TimestampDifference outside of it.

Regards,
Sergey

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: automatically generating node support functions
Следующее
От: Aleksander Alekseev
Дата:
Сообщение: Re: [PATCH] Compression dictionaries for JSONB