import os

SECURITY_SERVICE_NEEDED=os.getenv("SECURITY_SERVICE_NEEDED")
COMPOSE_IMAGE=os.getenv("COMPOSE_IMAGE")

# Service Port
if SECURITY_SERVICE_NEEDED == 'true':
    DEVICE_REST_PORT = "8443/device-rest"
    DEVICE_VIRTUAL_PORT = "8443/device-virtual"
    APP_SERVICE_RULES_PORT = "8443/app-rules-engine"
else:
    DEVICE_REST_PORT = 59986
    DEVICE_VIRTUAL_PORT = 59900
    APP_SERVICE_RULES_PORT = 59701


# Suite: 1_resource_usage
# Prior release (KAMAKURA) image size (MB) for x86
CONSUL_IMAGE = 115.97
DATA_IMAGE = 22.50
METADATA_IMAGE = 17.01
COMMAND_IMAGE = 16.07
NOTIFICATIONS_IMAGE = 26.87
SCHEDULER_IMAGE = 26.29
APP_SERVICE_CONFIGURABLE_IMAGE = 36.43
SYS_MGMT_AGENT_IMAGE = 298.57
DEVICE_VIRTUAL_IMAGE = 36.07
DEVICE_REST_IMAGE = 36.10
KUIPER_IMAGE = 45.58
REDIS_IMAGE = 32.37
PROXY_IMAGE = 26.90
SECRETSTORE_IMAGE = 28.51
KONG_IMAGE = 142.58
KONG_DB_IMAGE = 205.16
VAULT_IMAGE = 186.43
BOOTSTRAPPER_IMAGE = 19.06

# Prior release (KAMAKURA) binary size (MB) for x86
CONSUL_BINARY = 0
DATA_BINARY = 14.15
METADATA_BINARY = 11.33
COMMAND_BINARY = 10.39
NOTIFICATIONS_BINARY = 20.72
SCHEDULER_BINARY = 20.61
APP_SERVICE_CONFIGURABLE_BINARY = 27.56
SYS_MGMT_AGENT_BINARY = 10.29
DEVICE_VIRTUAL_BINARY = 27.69
DEVICE_REST_BINARY = 27.73
KUIPER_BINARY = 0
REDIS_BINARY = 0
PROXY_BINARY = 0
SECRETSTORE_BINARY = 0
KONG_BINARY = 0
KONG_DB_BINARY = 0
VAULT_BINARY = 0
BOOTSTRAPPER_BINARY = 0

# Prior release (KAMAKURA) image size (MB) for arm64
CONSUL_IMAGE_ARM64 = 113.25
DATA_IMAGE_ARM64 = 21.64
METADATA_IMAGE_ARM64 = 16.35
COMMAND_IMAGE_ARM64 = 15.49
NOTIFICATIONS_IMAGE_ARM64 = 25.84
SCHEDULER_IMAGE_ARM64 = 25.22
APP_SERVICE_CONFIGURABLE_IMAGE_ARM64 = 35.07
SYS_MGMT_AGENT_IMAGE_ARM64 = 281.76
DEVICE_VIRTUAL_IMAGE_ARM64 = 34.64
DEVICE_REST_IMAGE_ARM64 = 34.68
KUIPER_IMAGE_ARM64 = 43.28
REDIS_IMAGE_ARM64 = 32.44
PROXY_IMAGE_ARM64 = 26.08
SECRETSTORE_IMAGE_ARM64 = 27.50
KONG_IMAGE_ARM64 = 152.74
KONG_DB_IMAGE_ARM64 = 196.62
VAULT_IMAGE_ARM64 = 175.96
BOOTSTRAPPER_IMAGE_ARM64 = 18.32

# Prior release (KAMAKURA) binary size (MB) for arm64
DATA_BINARY_ARM64 = 13.57
METADATA_BINARY_ARM64 =	10.90
COMMAND_BINARY_ARM64 = 10.05
NOTIFICATIONS_BINARY_ARM64 = 19.93
SCHEDULER_BINARY_ARM64 = 19.77
APP_SERVICE_CONFIGURABLE_BINARY_ARM64 = 26.49
SYS_MGMT_AGENT_BINARY_ARM64 = 10.02
DEVICE_VIRTUAL_BINARY_ARM64 = 26.55
DEVICE_REST_BINARY_ARM64 = 26.60

# Footprint threshold value
# ex. 1.5 = prior release + 50%
FOOTPRINT_THRESHOLD = 1.2

# Suite: 2_service_startup_time
# Retry setting to fetch service startup time
WAIT_TIME = 5
RETRY_TIMES = 5

# Startup time threshold value (in seconds)
STARTUP_TIME_THRESHOLD = 300

# Loop time for retrieving services startup time
STARTUP_TIME_LOOP_TIMES = 5


# Suite: 3_resource_usage_with_autoevent
# CPU threshold value (percentage)
CPU_USAGE_THRESHOLD = 50

# Memory threshold value (in MB)
MEM_USAGE_THRESHOLD = 300

# Loop time for retrieving CPU and Memory
GET_CPU_MEM_LOOP_TIMES = 10

# Interval time for retrieving CPU and Memory (in seconds)
GET_CPU_MEM_INTERVAL = 7


# Suite: 4_ping_response_time
# Loop time for sending ping request
PING_RES_LOOP_TIMES = 100

# Ping response time threshold value (in milliseconds)
PING_RES_THRESHOLD = 100

# Allow the failure times for ping response time over than threshold setting
ALLOWABLE_OUTLIER = 5


# Suite: 5_event_exported_time
# Loop time for retrieve mqtt events
EXPORTED_LOOP_TIMES = 10

# Export time threshold value (in milliseconds)
EXPORT_TIME_THRESHOLD = 1200
