Search in sources :

Example 1 with StatSpec

use of org.apache.geode.internal.SystemAdmin.StatSpec in project geode by apache.

the class StatUtils method addResourceInstsToSet.

private static void addResourceInstsToSet(final File archiveFile, final String specString, final Set<ResourceInst> resourceInsts) throws IOException {
    StatSpec statSpec = new StatSpec(specString);
    StatArchiveReader reader = new StatArchiveReader(new File[] { archiveFile }, new StatSpec[] { statSpec }, true);
    StatValue[] statValues = reader.matchSpec(statSpec);
    for (StatValue statValue : statValues) {
        for (ResourceInst resourceInst : statValue.getResources()) {
            resourceInsts.add(resourceInst);
        }
    }
}
Also used : ResourceInst(org.apache.geode.internal.statistics.StatArchiveReader.ResourceInst) StatSpec(org.apache.geode.internal.SystemAdmin.StatSpec) StatValue(org.apache.geode.internal.statistics.StatArchiveReader.StatValue)

Example 2 with StatSpec

use of org.apache.geode.internal.SystemAdmin.StatSpec in project geode by apache.

the class StatArchiveWithConsecutiveResourceInstIntegrationTest method setUp.

@Before
public void setUp() throws Exception {
    URL url = getClass().getResource(ARCHIVE_FILE_NAME);
    this.archiveFile = this.temporaryFolder.newFile(ARCHIVE_FILE_NAME);
    FileUtils.copyURLToFile(url, archiveFile);
    this.statSpec = new StatSpec(STATS_SPEC_STRING);
    // precondition
    assertThat(this.archiveFile).exists();
}
Also used : StatSpec(org.apache.geode.internal.SystemAdmin.StatSpec) URL(java.net.URL) Before(org.junit.Before)

Aggregations

StatSpec (org.apache.geode.internal.SystemAdmin.StatSpec)2 URL (java.net.URL)1 ResourceInst (org.apache.geode.internal.statistics.StatArchiveReader.ResourceInst)1 StatValue (org.apache.geode.internal.statistics.StatArchiveReader.StatValue)1 Before (org.junit.Before)1