Exemplo n.º 1
0
  /** Statistics */
  public LockStats lockStat(StatsConfig config) throws DatabaseException {

    StatGroup latchStats = new StatGroup("Locktable latches", "Shows lock table contention");
    for (int i = 0; i < nLockTables; i++) {
      latchStats.addAll(lockTableLatches[i].getLatchStats());
    }

    /* Dump info about the lock table. */
    StatGroup tableStats = new StatGroup("Locktable", "The types of locks held in the lock table");
    if (!config.getFast()) {
      dumpLockTable(tableStats, false /*clear*/);
    }

    return new LockStats(
        stats.cloneGroup(config.getClear()),
        latchStats.cloneGroup(config.getClear()),
        tableStats.cloneGroup(config.getClear()));
  }
Exemplo n.º 2
0
  public StatGroup loadStats(StatsConfig config) {
    StatGroup copyStats = stats.cloneGroup(config.getClear());

    StatGroup latchStats = new StatGroup("Locktable latches", "Shows lock table contention");
    for (int i = 0; i < nLockTables; i++) {
      latchStats.addAll(lockTableLatches[i].getLatchStats());
      if (config.getClear()) {
        lockTableLatches[i].clear();
      }
    }
    /* Add all the latch stats to the whole stats group. */
    copyStats.addAll(latchStats);

    StatGroup tableStats = new StatGroup("Locktable", "The types of locks held in the lock table");
    if (!config.getFast()) {
      dumpLockTable(tableStats, config.getClear());
    }
    /* Add all the lock table stats to the whole stats group. */
    copyStats.addAll(tableStats);

    return copyStats;
  }
  /** @see LockManager#dumpLockTable */
  @Override
  void dumpLockTable(StatGroup stats, boolean clear) throws DatabaseException {

    superiorLockManager.dumpLockTable(stats, clear);
  }