dont read every record unless verbose
This commit is contained in:
parent
d4f0bab72e
commit
7de3ef0517
|
@ -82,11 +82,15 @@ public class TestEventLog extends SigarTestCase {
|
||||||
log.open(logname);
|
log.open(logname);
|
||||||
int oldestRecord = log.getOldestRecord();
|
int oldestRecord = log.getOldestRecord();
|
||||||
int numRecords = log.getNumberOfRecords();
|
int numRecords = log.getNumberOfRecords();
|
||||||
|
traceln("oldest=" + oldestRecord + ", total=" + numRecords);
|
||||||
|
|
||||||
for (int i = oldestRecord; i < oldestRecord + numRecords; i++) {
|
for (int i = oldestRecord; i < oldestRecord + numRecords; i++) {
|
||||||
try {
|
try {
|
||||||
record = log.read(i);
|
record = log.read(i);
|
||||||
success++;
|
success++;
|
||||||
|
if (!getVerbose() && (success > 500)) {
|
||||||
|
break; //read plenty
|
||||||
|
}
|
||||||
} catch (Win32Exception e) {
|
} catch (Win32Exception e) {
|
||||||
fail++;
|
fail++;
|
||||||
traceln("Error reading record " + i + ": " +
|
traceln("Error reading record " + i + ": " +
|
||||||
|
@ -96,6 +100,7 @@ public class TestEventLog extends SigarTestCase {
|
||||||
|
|
||||||
log.close();
|
log.close();
|
||||||
|
|
||||||
|
traceln("success=" + success + ", fail=" + fail);
|
||||||
return success > fail;
|
return success > fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue