"""
This file is generated by generator/run.py based on the Chrome DevTools Protocol.


https://chromedevtools.github.io/devtools-protocol/tot/Tracing/

***************************************************
                    Events
***************************************************
"""
from __future__ import annotations

from cdpkit.protocol._types import (
    IO,
    Tracing,
)
from cdpkit.protocol.base import JSON_DICT, CDPEvent


class BufferUsage(CDPEvent):

    percentFull: float | None = None
    eventCount: float | None = None
    value: float | None = None


class DataCollected(CDPEvent):
    """ Contains a bucket of collected trace events. When tracing is stopped collected events will be
    sent as a sequence of dataCollected events followed by tracingComplete event. """

    value: list[JSON_DICT]


class TracingComplete(CDPEvent):
    """ Signals that tracing is stopped and there is no trace buffers pending flush, all data were
    delivered via dataCollected events. """

    dataLossOccurred: bool
    stream: IO.StreamHandle | None = None
    traceFormat: Tracing.StreamFormat | None = None
    streamCompression: Tracing.StreamCompression | None = None
