minor refactoring in typing_check_service.profile_log
commit1aa8da7c627c430a8bbe559bdb4105fbbb4d4609
authorLucian Wischik <ljw@fb.com>
Tue, 2 Mar 2021 06:34:57 +0000 (1 22:34 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 2 Mar 2021 06:37:39 +0000 (1 22:37 -0800)
treee0813d4d4c667a167cb6a08635f7203e3307097c
parent69582f5588cf62817091b85c0d7fd7df319bf840
minor refactoring in typing_check_service.profile_log

Summary:
This diff is some minor refactoring into typing_check_service.profile_log. It leaves these two aspects unchanged:
1. profile_log calculates duration, and if it exceeds a threshold then it logs
2. it also calculates a Telemetry.t object and incorporates that into the log

Prior to this diff, we'd calculate the Telemetry.t object even if we decided that this file didn't exceed the threshold and hence didn't merit a log. All I did was shift the "calculate Telemetry.t" logic after, so it only gets run if we do merit a long.

Differential Revision: D26644161

fbshipit-source-id: 3ec37be01b4ce91db3cc7b3f6afc4fced77b7a00
hphp/hack/src/typing/typing_check_service.ml