Skip to content

Commit

Permalink
Open access to QueryClient pool stats
Browse files Browse the repository at this point in the history
  • Loading branch information
alex268 committed Sep 25, 2024
1 parent fef5bde commit a981125
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions query/src/main/java/tech/ydb/query/impl/QueryClientImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import tech.ydb.core.grpc.GrpcTransport;
import tech.ydb.query.QueryClient;
import tech.ydb.query.QuerySession;
import tech.ydb.table.SessionPoolStats;

/**
*
Expand Down Expand Up @@ -46,8 +47,8 @@ public void updatePoolMaxSize(int maxSize) {
pool.updateMaxSize(maxSize);
}

SessionPool getSessionPool() {
return pool;
public SessionPoolStats getSessionPoolStats() {
return pool.getStats();
}

@Override
Expand Down
2 changes: 2 additions & 0 deletions query/src/main/java/tech/ydb/query/impl/SessionPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ public void destroy() {

@Override
public void close() {
logger.trace("QuerySession[{}] closed with broke status {}", getId(), isBroken);

stats.released.increment();
if (isBroken || isStopped) {
queue.delete(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public ScheduledExecutorService getScheduler() {

@Override
public SessionPoolStats sessionPoolStats() {
return proxy.getSessionPool().getStats();
return proxy.getSessionPoolStats();
}

@Override
Expand Down

0 comments on commit a981125

Please sign in to comment.