Skip to content

Commit

Permalink
Issue (#30) - Code refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrarahmad committed Apr 15, 2020
1 parent c9de79b commit beca034
Show file tree
Hide file tree
Showing 7 changed files with 777 additions and 309 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# contrib/pg_stat_monitor/Makefile

MODULE_big = pg_stat_monitor
OBJS = pg_stat_monitor.o $(WIN32RES)
OBJS = guc.o pg_stat_monitor.o $(WIN32RES)

EXTENSION = pg_stat_monitor
DATA = pg_stat_monitor--1.0.sql
Expand All @@ -11,7 +11,7 @@ PGFILEDESC = "pg_stat_monitor - execution statistics of SQL statements"
LDFLAGS_SL += $(filter -lm, $(LIBS))

REGRESS_OPTS = --temp-config $(top_srcdir)/contrib/pg_stat_monitor/pg_stat_monitor.conf
REGRESS = pg_stat_monitor
REGRESS = basic pg_stat_monitor

# Disabled because these tests require "shared_preload_libraries=pg_stat_statements",
# which typical installcheck users do not have (e.g. buildfarm clients).
Expand Down
34 changes: 34 additions & 0 deletions expected/basic.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
CREATE EXTENSION pg_stat_monitor;
SELECT pg_stat_monitor_reset();
pg_stat_monitor_reset
-----------------------

(1 row)

select pg_sleep(.5);
pg_sleep
----------

(1 row)

SELECT 1;
?column?
----------
1
(1 row)

SELECT bucket, query FROM pg_stat_monitor ORDER BY query;
bucket | query
--------+--------------------------------
1 | SELECT $1
1 | SELECT pg_stat_monitor_reset()
1 | select pg_sleep($1)
(3 rows)

SELECT pg_stat_monitor_reset();
pg_stat_monitor_reset
-----------------------

(1 row)

DROP EXTENSION pg_stat_monitor;
Loading

0 comments on commit beca034

Please sign in to comment.