from typing import Dict


def _average_latency(row: Dict):
    """
    Calculate average latency for Performance Analyzer single test
    """
    avg_sum_fields = [
        "Client Send",
        "Network+Server Send/Recv",
        "Server Queue",
        "Server Compute",
        "Server Compute Input",
        "Server Compute Infer",
        "Server Compute Output",
        "Client Recv",
    ]
    avg_latency = sum(int(row.get(f, 0)) for f in avg_sum_fields)

    return avg_latency