Populate our instance-local copy of the daemon's performance counter schema, and work out which stats we will display.
(self)
| 345 | return True |
| 346 | |
| 347 | def _load_schema(self) -> None: |
| 348 | """ |
| 349 | Populate our instance-local copy of the daemon's performance counter |
| 350 | schema, and work out which stats we will display. |
| 351 | """ |
| 352 | self._schema = json.loads( |
| 353 | admin_socket(self.asok_path, ["perf", "schema"]).decode('utf-8'), |
| 354 | object_pairs_hook=OrderedDict) |
| 355 | |
| 356 | # Build list of which stats we will display |
| 357 | self._stats = OrderedDict() |
| 358 | assert self._schema is not None |
| 359 | for section_name, section_stats in self._schema.items(): |
| 360 | for name, schema_data in section_stats.items(): |
| 361 | prio = schema_data.get('priority', 0) |
| 362 | if self._should_include(section_name, name, prio): |
| 363 | if section_name not in self._stats: |
| 364 | self._stats[section_name] = OrderedDict() |
| 365 | self._stats[section_name][name] = schema_data['nick'] |
| 366 | if not len(self._stats): |
| 367 | raise RuntimeError("no stats selected by filters") |
| 368 | |
| 369 | def _handle_sigwinch(self, |
| 370 | signo: Union[int, Signals], |
no test coverage detected