3.0.ipv8.REST.asyncio_endpoint ============================== .. py:module:: 3.0.ipv8.REST.asyncio_endpoint Classes ------- .. autoapisummary:: 3.0.ipv8.REST.asyncio_endpoint.DequeLogHandler 3.0.ipv8.REST.asyncio_endpoint.DriftMeasurementStrategy 3.0.ipv8.REST.asyncio_endpoint.AsyncioEndpoint Module Contents --------------- .. py:class:: DequeLogHandler(maxlen: int = 50) Bases: :py:obj:`logging.Handler` Log handler that stores the past log records. .. py:attribute:: deque :type: collections.deque[str] .. py:method:: emit(record: logging.LogRecord) -> None Callback for when a log record is written. .. py:class:: DriftMeasurementStrategy(core_update_rate: float) Bases: :py:obj:`3.0.ipv8.peerdiscovery.discovery.DiscoveryStrategy` Strategy to measure how far off the invocation time of strategies is from the IPv8 tick rate. .. py:attribute:: last_measurement .. py:attribute:: history :type: collections.deque[tuple[float, float]] .. py:attribute:: core_update_rate .. py:method:: take_step() -> None Measure the time since our last invocation and compare it to the expected update rate. .. py:class:: AsyncioEndpoint Bases: :py:obj:`3.0.ipv8.REST.base_endpoint.BaseEndpoint`\ [\ :py:obj:`3.0.ipv8.types.IPv8`\ ] This endpoint helps with the monitoring of the Asyncio thread. .. py:attribute:: strategy :type: DriftMeasurementStrategy | None :value: None .. py:attribute:: asyncio_log_handler :type: DequeLogHandler | None :value: None .. py:method:: setup_routes() -> None Register the names to make this endpoint callable. .. py:method:: enable() -> bool Create a new measurement strategy and hook it into IPv8. .. py:method:: disable() -> bool Destroy the previously registered measurement strategy. .. py:method:: retrieve_drift(_: aiohttp.abc.Request) -> 3.0.ipv8.REST.base_endpoint.Response :async: Calculate the current drift. .. py:method:: enable_measurements(request: aiohttp.abc.Request) -> 3.0.ipv8.REST.base_endpoint.Response :async: Enable or disable drift measurements. .. py:method:: get_asyncio_tasks(_: aiohttp.abc.Request) -> 3.0.ipv8.REST.base_endpoint.Response :async: Return all currently running Asyncio tasks. .. py:method:: set_asyncio_debug(request: aiohttp.abc.Request) -> 3.0.ipv8.REST.base_endpoint.Response :async: Set asyncio debug options. .. py:method:: get_asyncio_debug(_: aiohttp.abc.Request) -> 3.0.ipv8.REST.base_endpoint.Response :async: Return Asyncio log messages.