Search in sources :

Example 61 with Statistics

use of org.apache.geode.Statistics in project geode by apache.

the class InternalDistributedSystem method createOsStatistics.

public Statistics createOsStatistics(StatisticsType type, String textId, long numericId, int osStatFlags) {
    if (this.statsDisabled) {
        return new DummyStatisticsImpl(type, textId, numericId);
    }
    long myUniqueId = statsListUniqueId.getAndIncrement();
    Statistics result = new LocalStatisticsImpl(type, textId, numericId, myUniqueId, false, osStatFlags, this);
    synchronized (statsList) {
        statsList.add(result);
        statsListModCount++;
    }
    return result;
}
Also used : LocalStatisticsImpl(org.apache.geode.internal.statistics.LocalStatisticsImpl) Statistics(org.apache.geode.Statistics) LinuxProcFsStatistics(org.apache.geode.internal.statistics.platform.LinuxProcFsStatistics) DummyStatisticsImpl(org.apache.geode.internal.statistics.DummyStatisticsImpl)

Example 62 with Statistics

use of org.apache.geode.Statistics in project geode by apache.

the class InternalDistributedSystem method findStatisticsByNumericId.

public Statistics[] findStatisticsByNumericId(final long numericId) {
    final ArrayList hits = new ArrayList();
    visitStatistics(new StatisticsVisitor() {

        public void visit(Statistics s) {
            if (numericId == s.getNumericId()) {
                hits.add(s);
            }
        }
    });
    Statistics[] result = new Statistics[hits.size()];
    return (Statistics[]) hits.toArray(result);
}
Also used : CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList) Statistics(org.apache.geode.Statistics) LinuxProcFsStatistics(org.apache.geode.internal.statistics.platform.LinuxProcFsStatistics)

Example 63 with Statistics

use of org.apache.geode.Statistics in project geode by apache.

the class InternalDistributedSystem method findStatisticsByTextId.

public Statistics[] findStatisticsByTextId(final String textId) {
    final ArrayList hits = new ArrayList();
    visitStatistics(new StatisticsVisitor() {

        public void visit(Statistics s) {
            if (s.getTextId().equals(textId)) {
                hits.add(s);
            }
        }
    });
    Statistics[] result = new Statistics[hits.size()];
    return (Statistics[]) hits.toArray(result);
}
Also used : CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList) Statistics(org.apache.geode.Statistics) LinuxProcFsStatistics(org.apache.geode.internal.statistics.platform.LinuxProcFsStatistics)

Example 64 with Statistics

use of org.apache.geode.Statistics in project geode by apache.

the class MemberLevelDiskMonitor method stopListener.

@Override
public void stopListener() {
    for (Statistics stat : listeners.keySet()) {
        ValueMonitor monitor = monitors.get(stat);
        monitor.removeListener(listeners.get(stat));
        monitor.removeStatistics(stat);
    }
    listeners.clear();
    monitors.clear();
}
Also used : Statistics(org.apache.geode.Statistics) ValueMonitor(org.apache.geode.internal.statistics.ValueMonitor)

Example 65 with Statistics

use of org.apache.geode.Statistics in project geode by apache.

the class MemberMBeanBridge method addDistributionStats.

public void addDistributionStats(DistributionStats distributionStats) {
    Statistics dsStats = distributionStats.getStats();
    monitor.addStatisticsToMonitor(dsStats);
}
Also used : Statistics(org.apache.geode.Statistics) LRUStatistics(org.apache.geode.internal.cache.lru.LRUStatistics)

Aggregations

Statistics (org.apache.geode.Statistics)74 StatisticsType (org.apache.geode.StatisticsType)36 Test (org.junit.Test)34 IntegrationTest (org.apache.geode.test.junit.categories.IntegrationTest)29 StatisticDescriptor (org.apache.geode.StatisticDescriptor)18 File (java.io.File)17 ArrayList (java.util.ArrayList)12 List (java.util.List)12 StatValue (org.apache.geode.internal.statistics.StatArchiveReader.StatValue)11 TestStatArchiveWriter (org.apache.geode.internal.statistics.TestStatArchiveWriter)10 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)6 LRUStatistics (org.apache.geode.internal.cache.lru.LRUStatistics)6 HashMap (java.util.HashMap)5 LinuxProcFsStatistics (org.apache.geode.internal.statistics.platform.LinuxProcFsStatistics)5 Iterator (java.util.Iterator)4 Map (java.util.Map)4 FlakyTest (org.apache.geode.test.junit.categories.FlakyTest)4 MainWithChildrenRollingFileHandler (org.apache.geode.internal.io.MainWithChildrenRollingFileHandler)3 Before (org.junit.Before)3 IOException (java.io.IOException)2