-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
27 lines (20 loc) · 925 Bytes
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
class Config:
# Kafka configuration
KAFKA_BOOTSTRAP_SERVERS = os.getenv("KAFKA_BOOTSTRAP_SERVERS", "localhost:9092")
KAFKA_TOPIC = os.getenv("KAFKA_TOPIC", "user_activity_logs")
# HDFS configuration
HDFS_OUTPUT_PATH = os.getenv("HDFS_OUTPUT_PATH", "hdfs://namenode:9000/user/hadoop/streaming_output")
HDFS_CHECKPOINT_PATH = os.getenv("HDFS_CHECKPOINT_PATH", "hdfs://namenode:9000/user/hadoop/streaming_checkpoint")
# Aggregation settings
WINDOW_DURATION = "10 minutes"
SLIDE_DURATION = "5 minutes"
WATERMARK_DELAY = "10 minutes"
# Anomaly detection settings
DEFAULT_ACTIVITY_THRESHOLD = 100
MOVING_AVG_WINDOW = 5
STD_DEV_MULTIPLIER = 2.5
# Dashboard/reporting settings
REPORT_OUTPUT_PATH = os.getenv("REPORT_OUTPUT_PATH", "./reports")
# Logging settings
LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")