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.");
}
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.");
}
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");
}
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");
}
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");
}
Aggregations