Issue - (#54): Planning counters require renaming.

PG-144 : Changing planing counter name to sync with pg_stat_statment.
pull/55/head
Ibrar Ahmed 2020-10-12 22:39:44 +00:00
parent f48a64cc0a
commit ec1ff594b4
3 changed files with 10 additions and 9 deletions

View File

@ -24,7 +24,7 @@ CREATE FUNCTION pg_stat_monitor(IN showtext boolean,
OUT query text,
OUT bucket_start_time timestamptz,
OUT plan_calls int8,
OUT plans int8,
OUT plan_total_time float8,
OUT plan_min_time float8,
OUT plan_max_time float8,
@ -32,13 +32,13 @@ CREATE FUNCTION pg_stat_monitor(IN showtext boolean,
OUT plan_stddev_time float8,
OUT plan_rows int8,
OUT total_calls int8,
OUT calls int8,
OUT total_time float8,
OUT min_time float8,
OUT max_time float8,
OUT mean_time float8,
OUT stddev_time float8,
OUT affected_rows int8,
OUT rows int8,
OUT shared_blks_hit int8,
OUT shared_blks_read int8,
@ -103,20 +103,19 @@ CREATE VIEW pg_stat_monitor AS SELECT
'0.0.0.0'::inet + client_ip AS client_ip,
queryid,
query,
plan_calls,
plans,
round( CAST(plan_total_time as numeric), 2)::float8 as plan_total_time,
round( CAST(plan_min_time as numeric), 2)::float8 as plan_min_timei,
round( CAST(plan_max_time as numeric), 2)::float8 as plan_max_time,
round( CAST(plan_mean_time as numeric), 2)::float8 as plan_mean_time,
round( CAST(plan_stddev_time as numeric), 2)::float8 as plan_stddev_time,
plan_rows,
total_calls,
calls,
round( CAST(total_time as numeric), 2)::float8 as total_time,
round( CAST(min_time as numeric), 2)::float8 as min_time,
round( CAST(max_time as numeric), 2)::float8 as max_time,
round( CAST(mean_time as numeric), 2)::float8 as mean_time,
round( CAST(stddev_time as numeric), 2)::float8 as stddev_time,
affected_rows,
rows,
shared_blks_hit,
shared_blks_read,
shared_blks_dirtied,

View File

@ -89,7 +89,7 @@ static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
static uint64 pgss_hash_string(const char *str, int len);
static void pgss_store(const char *query, uint64 queryId,
int query_location, int query_len,
bool kind,
pgssStoreKind kind,
double total_time, uint64 rows,
const BufferUsage *bufusage,
#if PG_VERSION_NUM >= 130000
@ -656,7 +656,7 @@ pg_get_client_addr(void)
*/
static void pgss_store(const char *query, uint64 queryId,
int query_location, int query_len,
bool kind,
pgssStoreKind kind,
double total_time, uint64 rows,
const BufferUsage *bufusage,
#if PG_VERSION_NUM >= 130000

View File

@ -71,6 +71,7 @@ typedef struct GucVariables
int guc_max;
bool guc_restart;
} GucVariable;
typedef enum pgssStoreKind
{
PGSS_INVALID = -1,
@ -195,6 +196,7 @@ typedef struct Counters
CallTime time[PGSS_NUMKIND];
Blocks blocks;
SysInfo sysinfo;
int plans;
int resp_calls[MAX_RESPONSE_BUCKET]; /* execution time's in msec */
} Counters;