Skip to content
This repository was archived by the owner on Jul 6, 2021. It is now read-only.

Commit b15899e

Browse files
committed
Merge branch 'typo-1' into 'master'
English grammar fix See merge request postgres-ai/postgres-checkup!455
2 parents eea20ff + ae2d9b8 commit b15899e

14 files changed

+55
-55
lines changed

pghrep/src/checkup/f002/f002_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func TestF002CheckTables(t *testing.T) {
106106
RelRelfrozenxid: "",
107107
ToastRelfrozenxid: "",
108108
Warning: 0,
109-
OverridedSettings: false,
109+
OverriddenSettings: false,
110110
},
111111
"table_2": F002Table{
112112
Num: 1,
@@ -116,7 +116,7 @@ func TestF002CheckTables(t *testing.T) {
116116
RelRelfrozenxid: "",
117117
ToastRelfrozenxid: "",
118118
Warning: 0,
119-
OverridedSettings: false,
119+
OverriddenSettings: false,
120120
},
121121
}
122122
report.Results = F002ReportHostsResults{"test-host": hostResult}
@@ -161,7 +161,7 @@ func TestF002CheckDatabaseTables(t *testing.T) {
161161
RelRelfrozenxid: "",
162162
ToastRelfrozenxid: "",
163163
Warning: 0,
164-
OverridedSettings: false,
164+
OverriddenSettings: false,
165165
},
166166
"table_2": F002Table{
167167
Num: 1,
@@ -171,7 +171,7 @@ func TestF002CheckDatabaseTables(t *testing.T) {
171171
RelRelfrozenxid: "",
172172
ToastRelfrozenxid: "",
173173
Warning: 0,
174-
OverridedSettings: false,
174+
OverriddenSettings: false,
175175
},
176176
}
177177

pghrep/src/checkup/f002/f002struct.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type F002Table struct {
2121
RelRelfrozenxid string `json:"rel_relfrozenxid"`
2222
ToastRelfrozenxid string `json:"toast_relfrozenxid"`
2323
Warning int `json:"warning"`
24-
OverridedSettings bool `json:"overrided_settings"`
24+
OverriddenSettings bool `json:"overridden_settings"`
2525
}
2626

2727
type F002ReportHostResultData struct {

pghrep/src/checkup/f004/f004_test.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestF004Success(t *testing.T) {
3434
LiveDataSizeBytes: 0,
3535
LastVaccuum: "",
3636
Fillfactor: 100.0,
37-
OverridedSettings: false,
37+
OverriddenSettings: false,
3838
BloatRatioFactor: 1.0,
3939
},
4040
"table_2": F004HeapBloat{
@@ -49,7 +49,7 @@ func TestF004Success(t *testing.T) {
4949
LiveDataSizeBytes: 0,
5050
LastVaccuum: "",
5151
Fillfactor: 100.0,
52-
OverridedSettings: false,
52+
OverriddenSettings: false,
5353
BloatRatioFactor: 1.0,
5454
},
5555
}
@@ -119,7 +119,7 @@ func TestF004Warnig(t *testing.T) {
119119
LiveDataSizeBytes: 50937856,
120120
LastVaccuum: "",
121121
Fillfactor: 100.0,
122-
OverridedSettings: false,
122+
OverriddenSettings: false,
123123
BloatRatioFactor: 7.684142811193309,
124124
},
125125
"table_2": F004HeapBloat{
@@ -134,7 +134,7 @@ func TestF004Warnig(t *testing.T) {
134134
LiveDataSizeBytes: 2678784,
135135
LastVaccuum: "",
136136
Fillfactor: 100.0,
137-
OverridedSettings: false,
137+
OverriddenSettings: false,
138138
BloatRatioFactor: 2.46177370030581,
139139
},
140140
"table_3": F004HeapBloat{
@@ -149,7 +149,7 @@ func TestF004Warnig(t *testing.T) {
149149
LiveDataSizeBytes: 2678784,
150150
LastVaccuum: "",
151151
Fillfactor: 100.0,
152-
OverridedSettings: false,
152+
OverriddenSettings: false,
153153
BloatRatioFactor: 2.46177370030581,
154154
},
155155
"table_4": F004HeapBloat{
@@ -164,7 +164,7 @@ func TestF004Warnig(t *testing.T) {
164164
LiveDataSizeBytes: 2678784,
165165
LastVaccuum: "",
166166
Fillfactor: 100.0,
167-
OverridedSettings: false,
167+
OverriddenSettings: false,
168168
BloatRatioFactor: 2.46177370030581,
169169
},
170170
"table_5": F004HeapBloat{
@@ -179,7 +179,7 @@ func TestF004Warnig(t *testing.T) {
179179
LiveDataSizeBytes: 2678784,
180180
LastVaccuum: "",
181181
Fillfactor: 100.0,
182-
OverridedSettings: false,
182+
OverriddenSettings: false,
183183
BloatRatioFactor: 2.46177370030581,
184184
},
185185
"table_6": F004HeapBloat{
@@ -194,7 +194,7 @@ func TestF004Warnig(t *testing.T) {
194194
LiveDataSizeBytes: 2678784,
195195
LastVaccuum: "",
196196
Fillfactor: 100.0,
197-
OverridedSettings: false,
197+
OverriddenSettings: false,
198198
BloatRatioFactor: 2.46177370030581,
199199
},
200200
}
@@ -236,7 +236,7 @@ func TestF004Critical(t *testing.T) {
236236
LiveDataSizeBytes: 50937856,
237237
LastVaccuum: "",
238238
Fillfactor: 100.0,
239-
OverridedSettings: false,
239+
OverriddenSettings: false,
240240
BloatRatioFactor: 7.684142811193309,
241241
},
242242
"table_2": F004HeapBloat{
@@ -251,7 +251,7 @@ func TestF004Critical(t *testing.T) {
251251
LiveDataSizeBytes: 2678784,
252252
LastVaccuum: "",
253253
Fillfactor: 100.0,
254-
OverridedSettings: false,
254+
OverriddenSettings: false,
255255
BloatRatioFactor: 2.46177370030581,
256256
},
257257
}

pghrep/src/checkup/f004/f004struct.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type F004HeapBloat struct {
1616
LiveDataSizeBytes int64 `json:"live_data_size_bytes"`
1717
LastVaccuum string `json:"last_vaccuum"`
1818
Fillfactor float32 `json:"fillfactor"`
19-
OverridedSettings bool `json:"overrided_settings"`
19+
OverriddenSettings bool `json:"overridden_settings"`
2020
BloatRatioFactor float32 `json:"bloat_ratio_factor"`
2121
}
2222

@@ -34,7 +34,7 @@ type F004HeapBloatTotal struct {
3434
type F004ReportHostResultData struct {
3535
HeapBloat map[string]F004HeapBloat `json:"heap_bloat"`
3636
HeapBloatTotal F004HeapBloatTotal `json:"heap_bloat_total"`
37-
OverridedSettingsCount int `json:"overrided_settings_count"`
37+
OverriddenSettingsCount int `json:"overridden_settings_count"`
3838
DatabaseSizeBytes int64 `json:"database_size_bytes"`
3939
}
4040

pghrep/src/checkup/f005/f005_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func TestF005Success(t *testing.T) {
3535
LiveDataSizeBytes: 0,
3636
LastVaccuum: "",
3737
Fillfactor: 100.0,
38-
OverridedSettings: false,
38+
OverriddenSettings: false,
3939
BloatRatioFactor: 1.0,
4040
},
4141
"index_2": F005IndexBloat{
@@ -51,7 +51,7 @@ func TestF005Success(t *testing.T) {
5151
LiveDataSizeBytes: 0,
5252
LastVaccuum: "",
5353
Fillfactor: 100.0,
54-
OverridedSettings: false,
54+
OverriddenSettings: false,
5555
BloatRatioFactor: 1.0,
5656
},
5757
}
@@ -120,7 +120,7 @@ func TestF005Warnig(t *testing.T) {
120120
LiveDataSizeBytes: 50937856,
121121
LastVaccuum: "",
122122
Fillfactor: 100.0,
123-
OverridedSettings: false,
123+
OverriddenSettings: false,
124124
BloatRatioFactor: 7.684142811193309,
125125
},
126126
"index_2": F005IndexBloat{
@@ -136,7 +136,7 @@ func TestF005Warnig(t *testing.T) {
136136
LiveDataSizeBytes: 2678784,
137137
LastVaccuum: "",
138138
Fillfactor: 100.0,
139-
OverridedSettings: false,
139+
OverriddenSettings: false,
140140
BloatRatioFactor: 2.46177370030581,
141141
},
142142
}
@@ -180,7 +180,7 @@ func TestF005Critical(t *testing.T) {
180180
LiveDataSizeBytes: 50937856,
181181
LastVaccuum: "",
182182
Fillfactor: 100.0,
183-
OverridedSettings: false,
183+
OverriddenSettings: false,
184184
BloatRatioFactor: 7.684142811193309,
185185
},
186186
"index_2": F005IndexBloat{
@@ -196,7 +196,7 @@ func TestF005Critical(t *testing.T) {
196196
LiveDataSizeBytes: 2678784,
197197
LastVaccuum: "",
198198
Fillfactor: 100.0,
199-
OverridedSettings: false,
199+
OverriddenSettings: false,
200200
BloatRatioFactor: 2.46177370030581,
201201
},
202202
}

pghrep/src/checkup/f005/f005struct.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type F005IndexBloat struct {
2121
LiveDataSizeBytes int64 `json:"live_data_size_bytes"`
2222
LastVaccuum string `json:"last_vaccuum"`
2323
Fillfactor float32 `json:"fillfactor"`
24-
OverridedSettings bool `json:"overrided_settings"`
24+
OverriddenSettings bool `json:"overridden_settings"`
2525
TableSizeBytes int64 `json:"table_size_bytes"`
2626
}
2727

@@ -40,7 +40,7 @@ type F005IndexBloatTotal struct {
4040
type F005ReportHostResultData struct {
4141
IndexBloat map[string]F005IndexBloat `json:"Index_bloat"`
4242
IndexBloatTotal F005IndexBloatTotal `json:"Index_bloat_total"`
43-
OverridedSettingsCount int `json:"overrided_settings_count"`
43+
OverriddenSettingsCount int `json:"overridden_settings_count"`
4444
DatabaseSizeBytes int64 `json:"database_size_bytes"`
4545
}
4646

pghrep/templates/F002.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
{{ range $i, $key := (index (index (index (index .results .hosts.master) "data") "per_database") "_keys") }}
3636
{{- if lt $i $TABLE_LIST_LIMIT -}}
3737
{{- $value := (index (index (index (index $.results $.hosts.master) "data") "per_database") $key) -}}
38-
| {{ $value.num }} |`{{ index $value "relation"}}`{{if $value.overrided_settings}}\*{{ end }} |
38+
| {{ $value.num }} |`{{ index $value "relation"}}`{{if $value.overridden_settings}}\*{{ end }} |
3939
{{- NumFormat (index $value "age") -1 }} |
4040
{{- index $value "capacity_used"}} |
4141
{{- if (index $value "warning") }} ⚠ {{ else }} {{ end }} |
@@ -44,7 +44,7 @@
4444
{{/* if limit list */}}{{ end -}}
4545
{{ end }}{{/* range */}}
4646
{{/*- end -*/}}{{/* if per_instance exists */}}
47-
{{- if gt (Int (index (index (index .results .hosts.master) "data") "overrided_settings_count")) 0 }}
47+
{{- if gt (Int (index (index (index .results .hosts.master) "data") "overridden_settings_count")) 0 }}
4848
\* This table has specific autovacuum settings. See 'F001 Autovacuum: Current settings'
4949
{{- end }}
5050
{{- else -}}{{/*Master data*/}}

pghrep/templates/F003.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Stats reset: {{ (index (index (index .results .hosts.master) "data") "database_s
1616
{{ range $i, $key := (index (index (index (index .results .hosts.master) "data") "dead_tuples") "_keys") }}
1717
{{- if lt $i $.LISTLIMIT }}
1818
{{- $value := (index (index (index (index $.results $.hosts.master) "data") "dead_tuples") $key) -}}
19-
| {{ $value.num }} |`{{ index $value "relation"}}`{{if $value.overrided_settings}}\*{{ end }} |
19+
| {{ $value.num }} |`{{ index $value "relation"}}`{{if $value.overridden_settings}}\*{{ end }} |
2020
{{- index $value "relkind"}} |
2121
{{- index $value "since_last_autovacuum"}} |
2222
{{- index $value "since_last_vacuum"}} |
@@ -31,7 +31,7 @@ Stats reset: {{ (index (index (index .results .hosts.master) "data") "database_s
3131
{{- if ge (Int (index $value "dead_ratio")) 10 }} **{{ (index $value "dead_ratio")}}** {{else}} {{ (index $value "dead_ratio")}} {{end}} |
3232
{{/* if limit list */}}{{ end -}}
3333
{{ end }}
34-
{{- if gt (Int (index (index (index .results .hosts.master) "data") "overrided_settings_count")) 0 }}
34+
{{- if gt (Int (index (index (index .results .hosts.master) "data") "overridden_settings_count")) 0 }}
3535
\* This table has specific autovacuum settings. See 'F001 Autovacuum: Current settings'
3636
{{- end }}
3737
{{- else -}}{{/* dead_tuples */}}

pghrep/templates/F004.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Current database: {{ .database }}
2525
{{ range $i, $key := (index (index (index (index .results .hosts.master) "data") "heap_bloat") "_keys") }}
2626
{{- if lt $i $.LISTLIMIT -}}
2727
{{- $value := (index (index (index (index $.results $.hosts.master) "data") "heap_bloat") $key ) -}}
28-
|{{ $value.num }} |`{{- $key }}`{{if $value.overrided_settings}}\*{{ end }} |
28+
|{{ $value.num }} |`{{- $key }}`{{if $value.overridden_settings}}\*{{ end }} |
2929
{{- ByteFormat ( index $value "real_size_bytes" ) 2 }} |
3030
{{- if ( index $value "bloat_size_bytes")}}{{ ByteFormat ( index $value "bloat_size_bytes") 2 }}{{end}} |
3131
{{- if ( index $value "bloat_size_bytes")}}{{ RawIntFormat ( index $value "bloat_size_bytes") }}{{end}} |
@@ -37,7 +37,7 @@ Current database: {{ .database }}
3737
{{/* if limit list */}}{{ end -}}
3838
{{ end }}{{/*range*/}}
3939

40-
{{- if gt (Int (index (index (index .results .hosts.master) "data") "overrided_settings_count")) 0 }}
40+
{{- if gt (Int (index (index (index .results .hosts.master) "data") "overridden_settings_count")) 0 }}
4141
\* This table has specific autovacuum settings. See 'F001 Autovacuum: Current settings'
4242
{{- end }}
4343
{{- else }}{{/* if heap_bloat */}}

pghrep/templates/F005.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Current database: {{ .database }}
2727
{{ range $i, $key := (index (index (index (index .results .hosts.master) "data") "index_bloat") "_keys") }}
2828
{{- if lt $i $.LISTLIMIT -}}
2929
{{- $value := (index (index (index (index $.results $.hosts.master) "data") "index_bloat") $key) -}}
30-
|{{ $value.num }} | `{{ $value.index_name }}` (`{{ $value.table_name }}`{{if $value.overrided_settings}}\*{{ end }}) |
30+
|{{ $value.num }} | `{{ $value.index_name }}` (`{{ $value.table_name }}`{{if $value.overridden_settings}}\*{{ end }}) |
3131
{{- ByteFormat ( index $value "real_size_bytes") 2 }} |
3232
{{- ByteFormat ( index $value "table_size_bytes") 2 }} |
3333
{{- if ( index $value "bloat_size_bytes")}}{{ ByteFormat ( index $value "bloat_size_bytes") 2 }}{{end}} |
@@ -38,7 +38,7 @@ Current database: {{ .database }}
3838
{{- ( index $value "fillfactor") }} |
3939
{{/* if limit list */}}{{ end -}}
4040
{{ end }}
41-
{{- if gt (Int (index (index (index .results .hosts.master) "data") "overrided_settings_count")) 0 }}
41+
{{- if gt (Int (index (index (index .results .hosts.master) "data") "overridden_settings_count")) 0 }}
4242
\* This table has specific autovacuum settings. See 'F001 Autovacuum: Current settings'
4343
{{- end }}
4444
{{- else -}}{{/*Index bloat*/}}

resources/checks/F002_autovacuum_wraparound.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# how close to wraparound
22

33
${CHECK_HOST_CMD} "${_PSQL} -f - " <<SQL
4-
with overrided_tables as (
4+
with overridden_tables as (
55
select
66
pc.oid as table_id,
77
pn.nspname as scheme_name,
@@ -41,11 +41,11 @@ with overrided_tables as (
4141
c.relfrozenxid as rel_relfrozenxid,
4242
t.relfrozenxid as toast_relfrozenxid,
4343
(greatest(age(c.relfrozenxid), age(t.relfrozenxid)) > 1200000000)::int as warning,
44-
case when ot.table_id is not null then true else false end as overrided_settings
44+
case when ot.table_id is not null then true else false end as overridden_settings
4545
from pg_class c
4646
join pg_namespace n on c.relnamespace = n.oid
4747
left join pg_class t ON c.reltoastrelid = t.oid
48-
left join overrided_tables ot on ot.table_id = c.oid
48+
left join overridden_tables ot on ot.table_id = c.oid
4949
where c.relkind IN ('r', 'm') and not (n.nspname = 'pg_catalog' and c.relname <> 'pg_class')
5050
and n.nspname <> 'information_schema'
5151
order by 3 desc
@@ -61,7 +61,7 @@ select
6161
(select json_object_agg(i.datname, i) from num_per_instance i),
6262
'per_database',
6363
(select json_object_agg(d.relation, d) from num_per_database d),
64-
'overrided_settings_count',
65-
(select count(1) from per_database where overrided_settings = true)
64+
'overridden_settings_count',
65+
(select count(1) from per_database where overridden_settings = true)
6666
);
6767
SQL

resources/checks/F003_autovacuum_dead_tuples.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Collect autovacuum dead tuples
22

33
${CHECK_HOST_CMD} "${_PSQL} -f - " <<SQL
4-
with overrided_tables as (
4+
with overridden_tables as (
55
select
66
pc.oid as table_id,
77
pn.nspname as scheme_name,
@@ -25,10 +25,10 @@ with overrided_tables as (
2525
n_live_tup,
2626
n_dead_tup,
2727
round((n_dead_tup::numeric * 100 / nullif(n_dead_tup + n_live_tup, 0))::numeric, 2) as dead_ratio,
28-
case when ot.table_id is not null then true else false end as overrided_settings
28+
case when ot.table_id is not null then true else false end as overridden_settings
2929
from pg_stat_all_tables
3030
join pg_class c on c.oid = relid
31-
left join overrided_tables ot on ot.table_id = c.oid
31+
left join overridden_tables ot on ot.table_id = c.oid
3232
where reltuples > 10000
3333
order by 13 desc
3434
), num_dead_tuples as (
@@ -58,7 +58,7 @@ select
5858
(select * from dead_tuples),
5959
'database_stat',
6060
(select * from database_stat),
61-
'overrided_settings_count',
62-
(select count(1) from data where overrided_settings = true)
61+
'overridden_settings_count',
62+
(select count(1) from data where overridden_settings = true)
6363
);
6464
SQL

0 commit comments

Comments
 (0)