File tree Expand file tree Collapse file tree
glean/lang/scip/indexer/scip_to_glean/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,8 +107,10 @@ fn build_json(args: BuildJsonArgs) -> Result<()> {
107107 args. root_prefix . as_deref ( ) ,
108108 ) ?;
109109
110+ let output_facts = env. output ( ) ;
111+ info ! ( "Found {} facts total" , output_facts. total_facts_count( ) ) ;
110112 let shards = if let Some ( shard_size) = args. shard {
111- let shards = env . output ( ) . shard ( shard_size) ;
113+ let shards = output_facts . shard ( shard_size) ;
112114 // pad the output files for correct numerical sorting
113115 let padding = shards. len ( ) . to_string ( ) . len ( ) ;
114116 shards
@@ -122,7 +124,7 @@ fn build_json(args: BuildJsonArgs) -> Result<()> {
122124 } )
123125 . collect ( )
124126 } else {
125- vec ! [ ( args. output, env . output ( ) ) ]
127+ vec ! [ ( args. output, output_facts ) ]
126128 } ;
127129
128130 let num_files = shards. len ( ) ;
Original file line number Diff line number Diff line change @@ -255,6 +255,24 @@ impl GleanJSONOutput {
255255 } )
256256 }
257257
258+ pub fn total_facts_count ( & self ) -> usize {
259+ self . src_files . len ( )
260+ + self . file_langs . len ( )
261+ + self . documentation . len ( )
262+ + self . symbol_documentation . len ( )
263+ + self . file_ranges . len ( )
264+ + self . symbols . len ( )
265+ + self . definitions . len ( )
266+ + self . references . len ( )
267+ + self . local_names . len ( )
268+ + self . symbol_names . len ( )
269+ + self . is_implementation . len ( )
270+ + self . symbol_kinds . len ( )
271+ + self . metadata . len ( )
272+ + self . display_names . len ( )
273+ + self . display_name_symbols . len ( )
274+ }
275+
258276 /// Consumes self, returns a list of GleanJSONOutput shards that are approximately of size `shard_size`
259277 /// The shards are complete SCIP subgraphs, per the SCIP schema definition
260278 /// This facilitates smaller writes to Glean without global, stateful keys
You can’t perform that action at this time.
0 commit comments