kaisun2000 commented on PR #15025:
URL: https://github.com/apache/druid/pull/15025#issuecomment-1738123544

   > We don't need to add another monitor. The new metrics can be emitted from 
the QueryCountStatsMonitor.
   
   @abhishekagarwal87, just want to pan out the overall structure of add this 
metric from the `QueryCountStatsMonitor` and confirm the design before I make 
the changes. 
   
   `QueryCountStatsMonitor` takes a `QueryCountStatsProvider` in its 
constructor to provide the QueryCountStats (aggregate states instead of query 
specific stats). The `QueryCountStatsProvider` is implemented as 
`QueryResource` (which implements the logic for query REST endpoints). 
   
   So here, I can add a parameter in `QueryResource` constructor as `@Merging 
BlockingPool<ByteBuffer> mergeBufferPoolIn`. And let Guice to inject the shared 
merge buffer pool. This way, we can reuse the same monitor.
   
   In the interface of `QueryCountStatsProvider`, we need to add a method to 
report the pending query count such as `
     public long getPendingQueriesCount()`
     
   We will also need to keep the same changes in this PR to add a method in 
`BlockingPool` to report the pending queries in the pool, as `public long 
getPendingQueries()`
    
    Let me know if I missed anything. Or next I will update the PR to reflect 
this changes discussed here. 


-- 
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