flayer.diagnostics.benchmark¶
flayer.diagnostics.benchmark ¶
Bounded HTTP measurements against an explicitly authorized endpoint.
BenchmarkLimits
dataclass
¶
BenchmarkLimits(timeout_seconds: float = 3.0, count: int = 3, byte_limit: int = 64 * 1024)
EndpointMeasurement
dataclass
¶
EndpointMeasurement(status: DiagnosticStatus, duration_seconds: float, received_bytes: int = 0, http_status: int | None = None)
Safe metrics exclude response content, credentials, and target identifiers.
EndpointTransport ¶
Bases: Protocol
A measurement implementation enforces supplied limits without emitting raw data.
__call__ ¶
__call__(endpoint: str, timeout_seconds: float, byte_limit: int) -> EndpointMeasurement
Return one bounded HTTP measurement without exposing response payloads.
Source code in installed/flayer/diagnostics/benchmark.py
59 60 61 62 63 64 | |
ValidateEndpoint ¶
ValidateEndpoint(endpoint: str) -> SplitResult
Allow explicit HTTP(S) URLs without credentials, query strings, or fragments.
Source code in installed/flayer/diagnostics/benchmark.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
HttpMeasurement ¶
HttpMeasurement(endpoint: str, timeout_seconds: float, byte_limit: int) -> EndpointMeasurement
Read a limited payload with TLS verification and no redirects or proxy discovery.
Source code in installed/flayer/diagnostics/benchmark.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
EndpointWorker ¶
EndpointWorker(sender: Connection, endpoint: str, timeout_seconds: float, byte_limit: int) -> None
Isolate network work so DNS, TLS, connect, and response reads share a hard deadline.
Source code in installed/flayer/diagnostics/benchmark.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
MeasureEndpoint ¶
MeasureEndpoint(endpoint: str, timeout_seconds: float, byte_limit: int) -> EndpointMeasurement
Terminate isolated network work at the deadline, including a stalled DNS resolver.
Source code in installed/flayer/diagnostics/benchmark.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
SafeMeasurement ¶
SafeMeasurement(endpoint: str, limits: BenchmarkLimits, transport: EndpointTransport) -> EndpointMeasurement
Reject invalid adapter metrics and suppress all unstructured exception output.
Source code in installed/flayer/diagnostics/benchmark.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | |
ProbeEndpoint ¶
ProbeEndpoint(endpoint: str, timeout_seconds: float = 3.0, transport: EndpointTransport = MeasureEndpoint) -> CheckResult
Check explicit HTTP reachability without pretending it validates guest hardening.
Source code in installed/flayer/diagnostics/benchmark.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | |
RunBenchmark ¶
RunBenchmark(endpoint: str, limits: BenchmarkLimits | None = None, transport: EndpointTransport = MeasureEndpoint) -> tuple[CheckResult, ...]
Measure a fixed count of bounded downloads without inferring upload or tunnel speed.
Source code in installed/flayer/diagnostics/benchmark.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | |