(conn)
return [row]
Return cluster-wide metrics.
Return cluster-wide metrics.
Return cluster - wide metrics .
def get_cluster_metrics(conn):
    # type: (rethinkdb.net.Connection) -> List[tuple]
    """
    Return cluster-wide metrics.
    """
    cluster_counts = r.expr(
        {
            'servers': SERVER_CONFIG.count(),
            'databases': DB_CONFIG.count(),
        }
    ).run(conn)

    cluster_stats = STATS.get(['cluster']).run(conn)

    row = (
        cluster_counts['servers'],
        cluster_counts['databases'],
        cluster_stats['query_engine']['queries_per_sec'],
        cluster_stats['query_engine']['read_docs_per_sec'],
        cluster_stats['query_engine']['written_docs_per_sec'],
    )

    return [row]
def get_cluster_metrics ( conn ) : # type: (rethinkdb.net.Connection) -> List[tuple] cluster_counts = r . expr ( { 'servers' : SERVER_CONFIG . count ( ) , 'databases' : DB_CONFIG . count ( ) , } ) . run ( conn ) cluster_stats = STATS . get ( [ 'cluster' ] ) . run ( conn ) row = ( cluster_counts [ 'servers' ] , cluster_counts [ 'databases' ] , cluster_stats [ 'query_engine' ] [ 'queries_per_sec' ] , cluster_stats [ 'query_engine' ] [ 'read_docs_per_sec' ] , cluster_stats [ 'query_engine' ] [ 'written_docs_per_sec' ] , ) return [ row ]