BlakeOrth commented on code in PR #18085:
URL: https://github.com/apache/datafusion/pull/18085#discussion_r2436711776


##########
datafusion-cli/src/object_storage/instrumented.rs:
##########
@@ -537,26 +662,14 @@ mod tests {
             extra_display: None,
         });
 
-        let summaries = RequestSummary::summarize_by_operation(&requests);
-        assert_eq!(summaries.len(), 1);
-
-        let summary = summaries.get(&Operation::Get).unwrap();
-        assert_eq!(summary.count, 1);
-        assert_eq!(
-            summary.duration_stats.as_ref().unwrap().min,
-            Duration::from_secs(5)
-        );
-        assert_eq!(
-            summary.duration_stats.as_ref().unwrap().max,
-            Duration::from_secs(5)
-        );
-        assert_eq!(
-            summary.duration_stats.as_ref().unwrap().sum,
-            Duration::from_secs(5)
-        );
-        assert_eq!(summary.size_stats.as_ref().unwrap().min, 100);
-        assert_eq!(summary.size_stats.as_ref().unwrap().max, 100);
-        assert_eq!(summary.size_stats.as_ref().unwrap().sum, 100);
+        assert_snapshot!(RequestSummaries::new(&requests), @r"
+        
+-----------+----------+-----------+-----------+-----------+-----------+
+        | Operation | Metric   | min       | max       | avg       | sum       
|
+        
+-----------+----------+-----------+-----------+-----------+-----------+
+        | Get       | duration | 5.000000s | 5.000000s | 5.000000s | 5.000000s 
|
+        | Get       | size     | 100 B     | 100 B     | 100 B     | 100 B     
|
+        
+-----------+----------+-----------+-----------+-----------+-----------+
+        ");

Review Comment:
   Yeah, that's a good point. I think there was some discussion about building 
a machine-readable output, such as JSON, as well. That output would likely 
require its own set of test cases as it is though, so I think similar 
justification applies to both.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to