Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit32c389d

Browse files
committed
Merge branch 'master' into stable
2 parentsdf7612b +92becb3 commit32c389d

19 files changed

+172
-9
lines changed

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
/results
55
*pg_wait_sampling--1.1.sql
66
.log
7+
Dockerfile

‎.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,9 @@ env:
2323
-PG_VERSION=10 CHECK_CODE=clang
2424
-PG_VERSION=10 CHECK_CODE=cppcheck
2525
-PG_VERSION=10 CHECK_CODE=false
26+
-PG_VERSION=11 CHECK_CODE=clang
2627
-PG_VERSION=11 CHECK_CODE=false
28+
-PG_VERSION=12 CHECK_CODE=clang
2729
-PG_VERSION=12 CHECK_CODE=false
30+
-PG_VERSION=13 CHECK_CODE=clang
31+
-PG_VERSION=13 CHECK_CODE=false

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/postgrespro/pg_wait_sampling.svg?branch=master)](https://travis-ci.org/postgrespro/pg_wait_sampling)
1+
[![Build Status](https://travis-ci.com/postgrespro/pg_wait_sampling.svg?branch=master)](https://travis-ci.com/postgrespro/pg_wait_sampling)
22
[![PGXN version](https://badge.fury.io/pg/pg_wait_sampling.svg)](https://badge.fury.io/pg/pg_wait_sampling)
33
[![GitHub license](https://img.shields.io/badge/license-PostgreSQL-blue.svg)](https://raw.githubusercontent.com/postgrespro/pg_wait_sampling/master/LICENSE)
44

‎collector.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
#include"postgres.h"
1111

1212
#include"catalog/pg_type.h"
13+
#ifPG_VERSION_NUM >=130000
14+
#include"common/hashfn.h"
15+
#endif
1316
#include"funcapi.h"
1417
#include"miscadmin.h"
1518
#include"postmaster/bgworker.h"
@@ -303,11 +306,11 @@ static int64
303306
millisecs_diff(TimestampTztz1,TimestampTztz2)
304307
{
305308
longsecs;
306-
intmillisecs;
309+
intmicrosecs;
307310

308-
TimestampDifference(tz1,tz2,&secs,&millisecs);
311+
TimestampDifference(tz1,tz2,&secs,&microsecs);
309312

310-
returnsecs*1000+millisecs;
313+
returnsecs*1000+microsecs /1000;
311314

312315
}
313316

‎debian/changelog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
pg-wait-sampling (1.1.2-1) unstable; urgency=medium
2+
3+
* New upstream version compatible with PG13
4+
5+
-- Adrien Nayrat <adrien.nayrat@anayrat.info> Wed, 28 Oct 2020 09:03:03 +0000
6+
7+
pg-wait-sampling (1.1.1-1) unstable; urgency=medium
8+
9+
* Release 1.1.1
10+
11+
-- Adrien Nayrat <adrien.nayrat@anayrat.info> Wed, 17 Jun 2020 12:26:59 +0000

‎debian/compat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9

‎debian/control

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Source: pg-wait-sampling
2+
Section: database
3+
Priority: optional
4+
Maintainer: Adrien Nayrat <adrien.nayrat@anayrat.info>
5+
Standards-Version: 4.5.0
6+
Build-Depends: debhelper (>=9~), postgresql-server-dev-all (>= 141~)
7+
Homepage: https://github.com/postgrespro/pg_wait_sampling
8+
Vcs-Browser: https://github.com/postgrespro/pg_wait_sampling
9+
Vcs-Git: https://github.com/postgrespro/pg_wait_sampling.git
10+
11+
Package: postgresql-9.6-pg-wait-sampling
12+
Architecture: any
13+
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-9.6,
14+
Description: pg_wait-sampling provides functions for detailed per backend
15+
and per query statistics about PostgreSQL wait events
16+
17+
Package: postgresql-10-pg-wait-sampling
18+
Architecture: any
19+
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-10,
20+
Description: pg_wait-sampling provides functions for detailed per backend
21+
and per query statistics about PostgreSQL wait events
22+
23+
Package: postgresql-11-pg-wait-sampling
24+
Architecture: any
25+
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-11,
26+
Description: pg_wait-sampling provides functions for detailed per backend
27+
and per query statistics about PostgreSQL wait events
28+
29+
Package: postgresql-12-pg-wait-sampling
30+
Architecture: any
31+
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-12,
32+
Description: pg_wait-sampling provides functions for detailed per backend
33+
and per query statistics about PostgreSQL wait events
34+
35+
Package: postgresql-13-pg-wait-sampling
36+
Architecture: any
37+
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-13,
38+
Description: pg_wait-sampling provides functions for detailed per backend
39+
and per query statistics about PostgreSQL wait events

‎debian/control.in

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Source: pg-wait-sampling
2+
Section: database
3+
Priority: optional
4+
Maintainer: Adrien Nayrat <adrien.nayrat@anayrat.info>
5+
Standards-Version: 4.5.0
6+
Build-Depends: debhelper (>=9~), postgresql-server-dev-all (>= 141~)
7+
Homepage: https://github.com/postgrespro/pg_wait_sampling
8+
Vcs-Browser: https://github.com/postgrespro/pg_wait_sampling
9+
Vcs-Git: https://github.com/postgrespro/pg_wait_sampling.git
10+
11+
Package: postgresql-PGVERSION-pg-wait-sampling
12+
Architecture: any
13+
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-PGVERSION,
14+
Description: pg_wait-sampling provides functions for detailed per backend
15+
and per query statistics about PostgreSQL wait events

‎debian/copyright

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
pg_wait_sampling is released under the PostgreSQL License, a liberal Open Source license, similar to the BSD or MIT licenses.
2+
3+
Copyright (c) 2015-2017, Postgres Professional
4+
Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
5+
Portions Copyright (c) 1994, The Regents of the University of California
6+
7+
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
8+
9+
IN NO EVENT SHALL POSTGRES PROFESSIONAL BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF POSTGRES PROFESSIONAL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10+
11+
POSTGRES PROFESSIONAL SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND POSTGRES PROFESSIONAL HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

‎debian/pgversions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9.6+

‎debian/rules

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/make -f
2+
3+
PKGVER =$(shell dpkg-parsechangelog | awk -F '[:-]' '/^Version:/ { print substr($$2, 2) }')
4+
EXCLUDE = --exclude-vcs --exclude=debian
5+
6+
include /usr/share/postgresql-common/pgxs_debian_control.mk
7+
8+
override_dh_auto_build:
9+
# do nothing
10+
11+
override_dh_auto_test:
12+
# nothing to do here, upstream tests used, see debian/tests/*
13+
14+
override_dh_auto_install:
15+
# build all supported versions
16+
+pg_buildext loop postgresql-%v-pg-wait-sampling
17+
18+
override_dh_installdocs:
19+
dh_installdocs --all README.md
20+
21+
override_dh_auto_clean:
22+
$(MAKE) clean USE_PGXS=1 PG_CONFIG=/usr/bin/pg_config
23+
24+
orig: debian/control clean
25+
cd ..&& tar czf pg-wait-sampling_$(PKGVER).orig.tar.gz$(EXCLUDE) pg_wait_sampling-$(PKGVER)
26+
%:
27+
dh$@

‎debian/source/format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0 (quilt)

‎debian/tests/control

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Depends: @, postgresql-server-dev-all
2+
Tests: installcheck
3+
Restrictions: allow-stderr

‎debian/tests/installcheck

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
set -eu
4+
5+
pg_buildext -o"shared_preload_libraries=pg_wait_sampling" installcheck

‎debian/watch

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version=3
2+
opts="uversionmangle=s/_/./g" \
3+
https://github.com/postgrespro/pg_wait_sampling/releases .*/archive/v(.*).tar.gz

‎expected/queries.out

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,25 @@ WITH t as (SELECT sum(0) FROM pg_wait_sampling_profile)
2020
0
2121
(1 row)
2222

23+
-- Some dummy checks just to be sure that all our functions work and return something.
24+
SELECT count(*) = 1 as test FROM pg_wait_sampling_get_current(pg_backend_pid());
25+
test
26+
------
27+
t
28+
(1 row)
29+
30+
SELECT count(*) >= 0 as test FROM pg_wait_sampling_get_profile();
31+
test
32+
------
33+
t
34+
(1 row)
35+
36+
SELECT count(*) >= 0 as test FROM pg_wait_sampling_get_history();
37+
test
38+
------
39+
t
40+
(1 row)
41+
2342
SELECT pg_wait_sampling_reset_profile();
2443
pg_wait_sampling_reset_profile
2544
--------------------------------

‎pg_wait_sampling.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ CollectorShmqHeader *collector_hdr = NULL;
5050
staticshmem_startup_hook_typeprev_shmem_startup_hook=NULL;
5151
staticPGPROC*search_proc(intbackendPid);
5252
staticPlannedStmt*pgws_planner_hook(Query*parse,
53+
#ifPG_VERSION_NUM >=130000
54+
constchar*query_string,
55+
#endif
5356
intcursorOptions,ParamListInfoboundParams);
5457
staticvoidpgws_ExecutorEnd(QueryDesc*queryDesc);
5558

@@ -771,7 +774,11 @@ pg_wait_sampling_get_history(PG_FUNCTION_ARGS)
771774
* planner_hook hook, save queryId for collector
772775
*/
773776
staticPlannedStmt*
774-
pgws_planner_hook(Query*parse,intcursorOptions,
777+
pgws_planner_hook(Query*parse,
778+
#ifPG_VERSION_NUM >=130000
779+
constchar*query_string,
780+
#endif
781+
intcursorOptions,
775782
ParamListInfoboundParams)
776783
{
777784
if (MyProc)
@@ -795,9 +802,17 @@ pgws_planner_hook(Query *parse, int cursorOptions,
795802

796803
/* Invoke original hook if needed */
797804
if (planner_hook_next)
798-
returnplanner_hook_next(parse,cursorOptions,boundParams);
805+
returnplanner_hook_next(parse,
806+
#ifPG_VERSION_NUM >=130000
807+
query_string,
808+
#endif
809+
cursorOptions,boundParams);
799810

800-
returnstandard_planner(parse,cursorOptions,boundParams);
811+
returnstandard_planner(parse,
812+
#ifPG_VERSION_NUM >=130000
813+
query_string,
814+
#endif
815+
cursorOptions,boundParams);
801816
}
802817

803818
/*

‎run_tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ if [ "$CHECK_CODE" = "clang" ]; then
1919

2020
elif ["$CHECK_CODE"="cppcheck" ];then
2121
cppcheck \
22-
--template"{file} ({line}): {severity} ({id}): {message}" \
22+
--template"{file} ({line}): {severity} ({id}): {message}" \
2323
--enable=warning,portability,performance \
2424
--suppress=redundantAssignment \
2525
--suppress=uselessAssignmentPtrArg \
26-
--suppress=literalWithCharPtrCompare \
26+
--suppress=literalWithCharPtrCompare \
2727
--suppress=incorrectStringBooleanError \
2828
--std=c89*.c*.h2> cppcheck.log
2929

‎sql/queries.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ WITH t as (SELECT sum(0) FROM pg_wait_sampling_history)
99
WITH tas (SELECTsum(0)FROM pg_wait_sampling_profile)
1010
SELECTsum(0)FROM generate_series(1,2), t;
1111

12+
-- Some dummy checks just to be sure that all our functions work and return something.
13+
SELECTcount(*)=1as testFROM pg_wait_sampling_get_current(pg_backend_pid());
14+
SELECTcount(*)>=0as testFROM pg_wait_sampling_get_profile();
15+
SELECTcount(*)>=0as testFROM pg_wait_sampling_get_history();
1216
SELECT pg_wait_sampling_reset_profile();
1317

1418
DROP EXTENSION pg_wait_sampling;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp