MCPcopy
hub / github.com/benoitc/gunicorn / MockConfig

Class MockConfig

benchmarks/dirty_benchmark.py:117–156  ·  view source on GitHub ↗

Mock gunicorn config for standalone arbiter testing.

Source from the content-addressed store, hash-verified

115
116
117class MockConfig:
118 """Mock gunicorn config for standalone arbiter testing."""
119
120 def __init__(
121 self,
122 dirty_apps: list[str],
123 dirty_workers: int = 2,
124 dirty_threads: int = 1,
125 dirty_timeout: int = 300,
126 dirty_graceful_timeout: int = 30,
127 ):
128 self.dirty_apps = dirty_apps
129 self.dirty_workers = dirty_workers
130 self.dirty_threads = dirty_threads
131 self.dirty_timeout = dirty_timeout
132 self.dirty_graceful_timeout = dirty_graceful_timeout
133
134 # Other required config
135 self.env = {}
136 self.uid = os.getuid()
137 self.gid = os.getgid()
138 self.initgroups = False
139 self.proc_name = "dirty-benchmark"
140
141 # WorkerTmp requirements
142 self.umask = 0
143 self.worker_tmp_dir = None
144
145 # Hook stubs
146 def on_dirty_starting(self, arbiter):
147 pass
148
149 def dirty_post_fork(self, arbiter, worker):
150 pass
151
152 def dirty_worker_init(self, worker):
153 pass
154
155 def dirty_worker_exit(self, arbiter, worker):
156 pass
157
158
159class MockLogger:

Callers 1

startMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected