Skip to content

Commit

Permalink
[flow] more logging around indexing during startup
Browse files Browse the repository at this point in the history
Summary: Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision:
D69668538

------------------------------------------------------------------------
(from 9d3940bf19943d301dcbcf29cd34b3ea8ead8ff8)

fbshipit-source-id: be098081701ef866fc17886182bee0f12efc7d3f
  • Loading branch information
panagosg7 authored and facebook-github-bot committed Feb 18, 2025
1 parent 53eb9f5 commit 366e84f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/services/export/export_service.ml
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ let index ~workers ~reader parsed :
(exports_to_add, exports_to_remove, imports_to_add, imports_to_remove, count)
in

Hh_logger.info "Indexing files: creating index...";
MonitorRPC.status_update
~event:ServerStatus.(Indexing_progress { finished = 0; total = Some total_count });
(* each job returns two Export_index.t's. we cons them onto lists and merge them all
Expand Down Expand Up @@ -363,6 +364,7 @@ let index ~workers ~reader parsed :
))
~next:(MultiWorkerLwt.next workers parsed)
in
Hh_logger.info "Indexing files: indexing post-process...";
MonitorRPC.status_update ~event:ServerStatus.Indexing_post_process;

let exports_to_add =
Expand Down Expand Up @@ -396,9 +398,12 @@ let init ~workers ~reader ~libs parsed =
let%lwt (exports_to_add, _exports_to_remove, imports_to_add, _imports_to_remove) =
index ~workers ~reader parsed
in
Hh_logger.info "Indexing files: adding exports of builtins...";
let exports_to_add = add_exports_of_builtins libs exports_to_add in
Hh_logger.info "Indexing files: merging exports-imports...";
let final_export_index = Export_index.merge_export_import imports_to_add exports_to_add in
(* TODO: assert that _exports_to_remove is empty? should be on init *)
Hh_logger.info "Indexing files: initing...";
let search = Export_search.init final_export_index in
MonitorRPC.status_update ~event:ServerStatus.Indexing_end;
Lwt.return search
Expand Down
3 changes: 2 additions & 1 deletion src/services/inference/types_js.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1828,6 +1828,7 @@ let init_with_initial_state
Export_service.init ~workers ~reader ~libs:lib_exports parsed
)
in
Hh_logger.info "Finished indexing files";

let connections =
Base.Option.value_map
Expand Down Expand Up @@ -2226,7 +2227,7 @@ let init_from_scratch ~profiling ~workers options =
Export_service.init ~workers ~reader ~libs:lib_exports parsed_set
)
in
Hh_logger.info "Done";
Hh_logger.info "Finished indexing files";

let (collated_errors, _) =
ErrorCollator.update_local_collated_errors
Expand Down

0 comments on commit 366e84f

Please sign in to comment.