Issue - (#53): Fix a bug where the query response time histogram does show proper counters.

PG-143 : PostgreSQL-13 has a different issue so, special handling for PostgreSQL-13 done.
pull/55/head
Ibrar Ahmed 2020-10-12 22:53:37 +00:00
parent ec1ff594b4
commit bc47a0074b
1 changed files with 10 additions and 6 deletions

View File

@ -826,6 +826,9 @@ static void pgss_store(const char *query, uint64 queryId,
e->counters.time[kind].max_time = total_time; e->counters.time[kind].max_time = total_time;
} }
/* increment only in case of PGSS_EXEC */
if (kind == PGSS_EXEC)
{
for (i = 0; i < MAX_RESPONSE_BUCKET - 1; i++) for (i = 0; i < MAX_RESPONSE_BUCKET - 1; i++)
{ {
if (total_time < PGSM_RESPOSE_TIME_LOWER_BOUND + (PGSM_RESPOSE_TIME_STEP * i)) if (total_time < PGSM_RESPOSE_TIME_LOWER_BOUND + (PGSM_RESPOSE_TIME_STEP * i))
@ -836,6 +839,7 @@ static void pgss_store(const char *query, uint64 queryId,
} }
if (total_time > PGSM_RESPOSE_TIME_LOWER_BOUND + (PGSM_RESPOSE_TIME_STEP * MAX_RESPONSE_BUCKET)) if (total_time > PGSM_RESPOSE_TIME_LOWER_BOUND + (PGSM_RESPOSE_TIME_STEP * MAX_RESPONSE_BUCKET))
e->counters.resp_calls[MAX_RESPONSE_BUCKET - 1]++; e->counters.resp_calls[MAX_RESPONSE_BUCKET - 1]++;
}
e->counters.calls[kind].rows += rows; e->counters.calls[kind].rows += rows;
e->counters.blocks.shared_blks_hit += bufusage->shared_blks_hit; e->counters.blocks.shared_blks_hit += bufusage->shared_blks_hit;