(conn)
return rows
Return metrics about jobs running in the cluster.
Return metrics about jobs running in the cluster.
Return metrics about jobs running in the cluster .
def get_job_metrics(conn):
    # type: (rethinkdb.net.Connection) -> List[tuple]
    """
    Return metrics about jobs running in the cluster.
    """
    jobs_per_type = JOBS.group('type').count().run(conn)  # type: Dict[str, int]

    rows = []  # type: List[tuple]
    for job_type, num_jobs in jobs_per_type.items():
        row = (
            job_type,
            num_jobs,
        )
        rows.append(row)

    return rows
def get_job_metrics ( conn ) : # type: (rethinkdb.net.Connection) -> List[tuple] jobs_per_type = JOBS . group ( 'type' ) . count ( ) . run ( conn ) # type: Dict[str, int] rows = [ ] # type: List[tuple] for job_type , num_jobs in jobs_per_type . items ( ) : row = ( job_type , num_jobs , ) rows . append ( row ) return rows