core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/statistic/OPerformanceStatisticManager.java
private WritCacheCountersHolder fetchWriteCacheCounters() {
    //go through all threads and accumulate statistic only for live threads
    //all dead threads will be removed and statistics from them will be
    //later accumulated in #deadThreadsStatistic field, then result statistic from this field
    //will be aggregated to countersHolder

    //To decrease inter thread communication delay we fetch snapshots first
    //and only after that we aggregate data from immutable snapshots
    final Collection<ORawPair<Thread, PerformanceSnapshot>> snapshots = new ArrayList<>(statistics.size());

    final Collection<Thread> threadsToRemove = new ArrayList<>();
    for (Map.Entry<Thread, OSessionStoragePerformanceStatistic> entry : statistics.entrySet()) {
      final Thread thread = entry.getKey();

      final OSessionStoragePerformanceStatistic statistic = entry.getValue();
      snapshots.add(new ORawPair<>(thread, statistic.getSnapshot()));
    }

    WritCacheCountersHolder holder = null;
    for (ORawPair<Thread, PerformanceSnapshot> pair : snapshots) {
      final Thread thread = pair.getFirst();

      if (thread.isAlive()) {
        final PerformanceSnapshot snapshot = pair.getSecond();

        if (snapshot.writCacheCountersHolder != null) {
          if (holder == null)
            holder = new WritCacheCountersHolder();

          snapshot.writCacheCountersHolder.pushData(holder);
        }
      } else {
        threadsToRemove.add(thread);
      }
    }

    if (!threadsToRemove.isEmpty()) {
      updateDeadThreadsStatistic(threadsToRemove);
    }

    final ImmutableStatistic ds = deadThreadsStatistic;
    if (ds != null) {
      final WritCacheCountersHolder wch = ds.writCacheCountersHolder;
      if (wch != null) {
        if (holder == null)
          holder = new WritCacheCountersHolder();

        wch.pushData(holder);
      }
    }

    return holder;
  }
private WritCacheCountersHolder fetchWriteCacheCounters() {
    //go through all threads and accumulate statistic only for live threads
    //all dead threads will be removed and statistics from them will be
    //later accumulated in #deadThreadsStatistic field, then result statistic from this field
    //will be aggregated to countersHolder

    //To decrease inter thread communication delay we fetch snapshots first
    //and only after that we aggregate data from immutable snapshots
    final Collection<ORawPair<Thread, PerformanceSnapshot>> snapshots = new ArrayList<>(statistics.size());

    final Collection<Thread> threadsToRemove = new ArrayList<>();
    for (Map.Entry<Thread, OSessionStoragePerformanceStatistic> entry : statistics.entrySet()) {
      final Thread thread = entry.getKey();

      final OSessionStoragePerformanceStatistic statistic = entry.getValue();
      snapshots.add(new ORawPair<>(thread, statistic.getSnapshot()));
    }

    WritCacheCountersHolder holder = null;
    for (ORawPair<Thread, PerformanceSnapshot> pair : snapshots) {
      final Thread thread = pair.getFirst();

      if (thread.isAlive()) {
        final PerformanceSnapshot snapshot = pair.getSecond();

        if (snapshot.writCacheCountersHolder != null) {
          if (holder == null)
            holder = new WritCacheCountersHolder();

          snapshot.writCacheCountersHolder.pushData(holder);
        }
      } else {
        threadsToRemove.add(thread);
      }
    }

    if (!threadsToRemove.isEmpty()) {
      updateDeadThreadsStatistic(threadsToRemove);
    }

    final ImmutableStatistic ds = deadThreadsStatistic;
    if (ds != null) {
      final WritCacheCountersHolder wch = ds.writCacheCountersHolder;
      if (wch != null) {
        if (holder == null)
          holder = new WritCacheCountersHolder();

        wch.pushData(holder);
      }
    }

    return holder;
  }
private WritCacheCountersHolder fetchWriteCacheCounters ( ) { //go through all threads and accumulate statistic only for live threads //all dead threads will be removed and statistics from them will be //later accumulated in #deadThreadsStatistic field, then result statistic from this field //will be aggregated to countersHolder //To decrease inter thread communication delay we fetch snapshots first //and only after that we aggregate data from immutable snapshots final Collection < ORawPair < Thread , PerformanceSnapshot > > snapshots = new ArrayList <> ( statistics . size ( ) ) ; final Collection < Thread > threadsToRemove = new ArrayList <> ( ) ; for ( Map . Entry < Thread , OSessionStoragePerformanceStatistic > entry : statistics . entrySet ( ) ) { final Thread thread = entry . getKey ( ) ; final OSessionStoragePerformanceStatistic statistic = entry . getValue ( ) ; snapshots . add ( new ORawPair <> ( thread , statistic . getSnapshot ( ) ) ) ; } WritCacheCountersHolder holder = null ; for ( ORawPair < Thread , PerformanceSnapshot > pair : snapshots ) { final Thread thread = pair . getFirst ( ) ; if ( thread . isAlive ( ) ) { final PerformanceSnapshot snapshot = pair . getSecond ( ) ; if ( snapshot . writCacheCountersHolder != null ) { if ( holder == null ) holder = new WritCacheCountersHolder ( ) ; snapshot . writCacheCountersHolder . pushData ( holder ) ; } } else { threadsToRemove . add ( thread ) ; } } if ( ! threadsToRemove . isEmpty ( ) ) { updateDeadThreadsStatistic ( threadsToRemove ) ; } final ImmutableStatistic ds = deadThreadsStatistic ; if ( ds != null ) { final WritCacheCountersHolder wch = ds . writCacheCountersHolder ; if ( wch != null ) { if ( holder == null ) holder = new WritCacheCountersHolder ( ) ; wch . pushData ( holder ) ; } } return holder ; }
Iterates over all live threads and accumulates write performance statics gathered form threads,
also accumulates statistic from dead threads which were alive when when gathering of performance measurements is started.

@return Aggregated write cache performance statistic
Iterates over all live threads and accumulates write performance statics gathered form threads also accumulates statistic from dead threads which were alive when when gathering of performance measurements is started .