-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy path0520-pg_indexing.yml
More file actions
27 lines (24 loc) · 1.38 KB
/
0520-pg_indexing.yml
File metadata and controls
27 lines (24 loc) · 1.38 KB
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
#==============================================================#
# 0520 pg_indexing
#==============================================================#
pg_indexing:
name: pg_indexing
desc: PostgreSQL index creating progress (v12+)
query: |-
SELECT datname, pid, relid::RegClass AS relname,
(CASE WHEN blocks_total > 0 THEN 1.0 * blocks_done / blocks_total ELSE NULL END) AS blocks,
(CASE WHEN tuples_total > 0 THEN 1.0 * tuples_done / tuples_total ELSE NULL END) AS tuples,
(CASE WHEN partitions_total > 0 THEN 1.0 * partitions_done / partitions_total ELSE NULL END) AS partitions,
(CASE WHEN lockers_total > 0 THEN 1.0 * lockers_done / lockers_total ELSE NULL END) AS lockers
FROM pg_stat_progress_create_index pspci;
ttl: 10
min_version: 120000
tags: [ cluster, primary ]
metrics:
- datname: { usage: LABEL ,description: "Name of the database" }
- pid: { usage: LABEL ,description: "Process id of indexing table" }
- relname: { usage: LABEL ,description: "Relation name of indexed table" }
- blocks: { usage: GAUGE ,description: "Percent of blocks been proceeded" }
- tuples: { usage: GAUGE ,description: "Percent of tuples been proceeded" }
- partitions: { usage: GAUGE ,description: "Percent of partitions been proceeded" }
- lockers: { usage: GAUGE ,description: "Percent of lockers been proceeded" }