Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Request Window Monitor

A Java project that tracks how many requests were received within a recent time window.

Why I Built This

This project was built to practice queues and understand how systems monitor recent activity without storing old, unnecessary data.

How It Works

The program stores request timestamps in a queue.

When a new request arrives:

  1. Add the timestamp to the queue.
  2. Remove requests that are outside the time window.
  3. Return the number of requests currently inside the window.

Technologies Used

  • Java
  • Queue
  • LinkedList

Concepts Practiced

  • Queue Data Structure
  • Sliding Window Technique
  • Time-Based Processing

Sample Output

Request at 1 ms    -> 1 request(s) in window
Request at 100 ms  -> 2 request(s) in window
Request at 3001 ms -> 3 request(s) in window
Request at 3002 ms -> 3 request(s) in window

What I Learned

How to use a queue and sliding window approach to efficiently track recent events, a technique commonly used in rate limiting and traffic monitoring systems.

About

A Java program that tracks how many requests have been received in a recent time window.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages