grr/server/grr_response_server/databases/mysql_clients.py
def ReadClientStats(self,
                      client_id,
                      min_timestamp,
                      max_timestamp,
                      cursor = None
                     ):
    """Reads ClientStats for a given client and time range."""

    cursor.execute(
        """
        SELECT payload FROM client_stats
        WHERE client_id = %s AND timestamp BETWEEN %s AND %s
        ORDER BY timestamp ASC
        """, [
            mysql_utils.ClientIDToInt(client_id),
            mysql_utils.RDFDatetimeToMysqlString(min_timestamp),
            mysql_utils.RDFDatetimeToMysqlString(max_timestamp)
        ])
    return [
        rdf_client_stats.ClientStats.FromSerializedString(stats_bytes)
        for stats_bytes, in cursor.fetchall()
    ]
Reads ClientStats for a given client and time range.
Reads ClientStats for a given client and time range.
Reads ClientStats for a given client and time range .
def ReadClientStats(self,
                      client_id,
                      min_timestamp,
                      max_timestamp,
                      cursor = None
                     ):
    cursor.execute(
        """
        SELECT payload FROM client_stats
        WHERE client_id = %s AND timestamp BETWEEN %s AND %s
        ORDER BY timestamp ASC
        """, [
            mysql_utils.ClientIDToInt(client_id),
            mysql_utils.RDFDatetimeToMysqlString(min_timestamp),
            mysql_utils.RDFDatetimeToMysqlString(max_timestamp)
        ])
    return [
        rdf_client_stats.ClientStats.FromSerializedString(stats_bytes)
        for stats_bytes, in cursor.fetchall()
    ]
def ReadClientStats ( self , client_id , min_timestamp , max_timestamp , cursor = None ) : cursor . execute ( """
        SELECT payload FROM client_stats
        WHERE client_id = %s AND timestamp BETWEEN %s AND %s
        ORDER BY timestamp ASC
        """ , [ mysql_utils . ClientIDToInt ( client_id ) , mysql_utils . RDFDatetimeToMysqlString ( min_timestamp ) , mysql_utils . RDFDatetimeToMysqlString ( max_timestamp ) ] ) return [ rdf_client_stats . ClientStats . FromSerializedString ( stats_bytes ) for stats_bytes , in cursor . fetchall ( ) ]
Reads ClientStats for a given client and time range.
Reads ClientStats for a given client and time range .
"""Reads ClientStats for a given client and time range."""
self
client_id
min_timestamp
max_timestamp
cursor