-
Notifications
You must be signed in to change notification settings - Fork 3
/
pg_comment_stats--1.0.sql
72 lines (67 loc) · 3.04 KB
/
pg_comment_stats--1.0.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
CREATE FUNCTION pgcs_get_stats(
OUT comment_keys jsonb,
OUT query_count integer,
OUT userid oid,
OUT dbid oid,
OUT reads bigint, /* total reads, in bytes */
OUT writes bigint, /* total writes, in bytes */
OUT user_time double precision, /* total user CPU time used */
OUT system_time double precision, /* total system CPU time used */
OUT minflts bigint, /* total page reclaims (soft page faults) */
OUT majflts bigint, /* total page faults (hard page faults) */
OUT nswaps bigint, /* total swaps */
OUT msgsnds bigint, /* total IPC messages sent */
OUT msgrcvs bigint, /* total IPC messages received */
OUT nsignals bigint, /* total signals received */
OUT nvcsws bigint, /* total voluntary context switches */
OUT nivcsws bigint /* total involuntary context switches */
)
RETURNS SETOF record
AS 'MODULE_PATHNAME', 'pgcs_get_stats'
LANGUAGE C STRICT;
CREATE FUNCTION pgcs_get_stats_time_interval(
start_ts timestamptz,
stop_ts timestamptz,
OUT comment_keys jsonb,
OUT query_count integer,
OUT userid oid,
OUT dbid oid,
OUT reads bigint, /* total reads, in bytes */
OUT writes bigint, /* total writes, in bytes */
OUT user_time double precision, /* total user CPU time used */
OUT system_time double precision, /* total system CPU time used */
OUT minflts bigint, /* total page reclaims (soft page faults) */
OUT majflts bigint, /* total page faults (hard page faults) */
OUT nswaps bigint, /* total swaps */
OUT msgsnds bigint, /* total IPC messages sent */
OUT msgrcvs bigint, /* total IPC messages received */
OUT nsignals bigint, /* total signals received */
OUT nvcsws bigint, /* total voluntary context switches */
OUT nivcsws bigint /* total involuntary context switches */
)
RETURNS SETOF record
AS 'MODULE_PATHNAME', 'pgcs_get_stats_time_interval'
LANGUAGE C STRICT;
CREATE FUNCTION pgcs_exclude_key(
exclude_string cstring
)
RETURNS void
AS 'MODULE_PATHNAME', 'pgcs_exclude_key'
LANGUAGE C STRICT;
CREATE FUNCTION pgcs_get_excluded_keys(
OUT excluded_key text
)
RETURNS SETOF text
AS 'MODULE_PATHNAME', 'pgcs_get_excluded_keys'
LANGUAGE C STRICT;
CREATE FUNCTION pgcs_reset_excluded_keys()
RETURNS void
AS 'MODULE_PATHNAME', 'pgcs_reset_excluded_keys'
LANGUAGE C STRICT;
CREATE FUNCTION pgcs_get_buffer_stats(
OUT saved_strings_count integer,
OUT available_strings_count integer
)
RETURNS SETOF record
AS 'MODULE_PATHNAME', 'pgcs_get_buffer_stats'
LANGUAGE C STRICT;