-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:
mysql
readiness and collector udpates (#443)
* feat: mysql updates * chore: ignore ERA001 for a line * chore: bump versions * feat: add all tables for loading data * fix: updated mysql queries
- Loading branch information
Showing
22 changed files
with
1,159 additions
and
673 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
-- name: collector-mysql-resource-groups | ||
-- name: collector-mysql-5-resource-groups | ||
select concat(char(34), @PKEY, char(34)) as pkey, | ||
concat(char(34), @DMA_SOURCE_ID, char(34)) as dma_source_id, | ||
concat(char(34), @DMA_MANUAL_ID, char(34)) as dma_manual_id, | ||
concat(char(34), src.resource_group_name, char(34)) as resource_group_name, | ||
concat(char(34), src.resource_group_type, char(34)) as resource_group_type, | ||
concat(char(34), src.resource_group_enabled, char(34)) as resource_group_enabled, | ||
concat(char(34), src.vcpu_ids, char(34)) as vcpu_ids, | ||
concat(char(34), src.thread_priority, char(34)) as thread_priority | ||
concat(char(34), @DMA_SOURCE_ID, char(34)) as dma_source_id, | ||
concat(char(34), @DMA_MANUAL_ID, char(34)) as dma_manual_id, | ||
concat(char(34), src.resource_group_name, char(34)) as resource_group_name, | ||
concat(char(34), src.resource_group_type, char(34)) as resource_group_type, | ||
concat(char(34), src.resource_group_enabled, char(34)) as resource_group_enabled, | ||
concat(char(34), src.vcpu_ids, char(34)) as vcpu_ids, | ||
concat(char(34), src.thread_priority, char(34)) as thread_priority | ||
from ( | ||
select 'Unsupported Version Placeholder' as resource_group_type, | ||
0 as resource_group_enabled, | ||
'Placeholder Value' as resource_group_name, | ||
'' as vcpu_ids, | ||
0 as thread_priority | ||
limit 0 | ||
) src; | ||
select 'Unsupported Version Placeholder' as resource_group_type, | ||
0 as resource_group_enabled, | ||
'Placeholder Value' as resource_group_name, | ||
'' as vcpu_ids, | ||
0 as thread_priority | ||
limit 0 | ||
) src; |
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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
-- name: collector-mysql-resource-groups | ||
select concat(char(34), @PKEY, char(34)) as pkey, | ||
concat(char(34), @DMA_SOURCE_ID, char(34)) as dma_source_id, | ||
concat(char(34), @DMA_MANUAL_ID, char(34)) as dma_manual_id, | ||
concat(char(34), src.resource_group_name, char(34)) as resource_group_name, | ||
concat(char(34), src.resource_group_type, char(34)) as resource_group_type, | ||
concat(char(34), src.resource_group_enabled, char(34)) as resource_group_enabled, | ||
concat(char(34), src.vcpu_ids, char(34)) as vcpu_ids, | ||
concat(char(34), src.thread_priority, char(34)) as thread_priority | ||
concat(char(34), @DMA_SOURCE_ID, char(34)) as dma_source_id, | ||
concat(char(34), @DMA_MANUAL_ID, char(34)) as dma_manual_id, | ||
concat(char(34), src.resource_group_name, char(34)) as resource_group_name, | ||
concat(char(34), src.resource_group_type, char(34)) as resource_group_type, | ||
concat(char(34), src.resource_group_enabled, char(34)) as resource_group_enabled, | ||
concat(char(34), src.vcpu_ids, char(34)) as vcpu_ids, | ||
concat(char(34), src.thread_priority, char(34)) as thread_priority | ||
from ( | ||
select rg.resource_group_type as resource_group_type, | ||
rg.resource_group_enabled as resource_group_enabled, | ||
rg.resource_group_name as resource_group_name, | ||
rg.vcpu_ids as vcpu_ids, | ||
rg.thread_priority as thread_priority | ||
from information_schema.resource_groups rg | ||
) src; | ||
select rg.resource_group_type as resource_group_type, | ||
rg.resource_group_enabled as resource_group_enabled, | ||
rg.resource_group_name as resource_group_name, | ||
rg.vcpu_ids as vcpu_ids, | ||
rg.thread_priority as thread_priority | ||
from information_schema.resource_groups rg | ||
) src; |
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
242 changes: 242 additions & 0 deletions
242
src/dma/collector/sql/canonical/ddls-mysql-collection.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,242 @@ | ||
-- name: ddl-collection-scripts-02! | ||
create or replace table collection_mysql_config ( | ||
pkey varchar, | ||
dma_source_id varchar, | ||
dma_manual_id varchar, | ||
variable_category varchar, | ||
variable_name varchar, | ||
variable_value varchar | ||
); | ||
|
||
create or replace table collection_mysql_users ( | ||
pkey varchar, | ||
dma_source_id varchar, | ||
dma_manual_id varchar, | ||
user_host varchar, | ||
user_count numeric | ||
); | ||
|
||
drop view if exists collection_resource_groups; | ||
|
||
create or replace table collection_mysql_5_resource_groups ( | ||
pkey varchar, | ||
dma_source_id varchar, | ||
dma_manual_id varchar, | ||
resource_group_name varchar, | ||
resource_group_type varchar, | ||
resource_group_enabled varchar, | ||
vcpu_ids varchar, | ||
thread_priority varchar | ||
); | ||
|
||
create or replace table collection_mysql_base_resource_groups ( | ||
pkey varchar, | ||
dma_source_id varchar, | ||
dma_manual_id varchar, | ||
resource_group_name varchar, | ||
resource_group_type varchar, | ||
resource_group_enabled varchar, | ||
vcpu_ids varchar, | ||
thread_priority varchar | ||
); | ||
|
||
create or replace view collection_resource_groups as | ||
select pkey, | ||
dma_source_id, | ||
dma_manual_id, | ||
resource_group_name, | ||
resource_group_type, | ||
resource_group_enabled, | ||
vcpu_ids, | ||
thread_priority | ||
from collection_mysql_base_resource_groups | ||
union all | ||
select pkey, | ||
dma_source_id, | ||
dma_manual_id, | ||
resource_group_name, | ||
resource_group_type, | ||
resource_group_enabled, | ||
vcpu_ids, | ||
thread_priority | ||
from collection_mysql_5_resource_groups; | ||
|
||
create or replace table collection_mysql_config ( | ||
pkey varchar, | ||
dma_source_id varchar, | ||
dma_manual_id varchar, | ||
variable_category varchar, | ||
variable_name varchar, | ||
variable_value varchar | ||
); | ||
|
||
create or replace table collection_mysql_data_types ( | ||
pkey varchar, | ||
dma_source_id varchar, | ||
dma_manual_id varchar, | ||
table_catalog varchar, | ||
table_schema varchar, | ||
table_name varchar, | ||
data_type varchar, | ||
data_type_count numeric | ||
); | ||
|
||
create or replace table collection_mysql_database_details ( | ||
pkey varchar, | ||
dma_source_id varchar, | ||
dma_manual_id varchar, | ||
table_schema varchar, | ||
total_table_count numeric, | ||
innodb_table_count numeric, | ||
non_innodb_table_count numeric, | ||
total_row_count numeric, | ||
innodb_table_row_count numeric, | ||
non_innodb_table_row_count numeric, | ||
total_data_size_bytes numeric, | ||
innodb_data_size_bytes numeric, | ||
non_innodb_data_size_bytes numeric, | ||
total_index_size_bytes numeric, | ||
innodb_index_size_bytes numeric, | ||
non_innodb_index_size_bytes numeric, | ||
total_size_bytes numeric, | ||
innodb_total_size_bytes numeric, | ||
non_innodb_total_size_bytes numeric, | ||
total_index_count numeric, | ||
innodb_index_count numeric, | ||
non_innodb_index_count numeric | ||
); | ||
|
||
create or replace table collection_mysql_engines ( | ||
pkey varchar, | ||
dma_source_id varchar, | ||
dma_manual_id varchar, | ||
engine_name varchar, | ||
engine_support varchar, | ||
engine_transactions varchar, | ||
engine_xa varchar, | ||
engine_savepoints varchar, | ||
engine_comment varchar | ||
); | ||
|
||
create or replace table collection_mysql_plugins ( | ||
pkey varchar, | ||
dma_source_id varchar, | ||
dma_manual_id varchar, | ||
plugin_name varchar, | ||
plugin_version varchar, | ||
plugin_status varchar, | ||
plugin_type varchar, | ||
plugin_type_version varchar, | ||
plugin_library varchar, | ||
plugin_library_version varchar, | ||
plugin_author varchar, | ||
plugin_description varchar, | ||
plugin_license varchar, | ||
load_option varchar | ||
); | ||
|
||
drop view if exists collection_mysql_process_list; | ||
|
||
create or replace table collection_mysql_base_process_list ( | ||
pkey varchar, | ||
dma_source_id varchar, | ||
dma_manual_id varchar, | ||
process_id numeric, | ||
process_host varchar, | ||
process_db varchar, | ||
process_command varchar, | ||
process_time numeric, | ||
process_state varchar | ||
); | ||
|
||
create or replace table collection_mysql_5_process_list ( | ||
pkey varchar, | ||
dma_source_id varchar, | ||
dma_manual_id varchar, | ||
process_id numeric, | ||
process_host varchar, | ||
process_db varchar, | ||
process_command varchar, | ||
process_time numeric, | ||
process_state varchar | ||
); | ||
|
||
create or replace view collection_mysql_process_list as | ||
select pkey, | ||
dma_source_id, | ||
dma_manual_id, | ||
process_id, | ||
process_host, | ||
process_db, | ||
process_command, | ||
process_time, | ||
process_state | ||
from collection_mysql_base_process_list | ||
union all | ||
select pkey, | ||
dma_source_id, | ||
dma_manual_id, | ||
process_id, | ||
process_host, | ||
process_db, | ||
process_command, | ||
process_time, | ||
process_state | ||
from collection_mysql_5_process_list; | ||
|
||
create or replace table collection_mysql_schema_details ( | ||
pkey varchar, | ||
dma_source_id varchar, | ||
dma_manual_id varchar, | ||
table_schema varchar, | ||
table_name varchar, | ||
table_engine varchar, | ||
table_rows numeric, | ||
data_length numeric, | ||
index_length numeric, | ||
is_compressed numeric, | ||
is_partitioned numeric, | ||
partition_count numeric, | ||
index_count numeric, | ||
fulltext_index_count numeric, | ||
is_encrypted numeric, | ||
spatial_index_count numeric, | ||
has_primary_key numeric, | ||
row_format varchar, | ||
table_type varchar | ||
); | ||
|
||
create or replace table collection_mysql_schema_objects ( | ||
pkey varchar, | ||
dma_source_id varchar, | ||
dma_manual_id varchar, | ||
object_catalog varchar, | ||
object_schema varchar, | ||
object_category varchar, | ||
object_type varchar, | ||
object_owner_schema varchar, | ||
object_owner varchar, | ||
object_name varchar | ||
); | ||
|
||
create or replace table collection_mysql_table_details ( | ||
pkey varchar, | ||
dma_source_id varchar, | ||
dma_manual_id varchar, | ||
table_schema varchar, | ||
table_name varchar, | ||
table_engine varchar, | ||
table_rows numeric, | ||
data_length numeric, | ||
index_length numeric, | ||
is_compressed numeric, | ||
is_partitioned numeric, | ||
partition_count numeric, | ||
index_count numeric, | ||
fulltext_index_count numeric, | ||
is_encrypted numeric, | ||
spatial_index_count numeric, | ||
has_primary_key numeric, | ||
row_format varchar, | ||
table_type varchar | ||
); |
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
Oops, something went wrong.