Skip to content

Commit

Permalink
Fix missing metrics, directly add successful fix stats
Browse files Browse the repository at this point in the history
Summary:
# This Diff
- Fixes num_fix/fixable problem stats not being added
- Adds direct tracking of num_fixed_problem/problem_successful_fixes

# Why
Previously we did not directly track the successful fixes directly in the table because of table quota concerns and because we thought that it would be easy to make a derived column for that.
Since then we've come to realize eden isn't using that much scuba data compared to other uses so small size increases should be easy and that derived columns are hard, so these metrics are now in the table.

Differential Revision: D62052614

fbshipit-source-id: f3fff1271f26cfc0ed741a3dddf882f25ce1d4e5
  • Loading branch information
Chris Dinh authored and facebook-github-bot committed Aug 31, 2024
1 parent 6f98f4e commit 6c20323
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions eden/fs/cli/doctor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,11 +485,13 @@ def _report_problems(self) -> int:
num_problems=fixer.num_problems,
problems=fixer.problem_types.union(fixer.ignored_problem_types),
problem_description=fixer.problem_description,
num_fixed_problems=fixer.num_fixed_problems,
num_failed_fixes=fixer.num_failed_fixes,
num_manual_fixes=fixer.num_manual_fixes,
num_no_fixes=fixer.num_no_fixes,
num_advisory_fixes=fixer.num_advisory_fixes,
problem_failed_fixes=fixer.problem_failed_fixes,
problem_successful_fixes=fixer.problem_successful_fixes,
problem_manual_fixes=fixer.problem_manual_fixes,
problem_no_fixes=fixer.problem_no_fixes,
problem_advisory_fixes=fixer.problem_advisory_fixes,
Expand Down
4 changes: 4 additions & 0 deletions eden/fs/cli/doctor/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def __init__(
self.num_advisory_fixes = 0
self.problem_types: Set[str] = set()
self.problem_fixable: Set[str] = set()
self.problem_successful_fixes: Set[str] = set()
self.problem_failed_fixes: Set[str] = set()
self.problem_manual_fixes: Set[str] = set()
self.problem_no_fixes: Set[str] = set()
Expand Down Expand Up @@ -210,6 +211,8 @@ def add_problem_impl(self, problem: ProblemBase) -> None:
)

def fix_problem(self, problem: FixableProblem) -> None:
self.num_fixable += 1
self.problem_fixable.add(problem.__class__.__name__)
self._filtered_out.write(
problem.severity(), f"{problem.start_msg()}...", flush=True
)
Expand All @@ -224,6 +227,7 @@ def fix_problem(self, problem: FixableProblem) -> None:
flush=True,
)
self.num_fixed_problems += 1
self.problem_successful_fixes.add(problem.__class__.__name__)
else:
self._filtered_out.writeln(
problem.severity(), "error", fg=self._filtered_out.out.RED
Expand Down

0 comments on commit 6c20323

Please sign in to comment.