Skip to content

SyncStats

Sync Stats.

SyncStats

Bases: BaseStats, SyncPluginMixin

Class for synchronous statistics.

Source code in src/qtasks/stats/sync_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 SyncStats(BaseStats, SyncPluginMixin):
    """Class for synchronous statistics."""

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

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

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

        Returns:
            InspectStats: Synchronous statistics schema.
        """
        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.

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

Plugins. Default: None.

None
Source code in src/qtasks/stats/sync_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.
        plugins (Optional[Dict[str, List[BasePlugin]]]): Plugins. Default: `None`.
    """
    super().__init__(app=app, plugins=plugins)

inspect()

Inspection of asynchronous statistics.

Returns:

Name Type Description
InspectStats

Synchronous statistics schema.

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

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