MCPcopy Create free account
hub / github.com/ceph/ceph / _load_schema

Method _load_schema

src/pybind/ceph_daemon.py:347–367  ·  view source on GitHub ↗

Populate our instance-local copy of the daemon's performance counter schema, and work out which stats we will display.

(self)

Source from the content-addressed store, hash-verified

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],

Callers 2

runMethod · 0.95
listMethod · 0.95

Calls 5

_should_includeMethod · 0.95
admin_socketFunction · 0.85
decodeMethod · 0.45
itemsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected