Skip to content

Commit

Permalink
'#1950: Add a log warning if parsing time is negative.
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Oct 29, 2023
1 parent f399bf5 commit c74a604
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions iped-engine/src/main/java/iped/engine/task/ParsingTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ public void process(IItem evidence) throws Exception {
String parserName = getParserName(parser, evidence.getMetadata().get(Metadata.CONTENT_TYPE));
long st = task == null ? 0 : task.subitemsTime;
long diff = System.nanoTime() / 1000 - start;
if (diff < st) {
LOGGER.warn("{} Negative Parsing Time: {} {} Diff={} SubItemsTime={}",
Thread.currentThread().getName(), evidence.getPath(), parserName, diff, st);
}
synchronized (timesPerParser) {
timesPerParser.merge(parserName, diff - st, Long::sum);
}
Expand Down Expand Up @@ -685,6 +689,7 @@ public void parseEmbedded(InputStream inputStream, ContentHandler handler, Metad
if (reader.setTimeoutPaused(true)) {
long start = System.nanoTime() / 1000;
try {

ProcessTime time = ProcessTime.AUTO;

worker.processNewItem(subItem, time);
Expand Down

0 comments on commit c74a604

Please sign in to comment.