import abc
from _typeshed import Incomplete

from kafka.metrics.measurable_stat import AbstractMeasurableStat

class AbstractSampledStat(AbstractMeasurableStat, metaclass=abc.ABCMeta):
    def __init__(self, initial_value) -> None: ...
    @abc.abstractmethod
    def update(self, sample, config, value, time_ms): ...
    @abc.abstractmethod
    def combine(self, samples, config, now): ...
    def record(self, config, value, time_ms) -> None: ...
    def new_sample(self, time_ms): ...
    def measure(self, config, now): ...
    def current(self, time_ms): ...
    def oldest(self, now): ...
    def purge_obsolete_samples(self, config, now) -> None: ...

    class Sample:
        initial_value: Incomplete
        event_count: int
        last_window_ms: Incomplete
        value: Incomplete
        def __init__(self, initial_value, now) -> None: ...
        def reset(self, now) -> None: ...
        def is_complete(self, time_ms, config): ...
