sajjad-moradi commented on code in PR #14430: URL: https://github.com/apache/pinot/pull/14430#discussion_r1838620812
########## pinot-server/src/main/java/org/apache/pinot/server/starter/helix/BaseServerStarter.java: ########## @@ -707,6 +711,23 @@ public void start() _serverQueriesDisabledTracker = new ServerQueriesDisabledTracker(_helixClusterName, _instanceId, _helixManager, serverMetrics); _serverQueriesDisabledTracker.start(); + + // Add metrics for consumer directory usage + serverMetrics.setOrUpdateGlobalGauge(ServerGauge.CONSUMER_DIR_USAGE, () -> { + List<File> serverConsumerDirs = instanceDataManager.getConsumerDirPaths(); + final long[] totalSize = {0}; Review Comment: why array? Single long is not enough? ########## pinot-server/src/main/java/org/apache/pinot/server/starter/helix/HelixInstanceDataManager.java: ########## @@ -180,6 +181,24 @@ private void initInstanceDataDir(File instanceDataDir) { } } + @Override + public List<File> getConsumerDirPaths() { + String consumerDirPath = _instanceDataManagerConfig.getConsumerDir(); + + if (consumerDirPath != null) { + return Collections.singletonList(new File(consumerDirPath)); + } else { + List<File> consumerDirs = new ArrayList<>(); + String instanceDataDir = _instanceDataManagerConfig.getInstanceDataDir(); + for (String tableNameWithType : getAllTables()) { + String dirPath = instanceDataDir + File.separator + tableNameWithType + File.separator + + RealtimeTableDataManager.CONSUMERS_DIR; + consumerDirs.add(new File(dirPath)); + } + return consumerDirs; Review Comment: My understanding is that if the consumerDir is not specified, the table is not mmapping the consuming segments (it uses direct offheap). So maybe we don't need the else part?! -- 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