utils

Utility functions

source

parse_metric_value


def parse_metric_value(
    value_str
)->float: # string value with optional unit suffix (K, M, G)

Convert string values with units (K, M, G) to float in millions.

Uses regex for precise suffix matching to avoid false positives (e.g., ‘GPU’ would incorrectly match ‘G’ with simple in check).