def parse_q_stats(line):
    """
    Parses a "stats" line of a BESS queue log. Line should be of the form:
        ( "stats", src port, enqueued, dequeued, dropped )
    """
    return (
        ("stats",) +
        tuple(
            int(tok, 16) if tok.startswith("0x") else int(tok)
            for tok in line.split(":")[1].split(",")))