def process_single_client()

in tools/analysis/ping-patterns/ping-patterns.py [0:0]


def process_single_client(client_id, client_data, stats):
    """
    Process a single client, performing the analysis and writing out a plot.
    """
    if has_timezone_change(client_data):
        stats["changed_timezones"] += 1
        return {"changed_timezones": True}

    client_stats = find_issues(client_data, stats)

    client_data.sort(key=lambda x: x["start_time_local"])
    metrics_rows = organize_plot(x for x in client_data if x["ping_type"] == "metrics")
    baseline_rows = organize_plot(
        x for x in client_data if x["ping_type"] == "baseline"
    )

    plot_timeline(client_id, client_data, metrics_rows, baseline_rows)

    return client_stats