Skip to content

feature request: track max queue length in memory channel stats #1723

Description

@belm0

use case: if you need queueing but inf is not reasonable, to find a reasonable limit you'll want stats on the max observed queuing for actual run sessions of the app

doesn't seem like too much overhead to always collect it

        if self._state.receive_tasks:
            ...
        else:
            n = len(self._state.data)
            if n < self._state.max_buffer_size:
                self._state.data.append(value)
                self._state._max_observed_size = max(n + 1, self._state._max_observed_size)
            else:
                raise trio.WouldBlock

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions