A Java CLI tool that processes large log files and produces severity counts (INFO/WARN/ERROR).
Includes a single-thread baseline and a multi-thread implementation using ExecutorService, Callable, and Future, with correctness verification across thread counts.
- Single-thread log processing (baseline)
- Multi-thread processing with fixed thread pool
- Chunk-based parallel processing
- Timing breakdown: read time, processing time, total time
- Correctness verification (multi-thread results must match baseline)
- CLI arguments:
--fileand--threads - Benchmark runner for 1/2/4/8 threads
processor/SingleThreadProcessor– baseline (streaming read + count)processor/MultiThreadProcessor– thread pool processing + mergemodel/ProcessingResult– holds counts and timing statsLogFileGenerator– generates large test log filesBenchmarkRunner– runs benchmarks across thread counts
Run:
LogFileGenerator
It creates: logs/big.log (default 500,000 lines)
Run:
Main
Program arguments example:
--file=logs/big.log --threads=8Run:
BenchmarkRunner
Baseline (single-thread): 87 ms
| Threads | Read (ms) | Process (ms) | Total (ms) | Match Baseline |
|---|---|---|---|---|
| 1 | 54 | 37 | 92 | ✅ |
| 2 | 38 | 32 | 71 | ✅ |
| 4 | 82 | 5 | 87 | ✅ |
| 8 | 54 | 4 | 58 | ✅ |
Note: Total time varies due to disk I/O and OS scheduling. Processing time scales with threads, while read time may fluctuate.