Skip to content

AsyncStats

Async Stats.

AsyncStats

Bases: BaseStats, AsyncPluginMixin

Class for asynchronous statistics.

Source code in src/qtasks/stats/async_stats.py
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
class AsyncStats(BaseStats, AsyncPluginMixin):
    """Class for asynchronous statistics."""

    def __init__(self, app: QueueTasks, plugins: dict[str, list[BasePlugin]] | None = None):
        """
        Initializing asynchronous statistics.

        Args:
            app (QueueTasks): Application instance. z
            plugins (Optional[Dict[str, List[BasePlugin]]]): Plugins. Default: `None`.
        """
        super().__init__(app=app, plugins=plugins)

    async def inspect(self):
        """
        Inspection of asynchronous statistics.

        Returns:
            InspectStats: Asynchronous statistics schema.
        """
        await self._plugin_trigger(
            "stats_inspect",
            stats=self
        )
        return InspectStats(self.app)

__init__(app, plugins=None)

Initializing asynchronous statistics.

Parameters:

Name Type Description Default
app QueueTasks

Application instance. z

required
plugins Optional[Dict[str, List[BasePlugin]]]

Plugins. Default: None.

None
Source code in src/qtasks/stats/async_stats.py
19
20
21
22
23
24
25
26
27
def __init__(self, app: QueueTasks, plugins: dict[str, list[BasePlugin]] | None = None):
    """
    Initializing asynchronous statistics.

    Args:
        app (QueueTasks): Application instance. z
        plugins (Optional[Dict[str, List[BasePlugin]]]): Plugins. Default: `None`.
    """
    super().__init__(app=app, plugins=plugins)

inspect() async

Inspection of asynchronous statistics.

Returns:

Name Type Description
InspectStats

Asynchronous statistics schema.

Source code in src/qtasks/stats/async_stats.py
29
30
31
32
33
34
35
36
37
38
39
40
async def inspect(self):
    """
    Inspection of asynchronous statistics.

    Returns:
        InspectStats: Asynchronous statistics schema.
    """
    await self._plugin_trigger(
        "stats_inspect",
        stats=self
    )
    return InspectStats(self.app)