def reset(self): self.__data = {} now = datetime.datetime.now() self.__data['seq'] = int(round(time.time() * 1000)) self.__data['timestamp-client'] = now.isoformat() cinfo = cpuinfo.get_cpu_info() self.__data['cpu'] = format(cinfo['brand']) osinfo = OsInfo() oinfo = osinfo.getOsInfo(cinfo) self.__data['os'] = oinfo['os'] self.__data['os-dist'] = oinfo['dist'] self.__data['os-version'] = oinfo['version'] self.__data['os-arch'] = oinfo['arch'] self.__data['os-kernel'] = oinfo['kernel'] self.__data['cpu-temp'] = cputemp.get_cpu_temp() l = Load() self.__data['cpu-load'] = l.getCpuLoad() self.__data['storage'] = l.getStorageStatus() self.__data['network'] = netinfo.get_network_interfaces()
def reset(self): a = 1 self.__data = {} from os.path import expanduser idFileName = expanduser("~") + '/.hidevid' fileExists = os.path.exists(idFileName) if ( fileExists ): idFileHandle = open(idFileName,'r') deviceId = idFileHandle.readline() deviceId = deviceId.strip() self.__data['id'] = deviceId idFileHandle.close now = datetime.datetime.now() self.__data['seq'] = int(round(time.time() * 1000)) self.__data['tsClient'] = now.isoformat() cinfo = cpuinfo.get_cpu_info() self.__data['cpu'] = format(cinfo['brand']) self.__data['cpuCount'] = cinfo['count'] osinfo = OsInfo() oinfo = osinfo.getOsInfo(cinfo) self.__data['os'] = oinfo['os'] self.__data['osDist'] = oinfo['dist'] self.__data['osVersion'] = oinfo['version'] self.__data['osArch'] = oinfo['arch'] self.__data['osKernel'] = oinfo['kernel'] self.__data['cpuTemp'] = cputemp.get_cpu_temp() l = Load() self.__data['cpuLoad'] = l.getCpuLoad() MemInfo = meminfo.getMemoryStatus() self.__data['memAvail'] = MemInfo['memAvail'] / 1024 self.__data['memUsed'] = MemInfo['memUsed'] / 1024 self.__data['swapAvail'] = MemInfo['swpAvail'] / 1024 self.__data['swapUsed'] = MemInfo['swpUsed'] / 1024 self.__data['storage'] = l.getStorageStatus() self.__data['network'] = netinfo.get_network_interfaces() CpuTimes = cputimes.get_cpu_times() self.__data['cpuUser'] = CpuTimes['user'] self.__data['cpuSystem'] = CpuTimes['system'] self.__data['cpuIdle'] = CpuTimes['idle'] self.__data['ioWait'] = CpuTimes['iowt'] self.__data['UpTime'] = CpuTimes['uptime']
def reset(self): self.__data = {} from os.path import expanduser idFileName = expanduser("~") + '/.hidevid' fileExists = os.path.exists(idFileName) if (fileExists): idFileHandle = open(idFileName, 'r') deviceId = idFileHandle.readline() deviceId = deviceId.strip() self.__data['id'] = deviceId idFileHandle.close now = datetime.datetime.now() self.__data['seq'] = int(round(time.time() * 1000)) self.__data['tsClient'] = now.isoformat() cinfo = cpuinfo.get_cpu_info() self.__data['cpu'] = format(cinfo['brand']) self.__data['cpuCount'] = cinfo['count'] osinfo = OsInfo() oinfo = osinfo.getOsInfo(cinfo) self.__data['os'] = oinfo['os'] self.__data['osDist'] = oinfo['dist'] self.__data['osVersion'] = oinfo['version'] self.__data['osArch'] = oinfo['arch'] self.__data['osKernel'] = oinfo['kernel'] self.__data['cpuTemp'] = cputemp.get_cpu_temp() l = Load() self.__data['cpuLoad'] = l.getCpuLoad() MemInfo = meminfo.getMemoryStatus() self.__data['memAvail'] = MemInfo['memAvail'] / 1024 self.__data['memUsed'] = MemInfo['memUsed'] / 1024 self.__data['swapAvail'] = MemInfo['swpAvail'] / 1024 self.__data['swapUsed'] = MemInfo['swpUsed'] / 1024 self.__data['storage'] = l.getStorageStatus() self.__data['network'] = netinfo.get_network_interfaces() CpuTimes = cputimes.get_cpu_times() self.__data['cpuUser'] = CpuTimes['user'] self.__data['cpuSystem'] = CpuTimes['system'] self.__data['cpuIdle'] = CpuTimes['idle'] self.__data['ioWait'] = CpuTimes['iowt'] self.__data['UpTime'] = CpuTimes['uptime']