def _summarize_fullness(fs_data):
    """Summarize fullness data for a single time record

    Given an fs_data dict, generate a dict of summary statistics.  Expects
    fs_data dict of form generated by `nersc_lfsstate.NerscLfsOstFullness`::

        {
             "MDT0000": {
                 "mount_pt": "/scratch1",
                 "remaining_kib": 2147035984,
                 "target_index": 0,
                 "total_kib": 2255453580,
                 "used_kib": 74137712
             },
             "OST0000": {
                 "mount_pt": "/scratch1",
                 "remaining_kib": 28898576320,
                 "target_index": 0,
                 "total_kib": 90767651352,
                 "used_kib": 60894630700
             },
             ...
        }

    Args:
        fs_data (dict): a single timestamp and file system record taken from
            a nersc_lfsstate.NerscLfsOstFullness object

    Returns:
        dict: summary metrics about the state of the file system fullness
    """
    results = {
        'ost_least_full_kib': None,
        'ost_most_full_kib': 0,
        'ost_avg_full_kib': 0,
        'ost_avg_full_pct': 0,
        'ost_count': 0,
    }

    for ost_name, ost_data in fs_data.items():
        # Only care about OSTs, not MDTs or MGTs
        if not ost_name.lower().startswith('ost'):
            continue
        results['ost_count'] += 1
        results['ost_avg_full_kib'] += ost_data['used_kib']
        results['ost_avg_full_pct'] += ost_data['total_kib']
        if results['ost_least_full_kib'] is None \
        or results['ost_least_full_kib'] > ost_data['used_kib']:
            results['ost_least_full_kib'] = ost_data['used_kib']
            results['ost_least_full_name'] = ost_name
            results['ost_least_full_pct'] = 100.0 * ost_data['used_kib'] / ost_data['total_kib']

        if results['ost_most_full_kib'] < ost_data['used_kib']:
            results['ost_most_full_kib'] = ost_data['used_kib']
            results['ost_most_full_name'] = ost_name
            results['ost_most_full_pct'] = 100.0 * ost_data['used_kib'] / ost_data['total_kib']


    # If there are no osts, this will break
    try:
        results['ost_avg_full_kib'] = int(float(results['ost_avg_full_kib']) \
                                          / float(results['ost_count']))
        results['ost_avg_full_pct'] = 100.0 * float(results['ost_avg_full_kib']) \
                                      / float(results['ost_avg_full_pct']) \
                                      * float(results['ost_count'])
    except ZeroDivisionError:
        pass

    results['ost_least_full_id'] = fs_data[results['ost_least_full_name']]['target_index']
    results['ost_most_full_id'] = fs_data[results['ost_most_full_name']]['target_index']
    return results