-
Notifications
You must be signed in to change notification settings - Fork 966
feat: Output table sizes while calculating #7065
Conversation
Adds table sizes to output while running checks to add transparency to the process.
Adds output like this while checking each server
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -76,6 +76,8 @@ def check_table_growth(rds_list, username, password, threshold, rds_threshold): | |||
table_list = [] | |||
for db in rds_list: | |||
print("Checking table sizes for {}".format(db["Endpoint"])) | |||
format_string_header = "{:<50} {:<30} {:<70}" | |||
print(format_string_header.format("RDS Name","Database Name", "Table Name", "Size")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: missing space after comma
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like that was copied from the code below for displaying the tables over the threshold, which would ideally also be fixed. Later, we should either add a linter here or move this code somewhere that already has linting set up.
@@ -102,12 +104,15 @@ def check_table_growth(rds_list, username, password, threshold, rds_threshold): | |||
threshold_limit = threshold | |||
for tables in rds_result: | |||
temp_dict = {} | |||
if tables[2] is not None and tables[2] > float(threshold_limit): | |||
if tables[2] is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we remove the and bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That condition got moved further down, so we can display the size of tables that don't exceed the threshold.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to fix the formatting nit, but should be ok to go as is.
@@ -102,12 +104,15 @@ def check_table_growth(rds_list, username, password, threshold, rds_threshold): | |||
threshold_limit = threshold | |||
for tables in rds_result: | |||
temp_dict = {} | |||
if tables[2] is not None and tables[2] > float(threshold_limit): | |||
if tables[2] is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That condition got moved further down, so we can display the size of tables that don't exceed the threshold.
@@ -76,6 +76,8 @@ def check_table_growth(rds_list, username, password, threshold, rds_threshold): | |||
table_list = [] | |||
for db in rds_list: | |||
print("Checking table sizes for {}".format(db["Endpoint"])) | |||
format_string_header = "{:<50} {:<30} {:<70}" | |||
print(format_string_header.format("RDS Name","Database Name", "Table Name", "Size")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like that was copied from the code below for displaying the tables over the threshold, which would ideally also be fixed. Later, we should either add a linter here or move this code somewhere that already has linting set up.
Adds table sizes to output while running checks to add transparency to the process.
Configuration Pull Request
Make sure that the following steps are done before merging: