1515// specific language governing permissions and limitations
1616// under the License.
1717
18- use clap:: { ColorChoice , Parser , ValueEnum } ;
18+ use clap:: { ColorChoice , Parser } ;
1919use datafusion:: common:: instant:: Instant ;
2020use datafusion:: common:: utils:: get_available_parallelism;
2121use datafusion:: common:: { DataFusionError , Result , exec_datafusion_err, exec_err} ;
@@ -61,14 +61,6 @@ const SQLITE_PREFIX: &str = "sqlite";
6161const ERRS_PER_FILE_LIMIT : usize = 10 ;
6262const TIMING_DEBUG_SLOW_FILES_ENV : & str = "SLT_TIMING_DEBUG_SLOW_FILES" ;
6363
64- #[ derive( Clone , Copy , Debug , Eq , PartialEq , ValueEnum ) ]
65- enum TimingSummaryMode {
66- Auto ,
67- Off ,
68- Top ,
69- Full ,
70- }
71-
7264#[ derive( Debug ) ]
7365struct FileTiming {
7466 relative_path : PathBuf ,
@@ -321,7 +313,7 @@ async fn run_tests() -> Result<()> {
321313 . then_with ( || a. relative_path . cmp ( & b. relative_path ) )
322314 } ) ;
323315
324- print_timing_summary ( & options, & m, is_ci , & file_timings) ?;
316+ print_timing_summary ( & options, & m, & file_timings) ?;
325317
326318 let errors: Vec < _ > = file_results
327319 . into_iter ( )
@@ -384,27 +376,14 @@ async fn run_tests() -> Result<()> {
384376fn print_timing_summary (
385377 options : & Options ,
386378 progress : & MultiProgress ,
387- is_ci : bool ,
388379 file_timings : & [ FileTiming ] ,
389380) -> Result < ( ) > {
390- let mode = options. timing_summary_mode ( is_ci) ;
391- if mode == TimingSummaryMode :: Off || file_timings. is_empty ( ) {
381+ if !options. timing_summary || file_timings. is_empty ( ) {
392382 return Ok ( ( ) ) ;
393383 }
394384
395- let top_n = options. timing_top_n ;
396- debug_assert ! ( matches!(
397- mode,
398- TimingSummaryMode :: Top | TimingSummaryMode :: Full
399- ) ) ;
400- let count = if mode == TimingSummaryMode :: Full {
401- file_timings. len ( )
402- } else {
403- top_n
404- } ;
405-
406385 progress. println ( "Per-file elapsed summary (deterministic):" ) ?;
407- for ( idx, timing) in file_timings. iter ( ) . take ( count ) . enumerate ( ) {
386+ for ( idx, timing) in file_timings. iter ( ) . enumerate ( ) {
408387 progress. println ( format ! (
409388 "{:>3}. {:>8.3}s {}" ,
410389 idx + 1 ,
@@ -413,13 +392,6 @@ fn print_timing_summary(
413392 ) ) ?;
414393 }
415394
416- if mode != TimingSummaryMode :: Full && file_timings. len ( ) > count {
417- progress. println ( format ! (
418- "... {} more files omitted (use --timing-summary full to show all)" ,
419- file_timings. len( ) - count
420- ) ) ?;
421- }
422-
423395 Ok ( ( ) )
424396}
425397
@@ -434,16 +406,6 @@ fn is_env_truthy(name: &str) -> bool {
434406 } )
435407}
436408
437- fn parse_timing_top_n ( arg : & str ) -> std:: result:: Result < usize , String > {
438- let parsed = arg
439- . parse :: < usize > ( )
440- . map_err ( |error| format ! ( "invalid value '{arg}': {error}" ) ) ?;
441- if parsed == 0 {
442- return Err ( "must be >= 1" . to_string ( ) ) ;
443- }
444- Ok ( parsed)
445- }
446-
447409async fn run_test_file_substrait_round_trip (
448410 test_file : TestFile ,
449411 validator : Validator ,
@@ -940,20 +902,10 @@ struct Options {
940902 #[ clap(
941903 long,
942904 env = "SLT_TIMING_SUMMARY" ,
943- value_enum,
944- default_value_t = TimingSummaryMode :: Auto ,
945- help = "Per-file timing summary mode: auto|off|top|full"
946- ) ]
947- timing_summary : TimingSummaryMode ,
948-
949- #[ clap(
950- long,
951- env = "SLT_TIMING_TOP_N" ,
952- default_value_t = 10 ,
953- value_parser = parse_timing_top_n,
954- help = "Number of files to show when timing summary mode is auto/top (must be >= 1)"
905+ default_value_t = false ,
906+ help = "Print deterministic per-file timing summary"
955907 ) ]
956- timing_top_n : usize ,
908+ timing_summary : bool ,
957909
958910 #[ clap(
959911 long,
@@ -965,19 +917,6 @@ struct Options {
965917}
966918
967919impl Options {
968- fn timing_summary_mode ( & self , is_ci : bool ) -> TimingSummaryMode {
969- match self . timing_summary {
970- TimingSummaryMode :: Auto => {
971- if is_ci {
972- TimingSummaryMode :: Top
973- } else {
974- TimingSummaryMode :: Off
975- }
976- }
977- mode => mode,
978- }
979- }
980-
981920 /// Because this test can be run as a cargo test, commands like
982921 ///
983922 /// ```shell
0 commit comments