Search in sources :

Example 21 with LogRequest

use of com.emc.vipr.model.sys.logging.LogRequest in project coprhd-controller by CoprHD.

the class LogStreamMergerPerfTest method testMergePerformanceTimeRangeFilter.

@Test
@Ignore
public void testMergePerformanceTimeRangeFilter() throws Exception {
    List<String> svcs = new ArrayList<String>() {

        {
            add("controllersvc");
            add("coordinatorsvc");
            add("apisvc");
        }
    };
    Calendar calendar = Calendar.getInstance();
    calendar.set(2013, 10, 20, 16, 38, 16);
    Date startTimeFilter = calendar.getTime();
    calendar.set(2014, 0, 16, 16, 38, 0);
    Date endTimeFilter = calendar.getTime();
    LogRequest req = new LogRequest.Builder().startTime(startTimeFilter).endTime(endTimeFilter).baseNames(svcs).build();
    LogStreamMerger merger = new LogStreamMerger(req, propertiesLoader);
    long startTime = System.nanoTime();
    while (true) {
        LogMessage log = merger.readNextMergedLogMessage();
        if (log == null) {
            break;
        }
    }
    long endTime = System.nanoTime();
    int num = merger.getStreamList().length;
    long totalSize = 0;
    for (int i = 0; i < num; i++) {
        totalSize += merger.getStreamList()[i].getTotalSizeCount();
    }
    totalSize = totalSize / (1024L * 1024L);
    double elapsedTime = (double) (endTime - startTime) / 1000000000.0;
    System.out.println("Performance with time range filter");
    System.out.println("Total read " + totalSize + " MB;" + " Average " + (totalSize / elapsedTime) + " MB/sec.");
}
Also used : LogRequest(com.emc.vipr.model.sys.logging.LogRequest) LogMessage(com.emc.storageos.systemservices.impl.logsvc.LogMessage) Calendar(java.util.Calendar) ArrayList(java.util.ArrayList) LogStreamMerger(com.emc.storageos.systemservices.impl.logsvc.merger.LogStreamMerger) Date(java.util.Date) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 22 with LogRequest

use of com.emc.vipr.model.sys.logging.LogRequest in project coprhd-controller by CoprHD.

the class LogStreamMergerPerfTest method testMergePerformanceMultipleFilters.

@Test
@Ignore
public void testMergePerformanceMultipleFilters() throws Exception {
    List<String> svcs = new ArrayList<String>() {

        {
            add("controllersvc");
            add("coordinatorsvc");
            add("apisvc");
        }
    };
    String pattern = "Memory";
    Calendar calendar = Calendar.getInstance();
    calendar.set(2013, 10, 20, 16, 38, 16);
    Date startTimeFilter = calendar.getTime();
    calendar.set(2014, 0, 16, 16, 38, 0);
    Date endTimeFilter = calendar.getTime();
    LogRequest req = new LogRequest.Builder().startTime(startTimeFilter).endTime(endTimeFilter).logLevel(7).regex(pattern).baseNames(svcs).build();
    LogStreamMerger merger = new LogStreamMerger(req, propertiesLoader);
    long startTime = System.nanoTime();
    while (true) {
        LogMessage log = merger.readNextMergedLogMessage();
        if (log == null) {
            break;
        }
    }
    long endTime = System.nanoTime();
    int num = merger.getStreamList().length;
    long totalSize = 0;
    for (int i = 0; i < num; i++) {
        totalSize += merger.getStreamList()[i].getTotalSizeCount();
    }
    totalSize = totalSize / (1024L * 1024L);
    double elapsedTime = (double) (endTime - startTime) / 1000000000.0;
    System.out.println("Performance with time, level, pattern filters");
    System.out.println("Total read " + totalSize + " MB;" + " Average " + (totalSize / elapsedTime) + " MB/sec.");
}
Also used : LogRequest(com.emc.vipr.model.sys.logging.LogRequest) LogMessage(com.emc.storageos.systemservices.impl.logsvc.LogMessage) Calendar(java.util.Calendar) ArrayList(java.util.ArrayList) LogStreamMerger(com.emc.storageos.systemservices.impl.logsvc.merger.LogStreamMerger) Date(java.util.Date) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 23 with LogRequest

use of com.emc.vipr.model.sys.logging.LogRequest in project coprhd-controller by CoprHD.

the class LogStreamPerfTest method testPerformanceNoFilter.

/**
 * Test performance without filter
 */
@Test
@Ignore
public void testPerformanceNoFilter() throws Exception {
    System.out.println("starting testPerformanceNoFilter");
    String svcName = "bigFile-dbsvc";
    LogRequest req = new LogRequest.Builder().build();
    LogStatusInfo status = new LogStatusInfo();
    LogFileStream stream = new LogFileStream(svcName, new ArrayList<File>(), req, status);
    long startTime = 0;
    long endTime = 0;
    startTime = System.nanoTime();
    while (true) {
        LogMessage log = stream.readNextLogMessage();
        if (log == null) {
            endTime = System.nanoTime();
            break;
        }
    }
    double fileSize = (double) stream.getTotalSizeCount() / (1024L * 1024L);
    double elapsedTime = (double) (endTime - startTime) / 1000000000.0;
    double speed = fileSize / elapsedTime;
    // System.out.println("Total files size(after compressed) is " +
    // fileSize + "MB. Log messages count is "
    // + stream.getTotalLogCount());
    // System.out.println("Speed of LogStream without Filter is: " + speed
    // + " MB/sed");
    System.out.println("Total files size(after decompressing) is 4286.8 MB. Log messages count is " + stream.getTotalLogCount());
    System.out.println("Speed of LogStream without Filter is: " + 4286.8 / elapsedTime + " MB/sec and " + stream.getTotalLogCount() / elapsedTime + " logs/sec");
    System.out.println("done testPerformanceNoFilter");
}
Also used : LogRequest(com.emc.vipr.model.sys.logging.LogRequest) LogStatusInfo(com.emc.storageos.systemservices.impl.logsvc.LogStatusInfo) LogFileStream(com.emc.storageos.systemservices.impl.logsvc.stream.LogFileStream) LogMessage(com.emc.storageos.systemservices.impl.logsvc.LogMessage) File(java.io.File) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 24 with LogRequest

use of com.emc.vipr.model.sys.logging.LogRequest in project coprhd-controller by CoprHD.

the class LogStreamPerfTest method testPerformanceMultipleFilters.

/**
 * Test performance with time, level and pattern filters, the speed should
 * be faster than 50 Mbs
 */
@Test
@Ignore
public void testPerformanceMultipleFilters() throws Exception {
    System.out.println("starting testPerformanceMultipleFilters");
    String svcName = "bigFile-dbsvc";
    String pattern = "Memory";
    Calendar calendar = Calendar.getInstance();
    calendar.set(2013, 10, 20, 16, 38, 16);
    Date startTimeFilter = calendar.getTime();
    calendar.set(2014, 0, 16, 16, 38, 0);
    Date endTimeFilter = calendar.getTime();
    LogRequest req = new LogRequest.Builder().startTime(startTimeFilter).endTime(endTimeFilter).logLevel(7).regex(pattern).build();
    LogStatusInfo status = new LogStatusInfo();
    LogFileStream stream = new LogFileStream(svcName, new ArrayList<File>(), req, status);
    long startTime = 0;
    long endTime = 0;
    startTime = System.nanoTime();
    while (true) {
        LogMessage log = stream.readNextLogMessage();
        if (log == null) {
            endTime = System.nanoTime();
            break;
        }
    }
    double fileSize = (double) stream.getTotalSizeCount() / (1024L * 1024L);
    double elapsedTime = (double) (endTime - startTime) / 1000000000.0;
    double speed = fileSize / elapsedTime;
    System.out.println("Total files size is " + fileSize + "MB. Log messages count is " + stream.getTotalLogCount());
    System.out.println("Speed of LogStream with multiple Filters is: " + speed + " Mbs");
    System.out.println("Total files size(after decompressing) is 3436.7 MB. Log messages count is " + stream.getTotalLogCount());
    System.out.println("Speed of LogStream with multiple Filters is: " + 3436.7 / elapsedTime + " MB/sec");
    System.out.println("done testPerformanceMultipleFilters");
}
Also used : LogRequest(com.emc.vipr.model.sys.logging.LogRequest) LogStatusInfo(com.emc.storageos.systemservices.impl.logsvc.LogStatusInfo) LogFileStream(com.emc.storageos.systemservices.impl.logsvc.stream.LogFileStream) LogMessage(com.emc.storageos.systemservices.impl.logsvc.LogMessage) Calendar(java.util.Calendar) File(java.io.File) Date(java.util.Date) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 25 with LogRequest

use of com.emc.vipr.model.sys.logging.LogRequest in project coprhd-controller by CoprHD.

the class LogStreamPerfTest method testPerformanceTimeFilter.

/**
 * Test performance with time range filter
 */
@Test
@Ignore
public void testPerformanceTimeFilter() throws Exception {
    System.out.println("starting testPerformanceTimeFilter");
    String svcName = "bigFile-dbsvc";
    Calendar calendar = Calendar.getInstance();
    calendar.set(2013, 10, 20, 16, 38, 16);
    Date startTimeFilter = calendar.getTime();
    calendar.set(2014, 0, 16, 16, 38, 0);
    Date endTimeFilter = calendar.getTime();
    LogRequest req = new LogRequest.Builder().startTime(startTimeFilter).endTime(endTimeFilter).build();
    LogStatusInfo status = new LogStatusInfo();
    LogFileStream stream = new LogFileStream(svcName, new ArrayList<File>(), req, status);
    long startTime = 0;
    long endTime = 0;
    startTime = System.nanoTime();
    while (true) {
        LogMessage log = stream.readNextLogMessage();
        if (log == null) {
            endTime = System.nanoTime();
            break;
        }
    }
    double fileSize = (double) stream.getTotalSizeCount() / (1024L * 1024L);
    double elapsedTime = (double) (endTime - startTime) / 1000000000.0;
    double speed = fileSize / elapsedTime;
    System.out.println("Total files size is " + fileSize + "MB. Log messages count is " + stream.getTotalLogCount());
    System.out.println("Speed of LogStream with time range Filter is: " + speed + " Mbs");
    System.out.println("Total files size(after decompressing) is 3436.7 MB. Log messages count is " + stream.getTotalLogCount());
    System.out.println("Speed of LogStream with time filter is: " + 3436.7 / elapsedTime + " MB/sec");
    System.out.println("done testPerformanceTimeFilter");
}
Also used : LogRequest(com.emc.vipr.model.sys.logging.LogRequest) LogStatusInfo(com.emc.storageos.systemservices.impl.logsvc.LogStatusInfo) LogFileStream(com.emc.storageos.systemservices.impl.logsvc.stream.LogFileStream) LogMessage(com.emc.storageos.systemservices.impl.logsvc.LogMessage) Calendar(java.util.Calendar) File(java.io.File) Date(java.util.Date) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

LogRequest (com.emc.vipr.model.sys.logging.LogRequest)38 Test (org.junit.Test)33 ArrayList (java.util.ArrayList)21 File (java.io.File)17 LogMessage (com.emc.storageos.systemservices.impl.logsvc.LogMessage)15 LogFileStream (com.emc.storageos.systemservices.impl.logsvc.stream.LogFileStream)13 Calendar (java.util.Calendar)13 Date (java.util.Date)13 LogStatusInfo (com.emc.storageos.systemservices.impl.logsvc.LogStatusInfo)12 Ignore (org.junit.Ignore)12 LogReader (com.emc.storageos.systemservices.impl.logsvc.stream.LogReader)10 LogStreamMerger (com.emc.storageos.systemservices.impl.logsvc.merger.LogStreamMerger)4 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)2 SysClientFactory (com.emc.storageos.systemservices.impl.client.SysClientFactory)2 LogNetworkWriter (com.emc.storageos.systemservices.impl.logsvc.LogNetworkWriter)2 LogNetworkStreamMerger (com.emc.storageos.systemservices.impl.logsvc.merger.LogNetworkStreamMerger)2 LogNetworkReader (com.emc.storageos.systemservices.impl.logsvc.stream.LogNetworkReader)2 NodeInfo (com.emc.storageos.systemservices.impl.resource.util.NodeInfo)2 BufferedReader (java.io.BufferedReader)2 FileReader (java.io.FileReader)2