vllm.distributed.kv_transfer.kv_connector.v1.metrics ¶
KVConnectorLogging ¶
Source code in vllm/distributed/kv_transfer/kv_connector/v1/metrics.py
__init__ ¶
__init__(kv_tranfer_config: KVTransferConfig)
Source code in vllm/distributed/kv_transfer/kv_connector/v1/metrics.py
log ¶
Log transfer metrics periodically, similar to throughput logging
Source code in vllm/distributed/kv_transfer/kv_connector/v1/metrics.py
observe ¶
Source code in vllm/distributed/kv_transfer/kv_connector/v1/metrics.py
KVConnectorPromMetrics ¶
A base class for per-connector Prometheus metric registration and recording.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/metrics.py
__init__ ¶
__init__(
vllm_config: VllmConfig,
metric_types: dict[type[PromMetric], type[PromMetricT]],
labelnames: list[str],
per_engine_labelvalues: dict[int, list[str]],
)
Source code in vllm/distributed/kv_transfer/kv_connector/v1/metrics.py
make_per_engine ¶
make_per_engine(metric: PromMetric) -> PromMetric
Create a per-engine child of a prometheus_client.Metric with the appropriate labels set. The parent metric must be created using the labelnames list.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/metrics.py
observe ¶
Record the supplied transfer statistics to Prometheus metrics. These statistics are engine-specific, and should be recorded to a metric with the appropriate 'engine' label. These metric instances can be created using the make_per_engine() helper method.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/metrics.py
KVConnectorPrometheus ¶
Support for registering per-connector Prometheus metrics, and recording transfer statistics to those metrics. Uses KVConnectorBase.build_prom_metrics().
Source code in vllm/distributed/kv_transfer/kv_connector/v1/metrics.py
__init__ ¶
__init__(
vllm_config: VllmConfig,
labelnames: list[str],
per_engine_labelvalues: dict[int, list[str]],
)
Source code in vllm/distributed/kv_transfer/kv_connector/v1/metrics.py
observe ¶
KVConnectorStats dataclass ¶
Base class for KV Connector Stats, a container for transfer performance metrics or otherwise important telemetry from the connector. All sub-classes need to be serializable as stats are sent from worker to logger process.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/metrics.py
aggregate ¶
aggregate(other: KVConnectorStats) -> KVConnectorStats
reduce ¶
Reduce the observations collected during a time interval to one or more representative values (eg avg/median/sum of the series). This is meant to be called by the logger to produce a summary of the stats for the last time interval.