pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: const (@const) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] issue #2478: Collect and report metrics from the driver side
Date: Sat, 18 Jun 2022 11:36:30 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

Please change time units to microseconds. java.util.time.Instant provides that time.

Also, it makes sense to organize measurement as listeners registered with driver or connection, that target output to needed data target: JFR special file or standard api, logging, or some custom output.

I think the following events are needed (time and thread when happened for each event, only additional parameters specified, id should be used to correlate events):

* Connection 
  * open
  * close (duration)
  * First statement in transaction
  * transaction commit success or fail  (duration of transaction)
  * transaction explicit rollback (duration of transaction)
  * autocommit changed
  * XA
    * Connection joined transaction
    * Connection left transaction
* Update preparead statement
  * prepare (statement, number of aguments)
  * Batch execution (batch size, batch number of elements)
  * Update started (size and number of input parameters, statement)
  * Update finished (size and number of input parameters, number of records, duration)
* Call statement
  * parepare (statement, number of arguments)
  * call started (size and number of input parameters, statement)
  * call finished (size and number of input/output parameters, duration)
* Query statement 
  * create (statement, number of agruments)
  * query started (size and number of input parameters, statement)
  * record received (offset in result, size, number of elements, time of reading record)
  * query finished (size and number of input/output parameters, total result set amount of records, total result size, duration)

For non-prepared statement, prepare and start event need to be joined. Size of result set record, call result, and arguments calculated as it is serialized to output + overheads of driver format.  So int8 + string of 20 ascii chars will be calculated as 8 (size of long) + 4 (length of text) + 20 (UTF8 byte size).

And it would nice to have a standard custom JFR output stream that records each  statement with unique text only once. So log will be small and could be picked from servers later.

view thread (20+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: github://pgjdbc/pgjdbc
  Cc: [email protected], [email protected]
  Subject: Re: [pgjdbc/pgjdbc] issue #2478: Collect and report metrics from the driver side
  In-Reply-To: <<[email protected]>>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox