Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

YACHT-1054: Introducing filtering for tables which are modified till … #82

Merged
merged 3 commits into from
Oct 18, 2018

Conversation

radkomateusz
Copy link
Contributor

…last census snapshot. Saving Backup Quality SLI history.

…last census snapshot. Saving Backup Quality SLI history.
@coveralls
Copy link

coveralls commented Oct 18, 2018

Pull Request Test Coverage Report for Build 765

  • 59 of 69 (85.51%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 80.398%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/slo/sli_handlers.py 0 3 0.0%
src/slo/backup_quality/quality_sli_handler.py 0 7 0.0%
Totals Coverage Status
Change from base Build 755: 0.1%
Covered Lines: 2424
Relevant Lines: 3015

💛 - Coveralls

@@ -23,3 +24,10 @@ def format_query_results(self, results, snapshot_time):
"backupLastModified": float(result['f'][7]['v']),
"xDays": self.x_days} for result in results]
return formatted_results

@staticmethod
def latency_sli_entry_to_table_reference(table):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this method name has to be so long? It only converts json table to TableReference. What's more I think there is similar method somewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it's just a simply converter, what's more it is exactly the same as quality_sli_entry_to_table_reference

it was created when I think that latency and quality sli entry has different field names.

But I decided to left it as it is, because I think thet the possible change of quality/latency sli schema should not cause necessity to change something in shared converter for another sli

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I have only 1 more point, how about renaming method to 'entry_to_table_reference' ?


def __should_stay_as_sli_violation(self, table):
try:
return not self.table_newer_modification_predicate.is_modified_till_last_census_snapshot()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be 'is_modified_since_last_census_snapshot'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

for x_days in [0, 3, 4, 5, 7]
]
url='/sli/quality',
params={}))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe, you don't need to provide params if its empty

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -16,11 +16,3 @@ def query(self):
logging.info("Executing query: %s", query)
query_results = self.big_query.execute_query(query)
return self.query_specification.format_query_results(query_results, self.snapshot_time), self.snapshot_time

@staticmethod
def sli_entry_to_table_reference(table):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering why you moved it from here to both specification duplicating the same code? What was the reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

answered in comment under Przemek's comment

@@ -0,0 +1,98 @@
import unittest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if the name of the file is correct :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,97 @@
import unittest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change all 'till' to 'since'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@jarekdrabek jarekdrabek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in comments

jarekdrabek
jarekdrabek previously approved these changes Oct 18, 2018
@jarekdrabek jarekdrabek merged commit 811168b into master Oct 18, 2018
@jarekdrabek jarekdrabek deleted the YACHT-1054 branch October 18, 2018 14:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants