Skip to content

Surajhub21/LogAnalyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LogAnalyzer

LogAnalyzer is a java Spring boot application designed to efficiently parse and analyze log files. This project serves as a practical exploration into the benefits of using a thread pool for concurrent task processing, comparing its performance against single-threaded and traditional multi-threaded models.

🚀 About This Project

The primary goal of this project is to understand and demonstrate how a thread pool can significantly improve the performance of I/O-bound or parallelizable tasks, such as processing multiple log files. By managing a pool of worker threads, the application minimizes the overhead of thread creation and destruction, leading to faster and more efficient log analysis.

This project was built as a learning exercise to deepen my understanding of concurrent programming concepts in java.

✨ Features

  • Concurrent Log Processing: Analyzes multiple log files simultaneously.
  • Efficient Thread Management: Utilizes a thread pool to manage concurrent operations, reducing overhead and improving throughput.
  • Performance Comparison: The design allows for easy comparison between single-threaded, multi-threaded, and thread pool-based approaches.

🛠️ How It Works

The application creates a fixed-size pool of worker threads upon startup. When new log analysis tasks are submitted, they are placed into a queue. Idle threads in the pool pick up tasks from this queue and execute them. This architecture avoids the costly process of creating a new thread for every single task.

🏁 Getting Started

To get a local copy up and running, follow these simple steps.

Prerequisites

  • Java, Spring Boot
  • ThreadPoolExecutor

Installation & Usage

  1. Clone the repository:
    git clone https://github.com/Surajhub21/LogAnalyzer.git
  2. Navigate to the project directory:
    cd LogAnalyzer
  3. Compile the source code:
    javac --release 21 App.java
  4. Run the application:
    ./LogAnalyzer

💡 Learning & Observations

Through this project, I've observed the following:

  • Reduced Latency: The thread pool model shows significantly lower delay in processing tasks compared to creating new threads for each task, especially when dealing with a large number of smaller files.
  • Resource Efficiency: By reusing threads, the application consumes fewer system resources.
  • Scalability: The thread pool approach is more scalable when the number of concurrent tasks increases, providing more consistent performance.

This project has been a fantastic hands-on experience in understanding the practical applications and advantages of advanced concurrency patterns in java.

🤝 Contributing

Contributions, issues, and feature requests are welcome!

About

A ThreadPool based system where background threads are activly watch for logs and give analyze

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages