''' def pullAndStoreGetCmdPerfCpuclock(lepdClient, influxDbClient): res = lepdClient.sendRequest('GetCmdPerfCpuclock') print(res) # json_body = [ # { # "measurement": "GetProcSwaps", # "tags": { # # the address of lepd # "server": lepdClient.server # }, # # "time": "2017-03-12T22:00:00Z", # "fields": { # "LinuxVersion": mystr, # "compact_stall": int(data['compact_stall']), # "balloon_migrate": int(data['balloon_migrate']), # } # } # ] # # influxDbClient.write_points(json_body) if (__name__ == '__main__'): lepdClient = LepdClient('localhost') influxDbClient = MyInfluxDbClient('localhost') for i in range(1): pullAndStoreGetCmdPerfCpuclock(lepdClient, influxDbClient) time.sleep(1)
__author__ = "李旭升 <*****@*****.**>" __copyright__ = "Licensed under GPLv2 or later." from dataStore.influxDbUtil.dbUtil import MyInfluxDbClient import time ''' 从InfluxDB中查询memory信息 拼接字段还未完成 ''' def queryGetProcMeminfo(influxDbClient): res = influxDbClient.query('select * from GetProcMeminfo limit 1') print(res) # help(res) return None if(__name__=='__main__'): influxDbClient = MyInfluxDbClient('127.0.0.1') queryGetProcMeminfo(influxDbClient)