Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Logging for Timing Metrics #473

Merged
merged 6 commits into from
Jul 24, 2024
Merged

Conversation

surge119
Copy link
Contributor

Summary

Adds support to the api to invoke a custom logger for timing metrics, and potentially other metrics in the future. Additionally added cli flag to print the timing metrics to stdout.

Test Plan

make all
hatch run fixit lint -m ./src/fixit/api.py

defaultdict(<function LintRunner.__init__.<locals>.<lambda> at 0x7f7f65a80680>, {'UseFstring.visit_Module': 9, 'DeprecatedABCImport.visit_ImportAlias': 2069, 'DeprecatedABCImport.visit_ImportFrom': 27, 'NoStringTypeAnnotation.visit_ImportFrom': 429, 'RewriteToLiteral.visit_Call': 4417, 'UseFstring.visit_Call': 1381, 'NoAssertTrueForComparisons.visit_Call': 3188, 'UseAssertIn.visit_Call': 7579, 'RewriteToComprehension.visit_Call': 2195, 'UseAssertIsNotNone.visit_Call': 2946, 'DeprecatedUnittestAsserts.visit_Call': 9572, 'UseAsyncSleepInAsyncDef.visit_Call': 14, 'NoRedundantListComprehension.visit_Call': 1601, 'NoRedundantArgumentsSuper.leave_Call': 44, 'UseClsInClassmethod.visit_FunctionDef': 20, 'UseAsyncSleepInAsyncDef.visit_FunctionDef': 6, 'NoStringTypeAnnotation.visit_Annotation': 43, 'ReplaceUnionWithOptional.leave_Annotation': 1747, 'NoStringTypeAnnotation.leave_Annotation': 43, 'NoStringTypeAnnotation.visit_SimpleString': 7, 'AvoidOrInExcept.visit_Try': 410, 'NoStaticIfCondition.visit_If': 1182, 'ComparePrimitivesByEqual.visit_Comparison': 31, 'CompareSingletonPrimitivesByIs.visit_Comparison': 544, 'NoRedundantFString.visit_FormattedString': 239, 'CollapseIsinstanceChecks.visit_BooleanOperation': 362, 'UseAsyncSleepInAsyncDef.leave_FunctionDef': 6, 'NoStringTypeAnnotation.visit_Subscript': 2, 'NoStringTypeAnnotation.leave_Subscript': 2, 'DeprecatedABCImport.leave_Module': 3})
🧼 1 file clean 🧼

@surge119 surge119 requested review from amyreese and zsol as code owners July 24, 2024 15:11
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 24, 2024
src/fixit/cli.py Outdated Show resolved Hide resolved
src/fixit/ftypes.py Outdated Show resolved Hide resolved
@amyreese amyreese merged commit 2795e01 into Instagram:main Jul 24, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants