tibrewalpratik17 commented on code in PR #11437:
URL: https://github.com/apache/pinot/pull/11437#discussion_r1327165393


##########
pinot-spi/src/main/java/org/apache/pinot/spi/eventlistener/query/BrokerQueryEventInfo.java:
##########
@@ -0,0 +1,462 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.spi.eventlistener.query;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.apache.pinot.spi.trace.RequestContext;
+
+
+public class BrokerQueryEventInfo {
+  private String _requestId = "";
+  private String _brokerId = "";
+  private String _query = "";
+  private String _queryStatus = "";
+  private String _failureJson = "";
+  private int _errorCode = -1;
+
+  private long _requestArrivalTimeMillis = 0L;
+  private int _numServersQueried = 0;
+  private int _numServersResponded = 0;
+  private long _numDocsScanned = 0L;
+  private long _numEntriesScannedInFilter = 0L;
+  private long _numEntriesScannedPostFilter = 0L;
+  private long _numSegmentsQueried = 0L;
+  private long _numSegmentsProcessed = 0L;
+  private long _numSegmentsMatched = 0L;
+  private long _numConsumingSegmentsQueried = 0L;
+  private long _numConsumingSegmentsProcessed = 0L;
+  private long _numConsumingSegmentsMatched = 0L;
+
+  private long _minConsumingFreshnessTimeMs = 0L;
+
+  private long _totalDocs = 0L;
+  private boolean _numGroupsLimitReached = false;
+  private long _timeUsedMs = 0L;
+  private long _offlineThreadCpuTimeNs = 0L;
+  private long _realtimeThreadCpuTimeNs = 0L;
+  private long _offlineSystemActivitiesCpuTimeNs = 0L;
+  private long _realtimeSystemActivitiesCpuTimeNs = 0L;
+  private long _offlineResponseSerializationCpuTimeNs = 0L;
+  private long _realtimeResponseSerializationCpuTimeNs = 0L;
+  private long _offlineTotalCpuTimeNs = 0L;
+  private long _realtimeTotalCpuTimeNs = 0L;
+  private long _numSegmentsPrunedByBroker = 0L;
+  private long _numSegmentsPrunedByServer = 0L;
+  private long _numSegmentsPrunedInvalid = 0L;
+  private long _numSegmentsPrunedByLimit = 0L;
+  private long _numSegmentsPrunedByValue = 0L;
+  private long _explainPlanNumEmptyFilterSegments = 0L;
+  private long _explainPlanNumMatchAllFilterSegments = 0L;
+  private int _numRowsResultSet = 0;
+  private List<String> _tableNames = new ArrayList<>();
+  private String _offlineServerTenant = "";
+  private String _realtimeServerTenant = "";
+
+  public BrokerQueryEventInfo() {
+  }
+
+  public BrokerQueryEventInfo(RequestContext requestContext) {

Review Comment:
   > Per this constructor, I don't really see the difference between these 2 
classes. I think RequestContext is introduced for the exact same purpose, and 
we don't want to maintain 2 giant info class (actually 3 if including the 
broker response...). Can we just use RequestContext, and if you want to add 
more stats, add it to RequestContext?
   
   Sure I am up with enriching RequestContext with more info which we receive 
in BrokerResponse. It would have been great if we could have moved 
BrokerResponse in spi package itself actually. But using RequestContext also 
works.
   
   > also another comment. this part is not necessarily and the content of this 
concrete class has nothing to do with the pluggable part of the system 
(Broker/ServerListener) which will be implemented separately. suggest move this 
out of the SPI package and into the concrete impl part
   
   I am still not sure how would we get values in the Info class if we keep it 
into the implemented class. We need some object class init and provided to the 
implementation of the Listener class otherwise how will we get metrics.



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to