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);
|
||||
int oldestRecord = log.getOldestRecord();
|
||||
int numRecords = log.getNumberOfRecords();
|
||||
traceln("oldest=" + oldestRecord + ", total=" + numRecords);
|
||||
|
||||
for (int i = oldestRecord; i < oldestRecord + numRecords; i++) {
|
||||
try {
|
||||
record = log.read(i);
|
||||
success++;
|
||||
if (!getVerbose() && (success > 500)) {
|
||||
break; //read plenty
|
||||
}
|
||||
} catch (Win32Exception e) {
|
||||
fail++;
|
||||
traceln("Error reading record " + i + ": " +
|
||||
|
@ -96,6 +100,7 @@ public class TestEventLog extends SigarTestCase {
|
|||
|
||||
log.close();
|
||||
|
||||
traceln("success=" + success + ", fail=" + fail);
|
||||
return success > fail;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue