Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions config_error_handling_rules.yaml.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Error Handling Rules Configuration

# Error Category Definitions
error_categories:
critical:
errors:
- "DatabaseConnectionError"
- "OutOfMemoryError"
- "SystemError"
- "FatalError"
- "SecurityError"
action: "alert_and_retry"

recoverable:
errors:
- "TimeoutError"
- "ConnectionError"
- "RateLimitError"
- "TemporaryError"
- "NetworkError"
- "ServiceUnavailableError"
action: "auto_retry"

ignorable:
errors:
- "ClientCancellationError"
- "NotFoundError"
- "ValidationError"
action: "log_only"

warning:
errors:
- "DeprecationWarning"
- "ConfigurationWarning"
action: "log_only"

# Recovery Strategy Definitions
auto_fix_strategies:
- error_type: "DatabaseConnectionError"
strategy: "reconnect_with_backoff"
max_attempts: 5
base_delay: 2

- error_type: "RateLimitError"
strategy: "rate_limit_backoff"
max_attempts: 3
base_delay: 60

- error_type: "TimeoutError"
strategy: "exponential_backoff"
max_attempts: 5
base_delay: 2

- error_type: "ConnectionError"
strategy: "reconnect_with_backoff"
max_attempts: 5
base_delay: 2

- error_type: "OutOfMemoryError"
strategy: "restart_with_increased_memory"
max_attempts: 1
base_delay: 10

- error_type: "SecurityError"
strategy: "refresh_credentials"
max_attempts: 3
base_delay: 5

# Pattern-based Error Classification
error_patterns:
- pattern: "connection.*refused|timeout|timed out"
category: "recoverable"
strategy: "exponential_backoff"
severity: 6

- pattern: "out of memory|oom|memory error"
category: "critical"
strategy: "restart_with_increased_memory"
severity: 10

- pattern: "rate limit|too many requests|429"
category: "recoverable"
strategy: "rate_limit_backoff"
severity: 4

- pattern: "database.*connection|db error|sql"
category: "critical"
strategy: "reconnect_with_backoff"
severity: 8

- pattern: "unauthorized|authentication|forbidden"
category: "critical"
strategy: "refresh_credentials"
severity: 9

- pattern: "not found|404"
category: "warning"
strategy: "log_and_continue"
severity: 3

# Alert Configuration
alerts:
# Enable email alerts
email_enabled: false
email_recipients:
- "devops@example.com"

# Enable Slack alerts
slack_enabled: false
slack_webhook: "${SLACK_WEBHOOK_URL}"

# Enable PagerDuty alerts
pagerduty_enabled: false
pagerduty_key: "${PAGERDUTY_KEY}"
143 changes: 143 additions & 0 deletions config_stress_test_config.yaml (1).txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Intelligent Stress Testing System Configuration

# Stress Test Configuration
stress_test:
# Test duration in seconds (0 = infinite)
duration: 3600

# Maximum concurrent users/connections
max_concurrent_users: 1000

# Ramp-up time in seconds
ramp_up_time: 300

# Base URL for testing
base_url: "http://localhost:8000"

# Test interval between cycles (seconds)
test_interval: 1

# Endpoints to test
endpoints:
- path: "/api/transactions"
method: "POST"
weight: 0.6
- path: "/api/accounts"
method: "GET"
weight: 0.3
- path: "/api/status"
method: "GET"
weight: 0.1

# Error Handling Configuration
error_handling:
# Maximum retry attempts
max_retries: 5

# Base retry delay in seconds
retry_delay: 2

# Use exponential backoff
exponential_backoff: true

# Enable automatic recovery
auto_recovery: true

# Error category definitions
error_categories:
critical:
- "DatabaseConnectionError"
- "OutOfMemoryError"
- "SystemError"
recoverable:
- "TimeoutError"
- "ConnectionError"
- "RateLimitError"
- "TemporaryError"
ignorable:
- "ClientCancellationError"
- "NotFoundError"

# Auto-fix strategies
auto_fix_strategies:
- error_type: "DatabaseConnectionError"
strategy: "reconnect_with_backoff"
- error_type: "RateLimitError"
strategy: "rate_limit_backoff"
- error_type: "TimeoutError"
strategy: "exponential_backoff"
- error_type: "ConnectionError"
strategy: "reconnect_with_backoff"

# Monitoring Configuration
monitoring:
# Metrics collection interval (seconds)
metrics_interval: 10

# Metrics aggregation interval (seconds)
aggregation_interval: 60

# Dashboard port
dashboard_port: 8080

# Enable alerts
enable_alerts: true

# Alert thresholds
alert_thresholds:
error_rate: 10.0 # percentage
stress_load: 90.0 # percentage

# Storage path for metrics
storage_path: "data/metrics.json"

# Network Simulation (optional)
network:
# Enable network simulation
enabled: false

# Simulated latency in milliseconds
latency_ms: 0

# Packet loss percentage
packet_loss: 0.0

# Bandwidth limit in Mbps
bandwidth_limit_mbps: 0

# Pull Request Automation
pr_automation:
# GitHub repository owner
repo_owner: "PiCoreTeam"

# GitHub repository name
repo_name: "pi-node-docker"

# Base branch for PRs
base_branch: "master"

# GitHub token (use environment variable)
github_token: "${GITHUB_TOKEN}"

# Auto-merge approved PRs
auto_merge: true

# Merge method (merge, squash, rebase)
merge_method: "squash"

# Logging Configuration
logging:
# Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
level: "INFO"

# Log file path
file: "logs/stress_testing.log"

# Log format
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"

# Maximum log file size in bytes
max_bytes: 10485760 # 10MB

# Number of backup log files
backup_count: 5
Loading