Skip to content

Commit d8363f3

Browse files
copyright
Signed-off-by: Peter Nuttall <[email protected]>
1 parent a85873b commit d8363f3

File tree

3 files changed

+40
-27
lines changed

3 files changed

+40
-27
lines changed

collector/pg_locks.go

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -49,39 +49,39 @@ var (
4949
)
5050

5151
pgLocksQuery = `
52-
SELECT
52+
SELECT
5353
pg_database.datname as datname,
5454
tmp.mode as mode,
55-
COALESCE(count, 0) as count
56-
FROM
55+
COALESCE(count, 0) as count
56+
FROM
5757
(
58-
VALUES
59-
('accesssharelock'),
60-
('rowsharelock'),
61-
('rowexclusivelock'),
62-
('shareupdateexclusivelock'),
63-
('sharelock'),
64-
('sharerowexclusivelock'),
65-
('exclusivelock'),
66-
('accessexclusivelock'),
58+
VALUES
59+
('accesssharelock'),
60+
('rowsharelock'),
61+
('rowexclusivelock'),
62+
('shareupdateexclusivelock'),
63+
('sharelock'),
64+
('sharerowexclusivelock'),
65+
('exclusivelock'),
66+
('accessexclusivelock'),
6767
('sireadlock')
6868
) AS tmp(mode)
69-
CROSS JOIN pg_database
69+
CROSS JOIN pg_database
7070
LEFT JOIN (
71-
SELECT
72-
database,
73-
lower(mode) AS mode,
74-
count(*) AS count
75-
FROM
76-
pg_locks
77-
WHERE
78-
database IS NOT NULL
79-
GROUP BY
80-
database,
71+
SELECT
72+
database,
73+
lower(mode) AS mode,
74+
count(*) AS count
75+
FROM
76+
pg_locks
77+
WHERE
78+
database IS NOT NULL
79+
GROUP BY
80+
database,
8181
lower(mode)
82-
) AS tmp2 ON tmp.mode = tmp2.mode
83-
and pg_database.oid = tmp2.database
84-
ORDER BY
82+
) AS tmp2 ON tmp.mode = tmp2.mode
83+
and pg_database.oid = tmp2.database
84+
ORDER BY
8585
1
8686
`
8787
)

collector/pg_proctab.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
// Copyright 2025 The Prometheus Authors
2+
// Licensed under the Apache License, Version 2.0 (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
//
6+
// http://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
114
package collector
215

316
import (

collector/pg_proctab_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 The Prometheus Authors
1+
// Copyright 2025 The Prometheus Authors
22
// Licensed under the Apache License, Version 2.0 (the "License");
33
// you may not use this file except in compliance with the License.
44
// You may obtain a copy of the License at

0 commit comments

Comments
 (0)