import json


def parse_puppeteer_stats(fp):
    """
    Parse Puppeteer statistics as captured by Puppeteer.
    :param fp: the file path that stores the Puppeteer statistics
    :returns a dictionary containing results
    """
    d = {}
    with open(fp) as f:
        client_data = json.load(f)
        start = client_data["navigationStart"]
        end = client_data['loadEventEnd']
        d['latency'] = float(end - start)
    return d