We currently use the following pattern to log a Pysa analysis step (e.g, call graph builting, type checking, etc.):
let timer = Timer.start () in
let () = Log.info "Fetching initial callables to analyze..." in
let initial_callables =
Interprocedural.FetchCallables.from_qualifiers
~scheduler
~configuration
~pyre_api
~include_unit_tests:false
~qualifiers
in
Statistics.performance
~name:"Fetched initial callables to analyze"
~phase_name:"Fetching initial callables to analyze"
~timer
~integers:(Interprocedural.FetchCallables.get_stats initial_callables)
();
initial_callables
It would be better to have a proper API that avoids code duplication:
let step_log = StepLogger.start
~start:"Fetching initial callables to analyze"
~end:"Fetched initial callables to analyze""
in
(* code of the step *)
let initial_callables =
Interprocedural.FetchCallables.from_qualifiers
~scheduler
~configuration
~pyre_api
~include_unit_tests:false
~qualifiers
in
StepLogger.end ~integers:(Interprocedural.FetchCallables.get_stats initial_callables);
initial_callables
We currently use the following pattern to log a Pysa analysis step (e.g, call graph builting, type checking, etc.):
For instance: https://github.com/facebook/pyre-check/blob/main/source/interprocedural_analyses/taint/taintAnalysis.ml#L723-L743
It would be better to have a proper API that avoids code duplication:
This is tracked internally by T184908437.