'Returns the client stats.'

def Run(self, arg):

    if (arg is None):
        arg = rdf_client.GetClientStatsRequest()
    proc = psutil.Process(os.getpid())
    meminfo = proc.memory_info()
    response = rdf_client.ClientStats(RSS_size=meminfo.rss, VMS_size=meminfo.vms, memory_percent=proc.memory_percent(), bytes_received=stats.STATS.GetMetricValue('grr_client_received_bytes'), bytes_sent=stats.STATS.GetMetricValue('grr_client_sent_bytes'), create_time=long((proc.create_time() * 1000000.0)), boot_time=long((psutil.boot_time() * 1000000.0)))
    samples = self.grr_worker.stats_collector.cpu_samples
    for (timestamp, user, system, percent) in samples:
        if (arg.start_time < timestamp < arg.end_time):
            sample = rdf_client.CpuSample(timestamp=timestamp, user_cpu_time=user, system_cpu_time=system, cpu_percent=percent)
            response.cpu_samples.Append(sample)
    samples = self.grr_worker.stats_collector.io_samples
    for (timestamp, read_bytes, write_bytes) in samples:
        if (arg.start_time < timestamp < arg.end_time):
            sample = rdf_client.IOSample(timestamp=timestamp, read_bytes=read_bytes, write_bytes=write_bytes)
            response.io_samples.Append(sample)
    self.Send(response)
