Collects statistics about database connection memory usage, in the case where the
caller might not actually own the connection.

@return The statistics object, never null.
438401
void collectDbStatsUnsafe(ArrayList<com.couchbase.lite.internal.database.sqlite.SQLiteDebug.DbStats> dbStatsList) {
        dbStatsList.add(getMainDbStatsUnsafe(0, 0, 0));
    }
947773
@Override
	public ThriftConnection<T> getConnection() throws ThriftConnectionPoolException {
		long statsObtainTime = preConnection();

		ThriftConnectionHandle<T> result = (ThriftConnectionHandle<T>) getConnectionInternal();
		if (result != null) {
			postConnection(result, statsObtainTime);
		}

		return result;
	}
1086068
final public int getConnectionCount() {
		int total = 0;
		synchronized(poolLock) {
			for(PooledConnection<C> pooledConnection : allConnections) {
				if(pooledConnection.connection!=null) total++;
			}
		}
		return total;
	}
217876
public long getMemoryUsageBytes() {
    long total = 0;
    for (int i = 0; i < maps_.length; i++) {
      if (maps_[i] != null) {
        total += maps_[i].getMemoryUsageBytes();
      }
    }
    return total;
  }
754590
public static long usedMemory() {
        long memory = 0;
        for (MemoryPoolMXBean mp : ManagementFactory.getMemoryPoolMXBeans()) {
            memory += mp.getUsage().getUsed();
        }
        return memory;
    }
838260
public StatisticImpl[] getJ2EEStatistics() {
        ArrayList members = copyStatistics();
        if (members == null || members.size() == 0)
            return new StatisticImpl[0];

        StatisticImpl[] ret = new StatisticImpl[members.size()];
        for (int i = 0; i < ret.length; i++) {
            ret[i] = (StatisticImpl) members.get(i);
        }
        return ret;
    }
506749
public int getDataSize() {
        // Data size is given by lvs
        int size = 0;
        for(int i=0; i<numLVs; i++) {
            size += IOUtils.toInt(lvs[i]);
        }
        return size;
    }
803212
public static PagerStats getDatabaseInfo() {
        PagerStats stats = new PagerStats();
        nativeGetPagerStats(stats);
        stats.dbStats = SQLiteDatabase.getDbStats();
        return stats;
    }
945989
public DbInfo info() {
        return client.couchDbClient.get(new DatabaseURIHelper(db.getDBUri()).getDatabaseUri(),
                DbInfo.class);
    }
1272172
@Override
    public String[] getAllCacheStatistics() {
        DCache cache = null;
        if (ServerCache.servletCacheEnabled) {
            cache = ServerCache.cache;
        }
        String stats[] = null;
        if (cache != null) {
            Map statistics = getCacheStatisticsMap(cache.getCacheStatistics());
            Iterator keys = statistics.keySet().iterator();
            Iterator values = statistics.values().iterator();
            stats = new String[statistics.size()];
            int i = 0;
            while (keys.hasNext()) {
                stats[i] = keys.next() + "=" + values.next();
                i++;
            }
        } else {
            stats = new String[0];
            // DYNA1059W=DYNA1059W: WebSphere Dynamic Cache instance named {0} cannot be used because of Dynamic Servlet cache service has not be started.
            Tr.error(tc, "DYNA1059W", new Object[] { DCacheBase.DEFAULT_CACHE_NAME });
        }

        return stats;
    }
479358
public StatisticImpl getStatistic() {
        StatisticImpl aggStat = getSpdDouble().getStatistic();
        aggStat.setLastSampleTime(PmiUtil.currentTime());
        return aggStat;
    }
767936
public static Connection getConnection() {
        Connection connection = tl_conn.get();
        try {
            // 若tl.get()返回不是null说明当前线程有事务连接，直接返回事务连接
            if (connection != null) {
                return connection;
            }
            // 若为null则从连接池里返回一个连接
            connection = dataSource.getConnection();
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
        return connection;
    }
1142335
public com.google.api.ads.admanager.axis.v201805.Stats getStats() {
        return stats;
    }
1028708
public Connection getConnection() throws IOException {
		Connection conn = null;
		if (this.datasource != null) {
			try {
				conn = this.datasource.getConnection();
			} catch (SQLException e) {
				throw new IOException(e);
			}
		}
		return conn;
	}
436855
@Override
  public final synchronized int getIdDatabase() {
    if (this.idDatabase == 0) {
      try {
        String query = "select count(*) as TOTALROWS from " + DatabaseInfo.class
          .getSimpleName().toUpperCase() + ";";
        Integer rowCount = evalIntegerResult(query, "TOTALROWS");
        if (rowCount != 1) {
          throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE,
            "database_info_config_error");
        }
        query = "select DATABASEID from " + DatabaseInfo.class
          .getSimpleName().toUpperCase() + ";";
        Integer databaseId = evalIntegerResult(query, "DATABASEID");
        if (databaseId == null) {
          throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE,
            "database_info_config_error");
        }
        this.idDatabase = databaseId;
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return this.idDatabase;
  }
208156
public static synchronized Map<String, Statistics> getStatistics() {
    Map<String, Statistics> result = new HashMap<String, Statistics>();
    for(Statistics stat: statisticsTable.values()) {
      result.put(stat.getScheme(), stat);
    }
    return result;
  }
1308328
public String getDataset() {
    if (isReference()) {
      final LibrarySet master = (LibrarySet) getCheckedRef(LibrarySet.class, "LibrarySet");
      return master.getDataset();
    }
    return this.dataset;
  }