mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 05:56:21 +00:00
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.
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user