Re: LibPQ: PQresultMemorySize as proxy to transfered bytes

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: LibPQ: PQresultMemorySize as proxy to transfered bytes
Дата
Msg-id 202311221616.bkvtixw2nw3n@alvherre.pgsql
обсуждение исходный текст
Ответ на LibPQ: PQresultMemorySize as proxy to transfered bytes  (Dominique Devienne <ddevienne@gmail.com>)
Список pgsql-general
On 2023-Jun-28, Dominique Devienne wrote:

> And if there's a better proxy to programmatically know the network
> traffic exchanged on the connection's socket, that's cross-platform?
> Obviously
> libpq itself knows, but I don't see any way to access that info.
> 
> Perhaps tracing might? But will that incur overhead?

Maybe you can use PQtrace()[1], yeah.  It will indicate, for each message
transmitted, its size in bytes.  Naturally there will be some overhead
in writing the trace file.  Also, the format of the output file has some
issues[2] that may make it difficult to machine-parse.  But it might be
good enough for you ... or you might find yourself motivated to fix
these problems.

[1] https://www.postgresql.org/docs/current/libpq-control.html#LIBPQ-PQTRACE
[2] https://www.postgr.es/m/CAFCRh-8OPoe%3D0j9v4wth7qU-x4jvjVc8DoOLV66qdnC9Do0ymw%40mail.gmail.com

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"Doing what he did amounts to sticking his fingers under the hood of the
implementation; if he gets his fingers burnt, it's his problem."  (Tom Lane)



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

Предыдущее
От: Ron Johnson
Дата:
Сообщение: Configuration knobs & dials to speed up query optimization
Следующее
От: Erik Wienhold
Дата:
Сообщение: Re: Feature request: pg_get_tabledef(text)