Commit 33c174b
feat: Add diagnostics library for tracking stats/counters (#673)
* feat: Add diagnostics library for tracking stats/counters
Add a generic library that can be used to track counters, or elapsed time (e.g. how long it takes on average to connect to mqtt). This is a copy of https://github.com/allenporter/python-google-nest-sdm/blob/main/google_nest_sdm/diagnostics.py
This is an initial pass to add a few initial example metrics for MQTT, but we can add more as we need fine grained details in diagnostics.
* chore fix typo in pydoc Update roborock/diagnostics.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* chore: Update roborock/diagnostics.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* chore: apply co-pilot suggestion for dataclass initialization
* chore: fix lint errors in test_device_manager.py
* feat: Add diagnostics library for tracking stats/counters
Add a generic library that can be used to track counters, or elapsed time (e.g. how long it takes on average to connect to mqtt). This is a copy of https://github.com/allenporter/python-google-nest-sdm/blob/main/google_nest_sdm/diagnostics.py
This is an initial pass to add a few initial example metrics for MQTT, but we can add more as we need fine grained details in diagnostics.
* feat: Add diagnostics library for tracking stats/counters
Add a generic library that can be used to track counters, or elapsed time (e.g. how long it takes on average to connect to mqtt). This is a copy of https://github.com/allenporter/python-google-nest-sdm/blob/main/google_nest_sdm/diagnostics.py
This is an initial pass to add a few initial example metrics for MQTT, but we can add more as we need fine grained details in diagnostics.
* chore: remove duplicate test
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent cd7ef7c commit 33c174b
File tree
7 files changed
+296
-19
lines changed- roborock
- devices
- mqtt
- tests
- devices
- mqtt
7 files changed
+296
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
68 | 71 | | |
69 | 72 | | |
70 | 73 | | |
| 74 | + | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
| 78 | + | |
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
| 82 | + | |
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
| |||
116 | 122 | | |
117 | 123 | | |
118 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
119 | 129 | | |
120 | 130 | | |
121 | 131 | | |
| |||
182 | 192 | | |
183 | 193 | | |
184 | 194 | | |
| 195 | + | |
| 196 | + | |
185 | 197 | | |
| 198 | + | |
186 | 199 | | |
187 | 200 | | |
188 | 201 | | |
| |||
226 | 239 | | |
227 | 240 | | |
228 | 241 | | |
229 | | - | |
| 242 | + | |
230 | 243 | | |
231 | 244 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| |||
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| 101 | + | |
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
| 108 | + | |
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
108 | 112 | | |
| 113 | + | |
109 | 114 | | |
110 | 115 | | |
| 116 | + | |
111 | 117 | | |
112 | 118 | | |
| 119 | + | |
113 | 120 | | |
114 | 121 | | |
115 | 122 | | |
116 | 123 | | |
| 124 | + | |
117 | 125 | | |
118 | 126 | | |
119 | 127 | | |
| |||
136 | 144 | | |
137 | 145 | | |
138 | 146 | | |
| 147 | + | |
139 | 148 | | |
140 | 149 | | |
141 | 150 | | |
| |||
144 | 153 | | |
145 | 154 | | |
146 | 155 | | |
| 156 | + | |
147 | 157 | | |
148 | 158 | | |
149 | 159 | | |
| |||
164 | 174 | | |
165 | 175 | | |
166 | 176 | | |
| 177 | + | |
167 | 178 | | |
168 | 179 | | |
169 | 180 | | |
| |||
175 | 186 | | |
176 | 187 | | |
177 | 188 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
189 | 202 | | |
190 | 203 | | |
191 | 204 | | |
| |||
227 | 240 | | |
228 | 241 | | |
229 | 242 | | |
| 243 | + | |
230 | 244 | | |
231 | 245 | | |
232 | 246 | | |
| |||
251 | 265 | | |
252 | 266 | | |
253 | 267 | | |
| 268 | + | |
254 | 269 | | |
255 | 270 | | |
256 | 271 | | |
| |||
262 | 277 | | |
263 | 278 | | |
264 | 279 | | |
265 | | - | |
| 280 | + | |
| 281 | + | |
266 | 282 | | |
267 | 283 | | |
268 | 284 | | |
269 | 285 | | |
270 | 286 | | |
271 | 287 | | |
| 288 | + | |
272 | 289 | | |
273 | 290 | | |
274 | 291 | | |
| |||
301 | 318 | | |
302 | 319 | | |
303 | 320 | | |
| 321 | + | |
304 | 322 | | |
305 | 323 | | |
306 | 324 | | |
307 | | - | |
| 325 | + | |
308 | 326 | | |
309 | 327 | | |
310 | 328 | | |
| |||
320 | 338 | | |
321 | 339 | | |
322 | 340 | | |
323 | | - | |
| 341 | + | |
| 342 | + | |
324 | 343 | | |
325 | 344 | | |
326 | 345 | | |
| |||
333 | 352 | | |
334 | 353 | | |
335 | 354 | | |
336 | | - | |
| 355 | + | |
337 | 356 | | |
338 | 357 | | |
339 | 358 | | |
340 | 359 | | |
| 360 | + | |
341 | 361 | | |
342 | 362 | | |
343 | 363 | | |
| |||
353 | 373 | | |
354 | 374 | | |
355 | 375 | | |
| 376 | + | |
356 | 377 | | |
357 | 378 | | |
358 | 379 | | |
| |||
403 | 424 | | |
404 | 425 | | |
405 | 426 | | |
406 | | - | |
| 427 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
35 | 44 | | |
36 | 45 | | |
37 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
0 commit comments