

# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: blickfeld/video/data/health.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import Dict

import blickfeld_qb2.betterproto as betterproto
import blickfeld_qb2.betterproto.lib.google.protobuf as betterproto_lib_google_protobuf

from ...base import data as __base_data__


@dataclass(eq=False, repr=False)
class Health(betterproto.Message):
    """Describes the health of the video module"""

    state: "__base_data__.HealthState" = betterproto.enum_field(1)
    """High-level health state of module"""

    state_reason: str = betterproto.string_field(2)
    """Reason for a given state. Only set if state is not STATE_OK"""

    clients: Dict[str, "HealthClient"] = betterproto.map_field(
        3, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE
    )
    """Served clients (key is the ip:port)"""

    performance: "HealthPerformance" = betterproto.message_field(4)
    """The performance of the video processing pipeline"""


@dataclass(eq=False, repr=False)
class HealthClient(betterproto.Message):
    """Describes the RTSP client served by the video server"""

    uptime: int = betterproto.uint32_field(1)
    """Time since this RTSP session has been active"""


@dataclass(eq=False, repr=False)
class HealthPerformance(betterproto.Message):
    """The performance of the video processing pipeline"""

    fetch_frequency: float = betterproto.float_field(1)
    """rate at which point cloud is fetched from the source (percept)"""

    render_frequency: float = betterproto.float_field(2)
    """rate at which point cloud is rendered"""

    push_frequency: float = betterproto.float_field(3)
    """rate at which point cloud is pushed to the sink (video pipeline)"""
