def _summarize_failover(fs_data):
    """Summarize failover data for a single time record

    Given an fs_data dict, generate a dict of summary statistics. Expects
    fs_data dict of the form generated by parse_lustre_txt.get_failovers::

        {
            "abnormal_ips": {
                "10.100.104.140": [
                    "OST0087",
                    "OST0086",
                    ...
                ],
                "10.100.104.43": [
                    "OST0025",
                    "OST0024",
                    ...
                ]
            },
            "mode": 1
        }

    Args:
        fs_data (dict): a single timestamp and file system record taken from
            the output of `nersc_lfsstate.NerscLfsOstMap.get_failovers`

    Returns:
        dict: summary metrics about the state of failovers on the file system
    """
    num_abnormal_ip = len(fs_data['abnormal_ips'])
    num_abnormal_osts = 0
    if num_abnormal_ip:
        for _, ost_list in fs_data['abnormal_ips'].items():
            num_abnormal_osts += len(ost_list)
        avg_overload = float(num_abnormal_osts) / float(num_abnormal_ip)
        avg_overload_factor = avg_overload / float(fs_data['mode'])
    else:
        avg_overload = 0.0
        avg_overload_factor = 1.0

    return {
        'ost_overloaded_oss_count': num_abnormal_ip,
        'ost_overloaded_ost_count': num_abnormal_osts,
        'ost_avg_overloaded_ost_per_oss': avg_overload,
        'ost_avg_overloaded_overload_factor': avg_overload_factor,
    }