Fix mock tests

This commit is contained in:
Tour
2025-12-07 06:32:03 +01:00
parent ef804b3896
commit 3efa83bc44
15 changed files with 18 additions and 15 deletions

View File

@@ -208,7 +208,7 @@ ENTRYPOINT ["java", "-jar", "/app/quarkus-run.jar"]
version: '3.8' version: '3.8'
services: services:
auction-monitor: auction-monitor:
build: . build: ../wiki
ports: ports:
- "8081:8081" - "8081:8081"
volumes: volumes:
@@ -218,7 +218,7 @@ services:
- AUCTION_DATABASE_PATH=/mnt/okcomputer/output/cache.db - AUCTION_DATABASE_PATH=/mnt/okcomputer/output/cache.db
- AUCTION_NOTIFICATION_CONFIG=desktop - AUCTION_NOTIFICATION_CONFIG=desktop
healthcheck: healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:8081/health/live"] test: [ "CMD", "wget", "--spider", "http://localhost:8081/health/live" ]
interval: 30s interval: 30s
restart: unless-stopped restart: unless-stopped
``` ```

View File

@@ -361,14 +361,14 @@ WHERE id NOT IN (
## 📈 Performance Comparison ## 📈 Performance Comparison
| Metric | Before (Monitor Downloads) | After (Scraper Downloads) | | Metric | Before (Monitor Downloads) | After (Scraper Downloads) |
|--------|---------------------------|---------------------------| |----------------------|---------------------------------|---------------------------|
| **Image records** | 57,376,293 | ~16,807 | | **Image records** | 57,376,293 | ~16,807 |
| **Duplicates** | 57,359,486 (99.97%!) | 0 | | **Duplicates** | 57,359,486 (99.97%!) | 0 |
| **Network I/O** | Monitor process | Scraper process | | **Network I/O** | Monitor process | Scraper process |
| **Disk usage** | 0 (URLs only) | ~1.6GB (actual files) | | **Disk usage** | 0 (URLs only) | ~1.6GB (actual files) |
| **Processing speed** | 500ms/image (download + detect) | 100ms/image (detect only) | | **Processing speed** | 500ms/image (download + detect) | 100ms/image (detect only) |
| **Error handling** | Complex (download failures) | Simple (files exist) | | **Error handling** | Complex (download failures) | Simple (files exist) |
## 🎓 Code Examples by Language ## 🎓 Code Examples by Language

View File

@@ -495,19 +495,22 @@ public class AuctionMonitorResource {
)); ));
} }
// Add geographic insight // Add geographic insight (filter out null countries)
String topCountry = auctions.stream() String topCountry = auctions.stream()
.filter(a -> a.country() != null)
.collect(Collectors.groupingBy(AuctionInfo::country, Collectors.counting())) .collect(Collectors.groupingBy(AuctionInfo::country, Collectors.counting()))
.entrySet().stream() .entrySet().stream()
.max(Map.Entry.comparingByValue()) .max(Map.Entry.comparingByValue())
.map(Map.Entry::getKey) .map(Map.Entry::getKey)
.orElse("N/A"); .orElse("N/A");
insights.add(Map.of( if (!"N/A".equals(topCountry)) {
"icon", "fa-globe", insights.add(Map.of(
"title", topCountry + " leading", "icon", "fa-globe",
"description", "Top performing country" "title", topCountry + " leading",
)); "description", "Top performing country"
));
}
// Add sleeper lots insight // Add sleeper lots insight
long sleeperCount = lots.stream().filter(Lot::isSleeperLot).count(); long sleeperCount = lots.stream().filter(Lot::isSleeperLot).count();