Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9b97e23

Browse files
author
Aleksandr Parfenov
committed
Update pg_wait_sampling in PGPROEE10_wait_sampling up to its master
2 parents 0fde833 + a86ac9b commit 9b97e23

File tree

2 files changed

+54
-6
lines changed

2 files changed

+54
-6
lines changed

contrib/pg_wait_sampling/META.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "pg_wait_sampling",
3+
"abstract": "Sampling based statistics of wait events",
4+
"description": "pg_wait_sampling provides functions for detailed per backend and per query statistics about PostgreSQL wait events",
5+
"version": "1.1.0",
6+
"maintainer": [
7+
"Alexander Korotkov <a.korotkov@postgrespro.ru>",
8+
"Ildus Kurbangaliev <i.kurbangaliev@gmail.com>"
9+
],
10+
"license": {
11+
"PostgreSQL": "http://www.postgresql.org/about/licence"
12+
},
13+
"prereqs": {
14+
"runtime": {
15+
"requires": {
16+
"PostgreSQL": "9.6.0"
17+
}
18+
}
19+
},
20+
"provides": {
21+
"pg_wait_sampling": {
22+
"file": "pg_wait_sampling--1.1.sql",
23+
"docfile": "README.md",
24+
"version": "1.1.0",
25+
"abstract": "Sampling based statistics of wait events"
26+
}
27+
},
28+
"resources": {
29+
"bugtracker": {
30+
"web": "https://github.com/postgrespro/pg_wait_sampling/issues"
31+
},
32+
"repository": {
33+
"url": "https://github.com/postgrespro/pg_wait_sampling.git",
34+
"web": "https://github.com/postgrespro/pg_wait_sampling",
35+
"type": "git"
36+
}
37+
},
38+
"generated_by": "Ildus Kurbangaliev",
39+
"meta-spec": {
40+
"version": "1.0.0",
41+
"url": "http://pgxn.org/meta/spec.txt"
42+
},
43+
"tags": [
44+
"waits",
45+
"sampling",
46+
"background worker",
47+
"wait events",
48+
"waits history",
49+
"waits profile"
50+
]
51+
}

contrib/pg_wait_sampling/collector.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,13 @@ register_wait_collector(void)
3838
BackgroundWorker worker;
3939

4040
/* Set up background worker parameters */
41+
memset(&worker, 0, sizeof(worker));
4142
worker.bgw_flags = BGWORKER_SHMEM_ACCESS;
4243
worker.bgw_start_time = BgWorkerStart_ConsistentState;
4344
worker.bgw_restart_time = 0;
4445
worker.bgw_notify_pid = 0;
45-
#if PG_VERSION_NUM >= 100000 || defined(WIN32)
46-
memcpy(worker.bgw_library_name, "pg_wait_sampling", BGW_MAXLEN);
47-
memcpy(worker.bgw_function_name, CppAsString(collector_main), BGW_MAXLEN);
48-
#else
49-
worker.bgw_main = collector_main;
50-
#endif
46+
snprintf(worker.bgw_library_name, BGW_MAXLEN, "pg_wait_sampling");
47+
snprintf(worker.bgw_function_name, BGW_MAXLEN, CppAsString(collector_main));
5148
snprintf(worker.bgw_name, BGW_MAXLEN, "pg_wait_sampling collector");
5249
worker.bgw_main_arg = (Datum) 0;
5350
RegisterBackgroundWorker(&worker);

0 commit comments

Comments
 (0)