Skip to content

Commit de42f37

Browse files
authored
Merge pull request #6646 from kingthorin/td-maint
tech detection: Make load time human readable & maint
2 parents a0de070 + 5e7c438 commit de42f37

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

addOns/wappalyzer/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ All notable changes to this add-on will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

66
## Unreleased
7-
7+
### Changed
8+
- During load the time taken to process the data files will be shown in human readable format (generally seconds), as well as milliseconds (ms).
9+
- Maintenance changes.
810

911
## [21.47.0] - 2025-07-15
1012
### Changed

addOns/wappalyzer/src/main/java/org/zaproxy/zap/extension/wappalyzer/TechsJsonParser.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import javax.swing.ImageIcon;
4646
import net.sf.json.JSONArray;
4747
import net.sf.json.JSONObject;
48+
import org.apache.commons.lang3.time.DurationFormatUtils;
4849
import org.apache.logging.log4j.LogManager;
4950
import org.apache.logging.log4j.Logger;
5051
import org.jsoup.select.QueryParser;
@@ -103,11 +104,12 @@ TechData parse(String categories, List<String> technologies, boolean createIcons
103104
// Note: Based on testing having the forEach separate performs faster than chaining it
104105
futures.forEach(CompletableFuture::join);
105106
executor.shutdown();
106-
Instant finish = Instant.now();
107+
long loadTime = Duration.between(start, Instant.now()).toMillis();
107108
LOGGER.info(
108-
"Loaded {} Tech Detection technologies, in {}ms",
109+
"Loaded {} Tech Detection technologies, in {} ({}ms)",
109110
techData.getApplications().size(),
110-
Duration.between(start, finish).toMillis());
111+
DurationFormatUtils.formatDurationWords(loadTime, true, true),
112+
loadTime);
111113
return techData;
112114
}
113115

@@ -404,6 +406,9 @@ private List<Map<String, Map<String, Map<String, AppPattern>>>> jsonToAppPattern
404406
}
405407
}
406408
}
409+
} else if (json instanceof JSONArray) {
410+
// DOM Pattern JSONArrays are ignored here
411+
// They will be added as Simple DOM Patterns
407412
} else {
408413
LOGGER.debug(
409414
"Unexpected JSON type for {} pattern: {} {}",

0 commit comments

Comments
 (0)