Commit 869e5a4
committed
refactor!: restructure metrics response for clear abstraction separation
BREAKING CHANGE: Major restructuring of metrics API responses to separate
abstraction layers, time windows, and current vs lifetime metrics.
## Server Metrics Restructure
Separated server metrics into 4 clear tiers:
1. Application tier: queue_workers (count, current/lifetime utilization)
2. Application tier: job_processing (lifetime totals, current performance)
3. Process tier: worker_processes (per-worker resource averages)
4. System tier: server_resources (actual server CPU/memory)
Breaking changes:
- Renamed system_limits → server_resources for clarity
- Split flat utilization_rate into current_busy_percent and lifetime_busy_percent
- Restructured workers/performance/utilization into nested hierarchy
## Queue Metrics Separation
Separated queue metrics by time scope:
- depth: Instantaneous queue state (current snapshot)
- performance_60s: Windowed metrics with explicit window_seconds
- lifetime: Lifetime metrics (failure_rate_percent since first job)
- workers: Current vs lifetime busy percentages
Breaking changes:
- Flat depth/pending/etc moved into depth object
- throughput_per_minute moved to performance_60s.throughput_per_minute
- utilization_rate split into workers.current_busy_percent and lifetime_busy_percent
## Trend Analysis Enhancement
Added comprehensive time_window context to all trend methods:
- window_seconds: Duration of analysis window
- window_start/window_end: ISO8601 timestamps
- analyzed_at: When analysis was performed
- sample_count: Number of data points analyzed
Breaking changes:
- Added time_window object wrapper to all trend responses
- Moved period_seconds into time_window structure
## Critical Bug Fix
Fixed jobs/minute calculation error (5x multiplication):
- Changed from cumulative worker uptime to actual elapsed time
- Used oldest worker uptime as proxy for wall-clock elapsed time
- Example: 5 workers × 10min = 50min cumulative → now 10min elapsed
## Dashboard Filtering Updates
Updated all dashboard filter methods to:
- Map new hierarchical structures correctly
- Maintain separation of current vs lifetime metrics
- Preserve time window context
Files modified:
- src/Services/WorkerMetricsQueryService.php
- src/Services/QueueMetricsQueryService.php
- src/Services/OverviewQueryService.php
- src/Services/TrendAnalysisService.php1 parent 7f5b48a commit 869e5a4
File tree
4 files changed
+221
-114
lines changed- src/Services
4 files changed
+221
-114
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
146 | 152 | | |
147 | 153 | | |
148 | 154 | | |
| |||
177 | 183 | | |
178 | 184 | | |
179 | 185 | | |
180 | | - | |
181 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
182 | 192 | | |
183 | 193 | | |
184 | 194 | | |
185 | 195 | | |
186 | 196 | | |
187 | 197 | | |
188 | 198 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
196 | 205 | | |
197 | 206 | | |
198 | 207 | | |
199 | 208 | | |
200 | 209 | | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
205 | 215 | | |
206 | 216 | | |
207 | 217 | | |
208 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
209 | 221 | | |
210 | 222 | | |
211 | 223 | | |
212 | | - | |
213 | | - | |
214 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
215 | 228 | | |
216 | 229 | | |
217 | 230 | | |
| |||
226 | 239 | | |
227 | 240 | | |
228 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
229 | 246 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
234 | 253 | | |
235 | 254 | | |
236 | 255 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
156 | 160 | | |
157 | 161 | | |
158 | 162 | | |
| |||
161 | 165 | | |
162 | 166 | | |
163 | 167 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
175 | 193 | | |
176 | 194 | | |
177 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
101 | 109 | | |
102 | 110 | | |
103 | 111 | | |
104 | 112 | | |
105 | 113 | | |
106 | 114 | | |
107 | 115 | | |
| 116 | + | |
108 | 117 | | |
109 | 118 | | |
110 | 119 | | |
111 | 120 | | |
112 | 121 | | |
| 122 | + | |
113 | 123 | | |
114 | 124 | | |
115 | | - | |
| 125 | + | |
116 | 126 | | |
117 | 127 | | |
118 | 128 | | |
| |||
185 | 195 | | |
186 | 196 | | |
187 | 197 | | |
188 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
189 | 207 | | |
190 | 208 | | |
191 | 209 | | |
192 | 210 | | |
193 | 211 | | |
194 | 212 | | |
| 213 | + | |
195 | 214 | | |
196 | 215 | | |
197 | 216 | | |
| |||
256 | 275 | | |
257 | 276 | | |
258 | 277 | | |
259 | | - | |
260 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
261 | 287 | | |
262 | 288 | | |
263 | 289 | | |
264 | 290 | | |
265 | 291 | | |
266 | 292 | | |
| 293 | + | |
267 | 294 | | |
268 | 295 | | |
269 | 296 | | |
| |||
0 commit comments