This repository was archived by the owner on Jun 13, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
131 lines (120 loc) · 6.84 KB
/
Copy pathconfig.example.yaml
File metadata and controls
131 lines (120 loc) · 6.84 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Sensor Log Generator Configuration Example
# This is a complete example configuration file with all available options
# Configuration version
# Version 1: Basic configuration (backward compatible)
# Version 2: Requires monitoring and dynamic_reloading sections
version: 2
# Database configuration
database:
path: "data/sensor_data.db" # Path to SQLite database file
backup_enabled: true # Enable periodic backups
backup_interval_hours: 24 # Hours between backups
max_backups: 7 # Maximum number of backup files to keep
preserve_existing_db: false # Whether to preserve existing database on startup
max_size_mb: 1000 # Maximum database size in MB (optional)
# Logging configuration
logging:
level: "INFO" # Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL
file: "logs/sensor_simulator.log" # Log file path (optional)
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
console_output: true # Enable console output
max_file_size_mb: 100 # Maximum log file size before rotation
backup_count: 5 # Number of rotated log files to keep
# Random location generation settings
random_location:
enabled: false # Enable random location generation
gps_variation: 10 # GPS variation in meters for fuzzing
city_count: 50 # Number of cities to use for random selection
filter_by: "population" # Filter cities by: population, area, or none
min_population: 100000 # Minimum population for city selection
max_population: 10000000 # Maximum population for city selection
exclude_countries: [] # List of countries to exclude
include_countries: [] # List of countries to include (if set, only these are used)
# Simulation parameters
simulation:
readings_per_second: 3 # Number of readings generated per second
run_time_seconds: 3600 # Total simulation runtime in seconds (1 hour)
start_delay_seconds: 2 # Delay before starting simulation
# Replica configuration for multiple sensors
replicas:
count: 1 # Number of sensor replicas to simulate
prefix: "SENSOR" # Prefix for replica sensor IDs
start_index: 1 # Starting index for replica numbering
# Normal sensor parameters
normal_parameters:
temperature:
mean: 25.0 # Mean temperature in Celsius
std_dev: 2.0 # Standard deviation
min: -10.0 # Minimum value
max: 45.0 # Maximum value
humidity:
mean: 50.0 # Mean humidity percentage
std_dev: 10.0 # Standard deviation
min: 0.0 # Minimum value
max: 100.0 # Maximum value
pressure:
mean: 101325.0 # Mean pressure in Pascals
std_dev: 1000.0 # Standard deviation
min: 95000.0 # Minimum value
max: 105000.0 # Maximum value
vibration:
mean: 2.5 # Mean vibration in mm/s²
std_dev: 0.5 # Standard deviation
min: 0.0 # Minimum value
max: 10.0 # Maximum value
voltage:
mean: 12.0 # Mean voltage
std_dev: 0.5 # Standard deviation
min: 10.0 # Minimum value
max: 14.0 # Maximum value
# Anomaly generation settings
anomalies:
enabled: true # Enable anomaly generation
probability: 0.05 # Overall probability of anomalies (5%)
types:
spike:
enabled: true # Enable spike anomalies
weight: 0.3 # Relative weight (30% of anomalies)
severity_factor: 2.0 # Multiplier for spike magnitude
trend:
enabled: true # Enable trend anomalies
weight: 0.25 # Relative weight (25% of anomalies)
duration_seconds: 300 # Duration of trend anomaly
rate_change: 0.1 # Rate of change per minute
pattern:
enabled: true # Enable pattern anomalies
weight: 0.2 # Relative weight (20% of anomalies)
duration_seconds: 600 # Duration of pattern anomaly
frequency: 0.1 # Frequency of oscillation
missing_data:
enabled: true # Enable missing data anomalies
weight: 0.15 # Relative weight (15% of anomalies)
duration_seconds: 60 # Duration of missing data
noise:
enabled: true # Enable noise anomalies
weight: 0.1 # Relative weight (10% of anomalies)
duration_seconds: 120 # Duration of increased noise
noise_multiplier: 3.0 # Multiplier for noise level
# Monitoring server configuration (REQUIRED for version 2+)
monitoring:
enabled: true # Enable HTTP monitoring server
host: "0.0.0.0" # Host to bind to
port: 8080 # Port to listen on
metrics_interval_seconds: 60 # Interval for metrics updates
health_check_path: "/health" # Health check endpoint path
metrics_path: "/metrics" # Metrics endpoint path
enable_prometheus: false # Enable Prometheus-compatible metrics
# Dynamic configuration reloading (REQUIRED for version 2+)
dynamic_reloading:
enabled: true # Enable dynamic config reloading
check_interval_seconds: 5 # Interval to check for config changes
reload_on_change: true # Automatically reload on changes
validate_before_reload: true # Validate config before applying
# Advanced settings (optional)
advanced:
memory_limit_mb: 500 # Memory usage limit in MB
cpu_limit_percent: 80 # CPU usage limit as percentage
error_retry_attempts: 3 # Number of retry attempts on errors
error_retry_delay_seconds: 5 # Delay between retry attempts
batch_insert_size: 100 # Database batch insert size
batch_timeout_seconds: 5.0 # Timeout for batch inserts