diff --git a/file_catalog/config.py b/file_catalog/config.py index ff5ce2c..dd62943 100644 --- a/file_catalog/config.py +++ b/file_catalog/config.py @@ -54,15 +54,20 @@ class Config(Dict[str, Optional[Union[bool, int, str]]]): 'MONGODB_HOST': ConfigParamSpec('localhost', str, 'MongoDB host'), 'MONGODB_PORT': ConfigParamSpec(27017, int, 'MongoDB port'), 'MONGODB_URI': ConfigParamSpec(None, str, 'MongoDB URI'), - 'ROUTESTATS_OVERLOAD_LIMIT': ConfigParamSpec( - 240, + 'ROUTESTATS_WINDOW_SIZE': ConfigParamSpec( + 600, int, - 'Average query time in seconds to declare overload' + 'Query window size to declare overload' ), - 'ROUTESTATS_WINDOW_SIZE': ConfigParamSpec( + 'ROUTESTATS_WINDOW_TIME': ConfigParamSpec( 600, int, - 'Query window size in seconds to declare overload' + 'Query window time in seconds to declare overload' + ), + 'ROUTESTATS_TIMEOUT': ConfigParamSpec( + 240, + int, + 'Average query time in seconds to declare overload' ), } diff --git a/file_catalog/server.py b/file_catalog/server.py index 9c6dcd1..d83a4d4 100644 --- a/file_catalog/server.py +++ b/file_catalog/server.py @@ -126,8 +126,9 @@ def create(config: Dict[str, Any], "db": mongo, "debug": debug, "route_stats": { - "window_time": config["ROUTESTATS_WINDOW_SIZE"], - "timeout": config["ROUTESTATS_OVERLOAD_LIMIT"], + "window_size": config["ROUTESTATS_WINDOW_SIZE"], + "window_time": config["ROUTESTATS_WINDOW_TIME"], + "timeout": config["ROUTESTATS_TIMEOUT"], }, } if 'CI_TEST_ENV' in os.environ: