def METHOD_NAME(states):
    results = {"runtime": 0.00, "num_failed_states": 0, "num_passed_states": 0}
    for state, resultset in states.items():
        if isinstance(resultset, dict) and "duration" in resultset:
            # Count the pass vs failures
            if resultset["result"]:
                results["num_passed_states"] += 1
            else:
                results["num_failed_states"] += 1
            # Count durations
            results["runtime"] += resultset["duration"]
    log.debug("Parsed state metrics: %s", results)
    return results