PG-226: Enable installcheck-world regression.

1) Enabled configure and build with proper flags and environment to make sure that
built server is aligned with pg and ppg package distribution in terms of features
and configurations. Earlier build (configure) was not aligned with pg community standard
configuration that are used for community builds and distribution.

2) Enabled installcheck-world regression test suites of the pg server, to verify
the stability and compatibility of pg server after loading pg_stat_monitor in
server.

3) Change in expected files of error.out and error_1.out for error testacase.

4) Disbaled and removed coverage using coveralls.io, as it was not serving the purpose.

(Note: installcheck-world was failing on pg-14 due to some changes that are done in pg14
or upstream PGSS, and that is causing additional line (Query Identifier) is output of some
of the test cases of installcheck-world so it is not enabled in this commit. Problem with
pg14 server installcheck regression is output of an extra line (Query identifier ****)
in some of the test cases after loading extension PGSM and that causes regression to fail
for server after library load.)
pull/109/head
Naeem Akhter 2021-09-23 03:10:06 +05:00
parent 4a30cccdac
commit f7588532be
8 changed files with 220 additions and 164 deletions

View File

@ -1,68 +0,0 @@
name: coverage-test
on: ["push", "pull_request"]
jobs:
build:
name: coverage-test
runs-on: ubuntu-latest
steps:
- name: Clone postgres repository
uses: actions/checkout@v2
with:
repository: 'postgres/postgres'
ref: 'REL_13_STABLE'
- name: Clone pg_stat_monitor repository
uses: actions/checkout@v2
with:
path: 'src/pg_stat_monitor'
ref: 'master'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt purge postgresql-client-common postgresql-common postgresql postgresql*
sudo apt-get install libreadline6-dev systemtap-sdt-dev zlib1g-dev libssl-dev libpam0g-dev python-dev bison flex libipc-run-perl git lcov -y
sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/
sudo rm -rf /usr/lib/postgresql
sudo rm -rf /usr/include/postgresql
sudo rm -rf /usr/share/postgresql
sudo rm -rf /etc/postgresql
sudo rm -f /usr/bin/pg_config
- name: Create pgsql dir
run: mkdir -p /opt/pgsql
- name: Build postgres
run: |
export PATH="/opt/pgsql/bin:$PATH"
./configure --enable-coverage --enable-tap-tests --prefix=/opt/pgsql
make
make install
- name: Start postgresql cluster
run: |
export PATH="/opt/pgsql/bin:$PATH"
/opt/pgsql/bin/initdb -D /opt/pgsql/data
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile start
- name: Build pg_stat_monitor
run: |
export PATH="/opt/pgsql/bin:$PATH"
sudo cp /opt/pgsql/bin/pg_config /usr/bin
make USE_PGXS=1
make USE_PGXS=1 install
working-directory: src/pg_stat_monitor/
- name: Start pg_stat_monitor_tests & Run code coverage
run: |
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile stop
echo "shared_preload_libraries = 'pg_stat_monitor'" >> /opt/pgsql/data/postgresql.conf
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile start
make installcheck
make coverage-html
lcov --capture --directory . --output-file coverage/lcov.info
pip install cpp-coveralls
export COVERALLS_REPO_TOKEN="${{ secrets.COVERALL_PG_STAT_MONITOR_TOKEN }}"
coveralls --verbose
working-directory: src/pg_stat_monitor/

View File

@ -1,10 +1,10 @@
name: pg11-test name: Test-with-pg11-build
on: [push] on: [push]
jobs: jobs:
build: build:
name: pg11-test name: pg11-test
runs-on: ubuntu-latest runs-on: ubuntu-18.04
steps: steps:
- name: Clone postgres repository - name: Clone postgres repository
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -12,16 +12,13 @@ jobs:
repository: 'postgres/postgres' repository: 'postgres/postgres'
ref: 'REL_11_STABLE' ref: 'REL_11_STABLE'
- name: Clone pg_stat_monitor repository
uses: actions/checkout@v2
with:
path: 'src/pg_stat_monitor'
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt purge postgresql-client-common postgresql-common postgresql postgresql* sudo apt purge postgresql-client-common postgresql-common postgresql postgresql*
sudo apt-get install libreadline6-dev systemtap-sdt-dev zlib1g-dev libssl-dev libpam0g-dev python-dev bison flex libipc-run-perl -y sudo apt-get install libreadline6-dev systemtap-sdt-dev zlib1g-dev libssl-dev libpam0g-dev python-dev bison flex libipc-run-perl -y docbook-xsl docbook-xsl
sudo apt-get install -y libxml2 libxml2-utils libxml2-dev libxslt-dev xsltproc libkrb5-dev libldap2-dev libsystemd-dev gettext tcl-dev libperl-dev
sudo apt-get install -y pkg-config clang-9 llvm-9 llvm-9-dev libselinux1-dev python-dev python3-dev uuid-dev liblz4-dev
sudo rm -rf /var/lib/postgresql/ sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/ sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/ sudo rm -rf /etc/postgresql/
@ -37,34 +34,76 @@ jobs:
- name: Build postgres - name: Build postgres
run: | run: |
export PATH="/opt/pgsql/bin:$PATH" export PATH="/opt/pgsql/bin:$PATH"
./configure --enable-tap-tests --prefix=/opt/pgsql ./configure '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=/usr/include' \
make '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc' \
make install '--localstatedir=/var' '--disable-silent-rules' '--libdir=/usr/lib/x86_64-linux-gnu' \
'runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' \
'--with-icu' '--with-tcl' '--with-perl' '--with-python' '--with-pam' '--with-openssl' \
'--with-libxml' '--with-libxslt' 'PYTHON=/usr/bin/python3' \
'--mandir=/usr/share/postgresql/11/man' '--docdir=/usr/share/doc/postgresql-doc-11' \
'--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/' \
'--datadir=/usr/share/postgresql/11' '--bindir=/usr/lib/postgresql/11/bin' \
'--libdir=/usr/lib/x86_64-linux-gnu/' '--libexecdir=/usr/lib/postgresql/' \
'--includedir=/usr/include/postgresql/' '--with-extra-version= (Ubuntu 11.x.pgdg20.04+1)' \
'--enable-nls' '--enable-thread-safety' '--enable-tap-tests' '--enable-debug' \
'--enable-dtrace' '--disable-rpath' '--with-uuid=e2fs' '--with-gnu-ld' \
'--with-pgport=5432' '--with-system-tzdata=/usr/share/zoneinfo' '--with-llvm' \
'LLVM_CONFIG=/usr/bin/llvm-config-9' 'CLANG=/usr/bin/clang-9' '--with-systemd' \
'--with-selinux' 'MKDIR_P=/bin/mkdir -p' 'PROVE=/usr/bin/prove' 'TAR=/bin/tar' \
'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer' \
'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' '--with-gssapi' '--with-ldap' \
'--with-includes=/usr/include/mit-krb5' '--with-libs=/usr/lib/mit-krb5' \
'--with-libs=/usr/lib/x86_64-linux-gnu/mit-krb5' 'build_alias=x86_64-linux-gnu' \
'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security'
make world
sudo make install-world
- name: Start postgresql cluster - name: Start postgresql cluster
run: | run: |
export PATH="/opt/pgsql/bin:$PATH" /usr/lib/postgresql/11/bin/initdb -D /opt/pgsql/data
/opt/pgsql/bin/initdb -D /opt/pgsql/data /usr/lib/postgresql/11/bin/pg_ctl -D /opt/pgsql/data -l logfile start
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile start
- name: Clone pg_stat_monitor repository
uses: actions/checkout@v2
with:
path: 'src/pg_stat_monitor'
- name: Build pg_stat_monitor - name: Build pg_stat_monitor
run: | run: |
export PATH="/opt/pgsql/bin:$PATH" export PATH="/usr/lib/postgresql/11/bin:$PATH"
sudo cp /opt/pgsql/bin/pg_config /usr/bin sudo cp /usr/lib/postgresql/11/bin/pg_config /usr/bin
make USE_PGXS=1 make USE_PGXS=1
make USE_PGXS=1 install sudo make USE_PGXS=1 install
working-directory: src/pg_stat_monitor/ working-directory: src/pg_stat_monitor/
- name: Load pg_stat_monitor library and Restart Server
run: |
/usr/lib/postgresql/11/bin/pg_ctl -D /opt/pgsql/data -l logfile stop
echo "shared_preload_libraries = 'pg_stat_monitor'" >> /opt/pgsql/data/postgresql.conf
/usr/lib/postgresql/11/bin/pg_ctl -D /opt/pgsql/data -l logfile start
working-directory: src/pg_stat_monitor/
- name: Start Server installcheck-world tests (without TAP)
run: |
make installcheck-world
- name: Report on installcheck-world test suites fail
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: Regressions output files of failed testsuite, and postgresql log
path: |
**/regression.diffs
**/regression.out
src/pg_stat_monitor/logfile
retention-days: 1
- name: Start pg_stat_monitor_tests - name: Start pg_stat_monitor_tests
run: | run: |
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile stop
echo "shared_preload_libraries = 'pg_stat_monitor'" >> /opt/pgsql/data/postgresql.conf
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile start
make installcheck make installcheck
working-directory: src/pg_stat_monitor/ working-directory: src/pg_stat_monitor/
- name: Report on test fail - name: Report on pg_stat_monitor test fail
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
if: ${{ failure() }} if: ${{ failure() }}
with: with:

View File

@ -1,4 +1,4 @@
name: pg12-test name: Test-with-pg12-build
on: [push] on: [push]
jobs: jobs:
@ -12,16 +12,13 @@ jobs:
repository: 'postgres/postgres' repository: 'postgres/postgres'
ref: 'REL_12_STABLE' ref: 'REL_12_STABLE'
- name: Clone pg_stat_monitor repository
uses: actions/checkout@v2
with:
path: 'src/pg_stat_monitor'
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt purge postgresql-client-common postgresql-common postgresql postgresql* sudo apt purge postgresql-client-common postgresql-common postgresql postgresql*
sudo apt-get install libreadline6-dev systemtap-sdt-dev zlib1g-dev libssl-dev libpam0g-dev python-dev bison flex libipc-run-perl -y sudo apt-get install libreadline6-dev systemtap-sdt-dev zlib1g-dev libssl-dev libpam0g-dev python-dev bison flex libipc-run-perl -y docbook-xsl docbook-xsl
sudo apt-get install -y libxml2 libxml2-utils libxml2-dev libxslt-dev xsltproc libkrb5-dev libldap2-dev libsystemd-dev gettext tcl-dev libperl-dev
sudo apt-get install -y pkg-config clang-9 llvm-9 llvm-9-dev libselinux1-dev python-dev python3-dev uuid-dev liblz4-dev
sudo rm -rf /var/lib/postgresql/ sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/ sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/ sudo rm -rf /etc/postgresql/
@ -30,41 +27,77 @@ jobs:
sudo rm -rf /usr/share/postgresql sudo rm -rf /usr/share/postgresql
sudo rm -rf /etc/postgresql sudo rm -rf /etc/postgresql
sudo rm -f /usr/bin/pg_config sudo rm -f /usr/bin/pg_config
- name: Create pgsql dir - name: Create pgsql dir
run: mkdir -p /opt/pgsql run: mkdir -p /opt/pgsql
- name: Build postgres - name: Build postgres
run: | run: |
export PATH="/opt/pgsql/bin:$PATH" export PATH="/opt/pgsql/bin:$PATH"
./configure --enable-tap-tests --prefix=/opt/pgsql ./configure '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=/usr/include' '--mandir=/usr/share/man' \
make '--infodir=/usr/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' \
make install '--libdir=/usr/lib/x86_64-linux-gnu' 'runstatedir=/run' '--disable-maintainer-mode' \
'--disable-dependency-tracking' '--with-icu' '--with-tcl' '--with-perl' '--with-python' \
'--with-pam' '--with-openssl' '--with-libxml' '--with-libxslt' 'PYTHON=/usr/bin/python3' \
'--mandir=/usr/share/postgresql/12/man' '--docdir=/usr/share/doc/postgresql-doc-12' \
'--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/' '--datadir=/usr/share/postgresql/12' \
'--bindir=/usr/lib/postgresql/12/bin' '--libdir=/usr/lib/x86_64-linux-gnu/' '--libexecdir=/usr/lib/postgresql/' \
'--includedir=/usr/include/postgresql/' '--with-extra-version= (Ubuntu 12.x.pgdg20.04+1)' '--enable-nls' \
'--enable-thread-safety' '--enable-tap-tests' '--enable-debug' '--enable-dtrace' '--disable-rpath' \
'--with-uuid=e2fs' '--with-gnu-ld' '--with-pgport=5432' '--with-system-tzdata=/usr/share/zoneinfo' '--with-llvm' \
'LLVM_CONFIG=/usr/bin/llvm-config-9' 'CLANG=/usr/bin/clang-9' '--with-systemd' '--with-selinux' 'MKDIR_P=/bin/mkdir -p' \
'PROVE=/usr/bin/prove' 'TAR=/bin/tar' 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer' \
'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' '--with-gssapi' '--with-ldap' \
'--with-includes=/usr/include/mit-krb5' '--with-libs=/usr/lib/mit-krb5' \
'--with-libs=/usr/lib/x86_64-linux-gnu/mit-krb5' 'build_alias=x86_64-linux-gnu' \
'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security'
make world
sudo make install-world
- name: Start postgresql cluster - name: Start postgresql cluster
run: | run: |
export PATH="/opt/pgsql/bin:$PATH" /usr/lib/postgresql/12/bin/initdb -D /opt/pgsql/data
/opt/pgsql/bin/initdb -D /opt/pgsql/data /usr/lib/postgresql/12/bin/pg_ctl -D /opt/pgsql/data -l logfile start
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile start
- name: Clone pg_stat_monitor repository
uses: actions/checkout@v2
with:
path: 'src/pg_stat_monitor'
- name: Build pg_stat_monitor - name: Build pg_stat_monitor
run: | run: |
export PATH="/opt/pgsql/bin:$PATH" export PATH="/usr/lib/postgresql/12/bin:$PATH"
sudo cp /opt/pgsql/bin/pg_config /usr/bin sudo cp /usr/lib/postgresql/12/bin/pg_config /usr/bin
make USE_PGXS=1 make USE_PGXS=1
make USE_PGXS=1 install sudo make USE_PGXS=1 install
working-directory: src/pg_stat_monitor/ working-directory: src/pg_stat_monitor/
- name: Load pg_stat_monitor library and Restart Server
run: |
/usr/lib/postgresql/12/bin/pg_ctl -D /opt/pgsql/data -l logfile stop
echo "shared_preload_libraries = 'pg_stat_monitor'" >> /opt/pgsql/data/postgresql.conf
/usr/lib/postgresql/12/bin/pg_ctl -D /opt/pgsql/data -l logfile start
working-directory: src/pg_stat_monitor/
- name: Start Server installcheck-world tests (without TAP)
run: |
make installcheck-world
- name: Report on installcheck-world test suites fail
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: Regressions output files of failed testsuite, and postgresql log
path: |
**/regression.diffs
**/regression.out
src/pg_stat_monitor/logfile
retention-days: 1
- name: Start pg_stat_monitor_tests - name: Start pg_stat_monitor_tests
run: | run: |
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile stop
echo "shared_preload_libraries = 'pg_stat_monitor'" >> /opt/pgsql/data/postgresql.conf
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile start
make installcheck make installcheck
working-directory: src/pg_stat_monitor/ working-directory: src/pg_stat_monitor/
- name: Report on test fail - name: Report on pg_stat_monitor test fail
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
if: ${{ failure() }} if: ${{ failure() }}
with: with:

View File

@ -1,4 +1,4 @@
name: pg13-test name: Test-with-pg13-build
on: [push] on: [push]
jobs: jobs:
@ -12,16 +12,13 @@ jobs:
repository: 'postgres/postgres' repository: 'postgres/postgres'
ref: 'REL_13_STABLE' ref: 'REL_13_STABLE'
- name: Clone pg_stat_monitor repository
uses: actions/checkout@v2
with:
path: 'src/pg_stat_monitor'
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt purge postgresql-client-common postgresql-common postgresql postgresql* sudo apt purge postgresql-client-common postgresql-common postgresql postgresql*
sudo apt-get install libreadline6-dev systemtap-sdt-dev zlib1g-dev libssl-dev libpam0g-dev python-dev bison flex libipc-run-perl -y sudo apt-get install libreadline6-dev systemtap-sdt-dev zlib1g-dev libssl-dev libpam0g-dev python-dev bison flex libipc-run-perl -y docbook-xsl docbook-xsl
sudo apt-get install -y libxml2 libxml2-utils libxml2-dev libxslt-dev xsltproc libkrb5-dev libldap2-dev libsystemd-dev gettext tcl-dev libperl-dev
sudo apt-get install -y pkg-config clang-9 llvm-9 llvm-9-dev libselinux1-dev python-dev python3-dev uuid-dev liblz4-dev
sudo rm -rf /var/lib/postgresql/ sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/ sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/ sudo rm -rf /etc/postgresql/
@ -30,41 +27,82 @@ jobs:
sudo rm -rf /usr/share/postgresql sudo rm -rf /usr/share/postgresql
sudo rm -rf /etc/postgresql sudo rm -rf /etc/postgresql
sudo rm -f /usr/bin/pg_config sudo rm -f /usr/bin/pg_config
- name: Create pgsql dir - name: Create pgsql dir
run: mkdir -p /opt/pgsql run: mkdir -p /opt/pgsql
- name: Build postgres - name: Build postgres
run: | run: |
export PATH="/opt/pgsql/bin:$PATH" export PATH="/opt/pgsql/bin:$PATH"
./configure --enable-tap-tests --prefix=/opt/pgsql ./configure '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' \
make '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' \
make install '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' \
'--libdir=${prefix}/lib/x86_64-linux-gnu' \
'--libexecdir=${prefix}/lib/x86_64-linux-gnu' '--disable-maintainer-mode' \
'--disable-dependency-tracking' '--with-icu' '--with-tcl' '--with-perl' \
'--with-python' '--with-pam' '--with-openssl' '--with-libxml' '--with-libxslt' \
'PYTHON=/usr/bin/python3' '--mandir=/usr/share/postgresql/13/man' \
'--docdir=/usr/share/doc/postgresql-doc-13' \
'--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/' \
'--datadir=/usr/share/postgresql/13' '--bindir=/usr/lib/postgresql/13/bin' \
'--libdir=/usr/lib/x86_64-linux-gnu/' '--libexecdir=/usr/lib/postgresql/' \
'--includedir=/usr/include/postgresql/' '--with-extra-version= (Ubuntu 2:13-x.focal)' \
'--enable-nls' '--enable-thread-safety' '--enable-tap-tests' '--enable-debug' \
'--enable-dtrace' '--disable-rpath' '--with-uuid=e2fs' '--with-gnu-ld' \
'--with-pgport=5432' '--with-system-tzdata=/usr/share/zoneinfo' '--with-llvm' \
'LLVM_CONFIG=/usr/bin/llvm-config-11' 'CLANG=/usr/bin/clang-11' \
'--with-systemd' '--with-selinux' 'MKDIR_P=/bin/mkdir -p' 'PROVE=/usr/bin/prove' \
'TAR=/bin/tar' 'XSLTPROC=xsltproc --nonet' 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer' \
'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' '--with-gssapi' '--with-ldap' \
'build_alias=x86_64-linux-gnu' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' \
'CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security'
make world
sudo make install-world
- name: Start postgresql cluster - name: Start postgresql cluster
run: | run: |
export PATH="/opt/pgsql/bin:$PATH" /usr/lib/postgresql/13/bin/initdb -D /opt/pgsql/data
/opt/pgsql/bin/initdb -D /opt/pgsql/data /usr/lib/postgresql/13/bin/pg_ctl -D /opt/pgsql/data -l logfile start
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile start
- name: Clone pg_stat_monitor repository
uses: actions/checkout@v2
with:
path: 'src/pg_stat_monitor'
- name: Build pg_stat_monitor - name: Build pg_stat_monitor
run: | run: |
export PATH="/opt/pgsql/bin:$PATH" export PATH="/usr/lib/postgresql/13/bin:$PATH"
sudo cp /opt/pgsql/bin/pg_config /usr/bin sudo cp /usr/lib/postgresql/13/bin/pg_config /usr/bin
make USE_PGXS=1 make USE_PGXS=1
make USE_PGXS=1 install sudo make USE_PGXS=1 install
working-directory: src/pg_stat_monitor/ working-directory: src/pg_stat_monitor/
- name: Load pg_stat_monitor library and Restart Server
run: |
/usr/lib/postgresql/13/bin/pg_ctl -D /opt/pgsql/data -l logfile stop
echo "shared_preload_libraries = 'pg_stat_monitor'" >> /opt/pgsql/data/postgresql.conf
/usr/lib/postgresql/13/bin/pg_ctl -D /opt/pgsql/data -l logfile start
working-directory: src/pg_stat_monitor/
- name: Start Server installcheck-world tests (without TAP)
run: |
make installcheck-world
- name: Report on installcheck-world test suites fail
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: Regressions output files of failed testsuite, and postgresql log
path: |
**/regression.diffs
**/regression.out
src/pg_stat_monitor/logfile
retention-days: 1
- name: Start pg_stat_monitor_tests - name: Start pg_stat_monitor_tests
run: | run: |
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile stop
echo "shared_preload_libraries = 'pg_stat_monitor'" >> /opt/pgsql/data/postgresql.conf
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile start
make installcheck make installcheck
working-directory: src/pg_stat_monitor/ working-directory: src/pg_stat_monitor/
- name: Report on test fail - name: Report on pg_stat_monitor test fail
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
if: ${{ failure() }} if: ${{ failure() }}
with: with:

View File

@ -1,4 +1,4 @@
name: pg14-test name: Test-with-pg14-build
on: [push] on: [push]
jobs: jobs:
@ -12,16 +12,13 @@ jobs:
repository: 'postgres/postgres' repository: 'postgres/postgres'
ref: 'REL_14_STABLE' ref: 'REL_14_STABLE'
- name: Clone pg_stat_monitor repository
uses: actions/checkout@v2
with:
path: 'src/pg_stat_monitor'
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt purge postgresql-client-common postgresql-common postgresql postgresql* sudo apt purge postgresql-client-common postgresql-common postgresql postgresql*
sudo apt-get install libreadline6-dev systemtap-sdt-dev zlib1g-dev libssl-dev libpam0g-dev python-dev bison flex libipc-run-perl -y sudo apt-get install libreadline6-dev systemtap-sdt-dev zlib1g-dev libssl-dev libpam0g-dev python-dev bison flex libipc-run-perl -y docbook-xsl docbook-xsl
sudo apt-get install -y libxml2 libxml2-utils libxml2-dev libxslt-dev xsltproc libkrb5-dev libldap2-dev libsystemd-dev gettext tcl-dev libperl-dev
sudo apt-get install -y pkg-config clang-9 llvm-9 llvm-9-dev libselinux1-dev python-dev python3-dev uuid-dev liblz4-dev
sudo rm -rf /var/lib/postgresql/ sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/ sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/ sudo rm -rf /etc/postgresql/
@ -30,41 +27,68 @@ jobs:
sudo rm -rf /usr/share/postgresql sudo rm -rf /usr/share/postgresql
sudo rm -rf /etc/postgresql sudo rm -rf /etc/postgresql
sudo rm -f /usr/bin/pg_config sudo rm -f /usr/bin/pg_config
- name: Create pgsql dir - name: Create pgsql dir
run: mkdir -p /opt/pgsql run: mkdir -p /opt/pgsql
- name: Build postgres - name: Build postgres
run: | run: |
export PATH="/opt/pgsql/bin:$PATH" export PATH="/opt/pgsql/bin:$PATH"
./configure --enable-tap-tests --prefix=/opt/pgsql ./configure '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' \
make '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' \
make install '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' \
'--libdir=${prefix}/lib/x86_64-linux-gnu' \
'--libexecdir=${prefix}/lib/x86_64-linux-gnu' '--disable-maintainer-mode' \
'--disable-dependency-tracking' '--with-icu' '--with-tcl' '--with-perl' \
'--with-python' '--with-pam' '--with-openssl' '--with-libxml' '--with-libxslt' \
'PYTHON=/usr/bin/python3' '--mandir=/usr/share/postgresql/14/man' \
'--docdir=/usr/share/doc/postgresql-doc-14' \
'--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/' \
'--datadir=/usr/share/postgresql/14' '--bindir=/usr/lib/postgresql/14/bin' \
'--libdir=/usr/lib/x86_64-linux-gnu/' '--libexecdir=/usr/lib/postgresql/' \
'--includedir=/usr/include/postgresql/' '--with-extra-version= (Ubuntu 2:14-x.focal)' \
'--enable-nls' '--enable-thread-safety' '--enable-tap-tests' '--enable-debug' \
'--enable-dtrace' '--disable-rpath' '--with-uuid=e2fs' '--with-gnu-ld' \
'--with-pgport=5432' '--with-system-tzdata=/usr/share/zoneinfo' '--with-llvm' \
'LLVM_CONFIG=/usr/bin/llvm-config-11' 'CLANG=/usr/bin/clang-11' \
'--with-systemd' '--with-selinux' 'MKDIR_P=/bin/mkdir -p' 'PROVE=/usr/bin/prove' \
'TAR=/bin/tar' 'XSLTPROC=xsltproc --nonet' 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer' \
'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' '--with-gssapi' '--with-ldap' \
'build_alias=x86_64-linux-gnu' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' \
'CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security'
make world
sudo make install-world
- name: Start postgresql cluster - name: Start postgresql cluster
run: | run: |
export PATH="/opt/pgsql/bin:$PATH" /usr/lib/postgresql/14/bin/initdb -D /opt/pgsql/data
/opt/pgsql/bin/initdb -D /opt/pgsql/data /usr/lib/postgresql/14/bin/pg_ctl -D /opt/pgsql/data -l logfile start
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile start
- name: Clone pg_stat_monitor repository
uses: actions/checkout@v2
with:
path: 'src/pg_stat_monitor'
- name: Build pg_stat_monitor - name: Build pg_stat_monitor
run: | run: |
export PATH="/opt/pgsql/bin:$PATH" export PATH="/usr/lib/postgresql/14/bin:$PATH"
sudo cp /opt/pgsql/bin/pg_config /usr/bin sudo cp /usr/lib/postgresql/14/bin/pg_config /usr/bin
make USE_PGXS=1 make USE_PGXS=1
make USE_PGXS=1 install sudo make USE_PGXS=1 install
working-directory: src/pg_stat_monitor/ working-directory: src/pg_stat_monitor/
- name: Load pg_stat_monitor library and Restart Server
run: |
/usr/lib/postgresql/14/bin/pg_ctl -D /opt/pgsql/data -l logfile stop
echo "shared_preload_libraries = 'pg_stat_monitor'" >> /opt/pgsql/data/postgresql.conf
/usr/lib/postgresql/14/bin/pg_ctl -D /opt/pgsql/data -l logfile start
working-directory: src/pg_stat_monitor/
- name: Start pg_stat_monitor_tests - name: Start pg_stat_monitor_tests
run: | run: |
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile stop
echo "shared_preload_libraries = 'pg_stat_monitor'" >> /opt/pgsql/data/postgresql.conf
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile start
make installcheck make installcheck
working-directory: src/pg_stat_monitor/ working-directory: src/pg_stat_monitor/
- name: Report on test fail - name: Report on pg_stat_monitor test fail
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
if: ${{ failure() }} if: ${{ failure() }}
with: with:

View File

@ -3,8 +3,6 @@
![pg13-test](https://github.com/percona/pg_stat_monitor/workflows/pg13-test/badge.svg) ![pg13-test](https://github.com/percona/pg_stat_monitor/workflows/pg13-test/badge.svg)
![pg14-test](https://github.com/percona/pg_stat_monitor/workflows/pg14-test/badge.svg) ![pg14-test](https://github.com/percona/pg_stat_monitor/workflows/pg14-test/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/percona/pg_stat_monitor/badge.svg)](https://coveralls.io/github/percona/pg_stat_monitor)
## What is pg_stat_monitor? ## What is pg_stat_monitor?
**pg_stat_monitor** is a **Query Performance Monitoring** tool for [Percona Distribution for PostgreSQL](https://www.percona.com/software/postgresql-distribution) and PostgreSQL. **pg_stat_monitor** is based on PostgreSQL's contrib module ``pg_stat_statements``. ``pg_stat_statements`` provides the basic statistics, which is sometimes not enough. The major shortcoming in ``pg_stat_statements`` is that it accumulates all the queries and their statistics and does not provide aggregated statistics nor histogram information. In this case, a user would need to calculate the aggregates, which is quite an expensive operation. **pg_stat_monitor** is a **Query Performance Monitoring** tool for [Percona Distribution for PostgreSQL](https://www.percona.com/software/postgresql-distribution) and PostgreSQL. **pg_stat_monitor** is based on PostgreSQL's contrib module ``pg_stat_statements``. ``pg_stat_statements`` provides the basic statistics, which is sometimes not enough. The major shortcoming in ``pg_stat_statements`` is that it accumulates all the queries and their statistics and does not provide aggregated statistics nor histogram information. In this case, a user would need to calculate the aggregates, which is quite an expensive operation.

View File

@ -28,15 +28,11 @@ SELECT query, elevel, sqlcode, message FROM pg_stat_monitor ORDER BY query COLLA
SELECT 1/0; | 20 | 22012 | division by zero SELECT 1/0; | 20 | 22012 | division by zero
SELECT pg_stat_monitor_reset(); | 0 | | SELECT pg_stat_monitor_reset(); | 0 | |
SELECT query, elevel, sqlcode, message FROM pg_stat_monitor ORDER BY query COLLATE "C",elevel; | 0 | | SELECT query, elevel, sqlcode, message FROM pg_stat_monitor ORDER BY query COLLATE "C",elevel; | 0 | |
do $$ +| 0 | |
BEGIN +| | |
RAISE WARNING 'warning message'; +| | |
END $$; | | |
do $$ +| 19 | 01000 | warning message do $$ +| 19 | 01000 | warning message
BEGIN +| | | BEGIN +| | |
RAISE WARNING 'warning message'; +| | | RAISE WARNING 'warning message'; +| | |
END $$; | | | END $$; | | |
(7 rows) (6 rows)
SELECT pg_stat_monitor_reset(); SELECT pg_stat_monitor_reset();
pg_stat_monitor_reset pg_stat_monitor_reset

View File

@ -28,15 +28,11 @@ SELECT query, elevel, sqlcode, message FROM pg_stat_monitor ORDER BY query COLLA
SELECT 1/0; | 21 | 22012 | division by zero SELECT 1/0; | 21 | 22012 | division by zero
SELECT pg_stat_monitor_reset(); | 0 | | SELECT pg_stat_monitor_reset(); | 0 | |
SELECT query, elevel, sqlcode, message FROM pg_stat_monitor ORDER BY query COLLATE "C",elevel; | 0 | | SELECT query, elevel, sqlcode, message FROM pg_stat_monitor ORDER BY query COLLATE "C",elevel; | 0 | |
do $$ +| 0 | |
BEGIN +| | |
RAISE WARNING 'warning message'; +| | |
END $$; | | |
do $$ +| 19 | 01000 | warning message do $$ +| 19 | 01000 | warning message
BEGIN +| | | BEGIN +| | |
RAISE WARNING 'warning message'; +| | | RAISE WARNING 'warning message'; +| | |
END $$; | | | END $$; | | |
(7 rows) (6 rows)
SELECT pg_stat_monitor_reset(); SELECT pg_stat_monitor_reset();
pg_stat_monitor_reset pg_stat_monitor_reset