@@ -23,7 +23,8 @@ pub struct Toploc {
2323#[ derive( Debug , PartialEq , Serialize , Deserialize ) ]
2424pub struct GroupValidationResult {
2525 pub status : ValidationResult ,
26- pub flops : f64 ,
26+ pub input_flops : f64 ,
27+ pub output_flops : f64 ,
2728 // This tells us which node(s) in a group actually failed the toploc validation
2829 pub failing_indices : Vec < i64 > ,
2930}
@@ -86,7 +87,7 @@ impl Toploc {
8687 "{}/validate/{}" ,
8788 self . config. server_url, processed_file_name
8889 ) ;
89- info ! (
90+ debug ! (
9091 "Triggering remote toploc validation for {} {}" ,
9192 file_name, validate_url
9293 ) ;
@@ -266,10 +267,15 @@ impl Toploc {
266267 _ => ValidationResult :: Unknown ,
267268 } ;
268269
269- let flops = status_json
270- . get ( "flops" )
270+ let input_flops = status_json
271+ . get ( "input_flops" )
272+ . and_then ( |f| f. as_f64 ( ) )
273+ . unwrap_or ( 0.0 ) ;
274+ let output_flops = status_json
275+ . get ( "output_flops" )
271276 . and_then ( |f| f. as_f64 ( ) )
272277 . unwrap_or ( 0.0 ) ;
278+
273279 let failing_indices = status_json
274280 . get ( "failing_indices" )
275281 . and_then ( |f| f. as_array ( ) )
@@ -280,7 +286,8 @@ impl Toploc {
280286
281287 Ok ( GroupValidationResult {
282288 status : validation_result,
283- flops,
289+ input_flops,
290+ output_flops,
284291 failing_indices,
285292 } )
286293 }
@@ -529,7 +536,7 @@ mod tests {
529536 let _status_mock = server
530537 . mock ( "GET" , "/statusgroup/test-group.parquet" )
531538 . with_status ( 200 )
532- . with_body ( r#"{"status": "accept", "flops ": 12345.67, "failing_indices": []}"# )
539+ . with_body ( r#"{"status": "accept", "input_flops": 12345.67, "output_flops ": 12345.67, "failing_indices": []}"# )
533540 . create ( ) ;
534541
535542 let config = ToplocConfig {
@@ -546,7 +553,8 @@ mod tests {
546553 assert ! ( result. is_ok( ) ) ;
547554 let group_result = result. unwrap ( ) ;
548555 assert_eq ! ( group_result. status, ValidationResult :: Accept ) ;
549- assert_eq ! ( group_result. flops, 12345.67 ) ;
556+ assert_eq ! ( group_result. input_flops, 12345.67 ) ;
557+ assert_eq ! ( group_result. output_flops, 12345.67 ) ;
550558 assert ! ( group_result. failing_indices. is_empty( ) ) ;
551559 Ok ( ( ) )
552560 }
@@ -558,7 +566,7 @@ mod tests {
558566 let _status_mock = server
559567 . mock ( "GET" , "/statusgroup/test-group.parquet" )
560568 . with_status ( 200 )
561- . with_body ( r#"{"status": "reject", "flops ": 0.0, "failing_indices": [1, 3, 5]}"# )
569+ . with_body ( r#"{"status": "reject", "input_flops": 0.0, "output_flops ": 0.0, "failing_indices": [1, 3, 5]}"# )
562570 . create ( ) ;
563571
564572 let config = ToplocConfig {
@@ -575,7 +583,8 @@ mod tests {
575583 assert ! ( result. is_ok( ) ) ;
576584 let group_result = result. unwrap ( ) ;
577585 assert_eq ! ( group_result. status, ValidationResult :: Reject ) ;
578- assert_eq ! ( group_result. flops, 0.0 ) ;
586+ assert_eq ! ( group_result. input_flops, 0.0 ) ;
587+ assert_eq ! ( group_result. output_flops, 0.0 ) ;
579588 assert_eq ! ( group_result. failing_indices, vec![ 1 , 3 , 5 ] ) ;
580589 Ok ( ( ) )
581590 }
0 commit comments