Search in sources :

Example 1 with Disk

use of org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.Disk in project tracecompass by tracecompass.

the class InputOutputDiskTest method testSectorsAt.

/**
 * Test the {@link Disk#getSectorsAt(long, IoOperationType)} method
 * method
 */
@Test
public void testSectorsAt() {
    InputOutputAnalysisModule module = setUp(fTestCase.getTraceFileName());
    for (Integer deviceId : fTestCase.getSectorCount().keySet()) {
        Disk disk = getDisk(module, deviceId);
        assertNotNull(disk);
        for (SectorCountInfo info : fTestCase.getSectorCount().get(deviceId)) {
            double sectorsAt = disk.getSectorsAt(info.getTimestamp(), info.getType());
            assertEquals("Sectors at " + info.getTimestamp() + " for type " + info.getType(), info.getNbSectors(), sectorsAt, 1.0);
        }
    }
}
Also used : InputOutputAnalysisModule(org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.InputOutputAnalysisModule) SectorCountInfo(org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.inputoutput.IoTestCase.SectorCountInfo) Disk(org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.Disk) Test(org.junit.Test)

Example 2 with Disk

use of org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.Disk in project tracecompass by tracecompass.

the class InputOutputDiskTest method testDeviceStrings.

/**
 * Test the {@link Disk#getDeviceIdString()} and
 * {@link Disk#getDiskName()} methods
 */
@Test
public void testDeviceStrings() {
    InputOutputAnalysisModule module = setUp(fTestCase.getTraceFileName());
    for (Entry<Integer, DiskInfo> deviceInfo : fTestCase.getDiskInfo().entrySet()) {
        Integer deviceId = deviceInfo.getKey();
        DiskInfo diskInfo = deviceInfo.getValue();
        Disk disk = getDisk(module, deviceId);
        assertNotNull(disk);
        assertEquals("Device ID string for " + deviceId, diskInfo.getDeviceString(), disk.getDeviceIdString());
        assertEquals("Disk name string for " + deviceId, diskInfo.getDeviceName(), disk.getDiskName());
        assertEquals("Disk activity for " + deviceId, diskInfo.hasActivity(), disk.hasActivity());
    }
}
Also used : DiskInfo(org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.inputoutput.IoTestCase.DiskInfo) InputOutputAnalysisModule(org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.InputOutputAnalysisModule) Disk(org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.Disk) Test(org.junit.Test)

Example 3 with Disk

use of org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.Disk in project tracecompass by tracecompass.

the class InputOutputInformationProviderTest method testGetDisks.

/**
 * Test the
 * {@link InputOutputInformationProvider#getDisks(InputOutputAnalysisModule)}
 * method
 */
@Test
public void testGetDisks() {
    InputOutputAnalysisModule module = setUp(fTestCase.getTraceFileName());
    Collection<Disk> disks = InputOutputInformationProvider.getDisks(module);
    assertEquals(fDiskCount, disks.size());
}
Also used : InputOutputAnalysisModule(org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.InputOutputAnalysisModule) Disk(org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.Disk) Test(org.junit.Test)

Aggregations

Disk (org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.Disk)3 InputOutputAnalysisModule (org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.InputOutputAnalysisModule)3 Test (org.junit.Test)3 DiskInfo (org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.inputoutput.IoTestCase.DiskInfo)1 SectorCountInfo (org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.inputoutput.IoTestCase.SectorCountInfo)1