Commit 7276e5e
* feat: Add per-backend execution timing instrumentation (issue #56)
This change adds execution timing to backend results to improve visibility
into backend performance. This makes it easier to identify slow backends,
diagnose performance regressions, and validate caching optimizations.
Changes:
- Added execution_time_ms field to BackendResult model
- Implemented timing tracking at dispatcher level using perf_counter
- Display timing in verbose CLI output (e.g., "1567.84ms")
- Timing included in JSON output format
- All existing tests pass (239 tests)
Part of epic #52 - Performance: Optimize caching to eliminate redundant API calls
[AI-assisted]
* fix: Use actual backend response_time instead of wall-clock time
The previous implementation measured wall-clock time from task start to
finish, which showed similar times for all backends (~1.3s) because they
run concurrently. This was not useful for identifying slow backends.
Now using the existing response_time field (which each backend already
tracks internally) and converting it to milliseconds. This shows the
actual work time for each backend:
- Fast cached backends: 0-85ms
- Slow backends with API calls: 275-1641ms
This correctly identifies which backends are actually slow vs fast.
[AI-assisted]
---------
Co-authored-by: florath-ai-assistant[bot] <Andreas.Florath@telekom.de>
1 parent e004552 commit 7276e5e
3 files changed
+30
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
396 | 399 | | |
397 | | - | |
| 400 | + | |
398 | 401 | | |
399 | 402 | | |
400 | 403 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
235 | 256 | | |
236 | 257 | | |
237 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
0 commit comments