# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .time_series_point import TimeSeriesPoint


class VersionPodMetricsResponse(UniversalBaseModel):
    """
    Pod-level CPU + memory metrics for a deployed version (last N minutes).
    """

    cpu_cores: typing.Optional[typing.List[TimeSeriesPoint]] = pydantic.Field(default=None)
    """
    CPU usage rate in cores (derived from container_cpu_usage_seconds_total)
    """

    k8s_namespace: typing.Optional[str] = pydantic.Field(default=None)
    """
    Kubernetes namespace containing the version pods
    """

    memory_working_set_bytes: typing.Optional[typing.List[TimeSeriesPoint]] = pydantic.Field(default=None)
    """
    Memory working set in bytes (container_memory_working_set_bytes)
    """

    pod_name_prefix: typing.Optional[str] = pydantic.Field(default=None)
    """
    Pod name prefix (Helm release name) used for filtering
    """

    pods: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Pods observed in window
    """

    step_seconds: int = pydantic.Field()
    """
    Bucket size in seconds
    """

    window_minutes: int = pydantic.Field()
    """
    Lookback window in minutes
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
