1.
Monitor and analyze web traffic to identify the top-K most frequent requests
2.
Allow configurable time intervals for analysis (e.g., last hour, day, week)
3.
Support adjustable K values to retrieve different numbers of top requests
4.
Provide real-time or near real-time analysis of request patterns
5.
Support filtering and categorization of requests by various attributes (URL, IP, user agent, etc.)
6.
Expose APIs for querying top-K requests and related metrics
7.
Generate reports and visualizations of request patterns
8.
Support historical data analysis and trend identification
POST /api/v1/ingest
{
"timestamp": "2023-03-31T12:34:56Z",
"url": "/products/123",
"method": "GET",
"ip": "192.168.1.1",
"userAgent": "Mozilla/5.0...",
"responseCode": 200,
"responseTime": 45
}
GET /api/v1/top-requests?k=10&timeWindow=hour&startTime=2023-03-31T12:00:00Z
PUT /api/v1/config
{
"defaultK": 100,
"timeWindows": ["minute", "hour", "day", "week"],
"samplingRate": 0.1,
"retentionPeriod": 90
}
GET /api/v1/aggregations?metric=responseTime&groupBy=url&timeWindow=day
[Web Servers] → [Load Balancers] → [Data Collectors]
↓
[Kafka] ← [Stream Processors] → [Redis] ← [Query Service] ← [API Gateway] ← [Clients]
↓ ↓
[HDFS/S3] ← [Batch Processors] → [TimescaleDB]