import time


def compute_url(server, port, label):
    """Compute the api url to request data from, specific to a label.

    Args:
        server (str): Prometheus server
        port (int): Prometheus server port
        label (str): object_type/label data

    Returns:
        The api url to fetch the label's data

    """
    now = int(time.time())
    url = 'http://%s:%s/api/v1/query_range?query=sum(sql_swh_archive_object_count{object_type="%s"})&start=1544543227&end=%s&step=12h' % (server, port, label, now)  # noqa
    return url