-
Notifications
You must be signed in to change notification settings - Fork 673
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multi tenant statistics monitoring
- Loading branch information
1 parent
dcee370
commit 46e0089
Showing
32 changed files
with
1,414 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/backend/distributed/sql/udfs/citus_stats_tenants/11.3-1.sql
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
src/backend/distributed/sql/udfs/citus_stats_tenants/latest.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
CREATE OR REPLACE FUNCTION pg_catalog.citus_stats_tenants( | ||
return_all_tenants BOOLEAN DEFAULT FALSE, | ||
OUT colocation_id INT, | ||
OUT tenant_attribute TEXT, | ||
OUT read_count_in_this_period INT, | ||
OUT read_count_in_last_period INT, | ||
OUT query_count_in_this_period INT, | ||
OUT query_count_in_last_period INT, | ||
OUT score BIGINT) | ||
RETURNS SETOF RECORD | ||
LANGUAGE C | ||
AS 'citus', $$citus_stats_tenants$$; | ||
|
||
|
||
CREATE OR REPLACE VIEW citus.citus_stats_tenants AS | ||
SELECT | ||
colocation_id, | ||
tenant_attribute, | ||
read_count_in_this_period, | ||
read_count_in_last_period, | ||
query_count_in_this_period, | ||
query_count_in_last_period | ||
FROM pg_catalog.citus_stats_tenants() | ||
ORDER BY score DESC; | ||
|
||
ALTER VIEW citus.citus_stats_tenants SET SCHEMA pg_catalog; | ||
GRANT SELECT ON pg_catalog.citus_stats_tenants TO PUBLIC; |
Oops, something went wrong.