leventov commented on a change in pull request #7562: Enable toggling request 
logging on/off for different query types
URL: https://github.com/apache/incubator-druid/pull/7562#discussion_r309822740
 
 

 ##########
 File path: 
server/src/test/java/org/apache/druid/server/log/FilteredRequestLoggerTest.java
 ##########
 @@ -125,6 +140,46 @@ public void testNotFilterAboveThreshold() throws 
IOException
     EasyMock.verify(nativeRequestLogLine, sqlRequestLogLine, delegate);
   }
 
+  @Test
+  public void testNotFilterAboveThresholdSkipSegmentMetadata() throws 
IOException
+  {
+    RequestLogger delegate = EasyMock.createStrictMock(RequestLogger.class);
+    delegate.logNativeQuery(EasyMock.anyObject());
+    EasyMock.expectLastCall().andThrow(new IOException());
+    delegate.logSqlQuery(EasyMock.anyObject());
+    EasyMock.expectLastCall().andThrow(new IOException());
+
+    FilteredRequestLoggerProvider.FilteredRequestLogger logger = new 
FilteredRequestLoggerProvider.FilteredRequestLogger(
+        delegate,
+        1000,
+        2000,
+        ImmutableList.of(Query.SEGMENT_METADATA)
+    );
+
+    RequestLogLine nativeRequestLogLine = 
EasyMock.createMock(RequestLogLine.class);
+    EasyMock.expect(nativeRequestLogLine.getQueryStats())
+            .andReturn(new QueryStats(ImmutableMap.of("query/time", 10000)))
+            .once();
+    EasyMock.expect(nativeRequestLogLine.getQuery())
+            .andReturn(new SegmentMetadataQuery(new LegacyDataSource("foo"),
 
 Review comment:
   Same

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to