def METHOD_NAME() -> StatResponse:
    """
    If measure performance tfvar/os.env is true, it returns stats, else,
    returns 404. A 404 should be surfaced by clients with instructions on
    how to enable metrics tracking.
    The graph_data always contains the start_time and end_time timestamps
    with 0 values to make graphing easier.
    """
    if not is_publishing_metrics():
        return bottle.abort(404, "This HMA instance is not publishing metrics.")
    if (
        not bottle.request.query.stat_name
        or bottle.request.query.stat_name not in stat_name_to_metric
    ):
        return bottle.abort(
            400,
            f"Must specifiy stat_name in query parameters. Must be one of {stat_name_to_metric.keys()}",
        )
    metric = stat_name_to_metric[bottle.request.query.stat_name]
    time_span_arg = bottle.request.query.time_span
    metric_time_period = {
        "24h": metrics_query.MetricTimePeriod.HOURS_24,
        "1h": metrics_query.MetricTimePeriod.HOURS_1,
        "7d": metrics_query.MetricTimePeriod.DAYS_7,
    }.get(time_span_arg, metrics_query.MetricTimePeriod.HOURS_24)
    count_with_graphs = metrics_query.get_count_with_graph(
        [metric],
        metric_time_period,
    )
    return StatResponse(
        StatsCard(
            count_with_graphs[metric].count,
            metric_time_period,
            count_with_graphs[metric].graph_data,
        )
    )