-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
36 lines (28 loc) · 1.01 KB
/
Copy pathconfig.py
File metadata and controls
36 lines (28 loc) · 1.01 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
"""Configuration settings for the HTTP benchmark."""
from typing import Annotated
from pydantic import Field
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
"""Configuration settings for the HTTP benchmark."""
TARGET_URL: Annotated[
str, Field(description="Target endpoint for benchmarking")
] = "https://httpbin.org/get"
NUM_REQUESTS: Annotated[
int, Field(gt=0, le=1_000_000, description="Total number of requests")
] = 10
CONCURRENCY: Annotated[
int, Field(gt=0, le=10_000, description="Concurrent requests")
] = 1
TIMEOUT: Annotated[
float, Field(gt=0, le=120, description="Request timeout in seconds")
] = 10.0
LOG_LEVEL: Annotated[
str, Field(pattern="^(DEBUG|INFO|WARNING|ERROR|CRITICAL)$")
] = "INFO"
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
extra="forbid",
validate_default=True,
)
app_settings = Settings()