代码拉取完成,页面将自动刷新
#!usr/bin/python
# -*- coding: utf-8 -*-
#job类
class Job(object):
def __init__(self, jobid, parent):
self.id = jobid
self.attempts = {}
self.seqs = {}
self.time = 0
self.start_time = 0
self.parent = parent
def set_start_time(self,t):
self.start_time = t
def set_time(self, t):
self.time = t
def get(self,id,host=None):
ret = self.attempts.get(id)
if ret == None:
ret = Attempt(id, host, self)
self.attempts[id] = ret
return ret
def getseq(self,id):
ret = self.seqs.get(id)
if ret == None:
ret = JobSeq(id, self)
self.seqs[id] = ret
return ret
#job单个资源记录(CPU,RSS,VMS)
class JobSeq(object):
def __init__(self, name, parent):
self.id = name
self.vs = []
self.dict = {}
self.parent = parent
#attempt类
class Attempt(object):
def __init__(self, attemptid, host, parent):
self.id = attemptid
self.exes = {}
self.time = 0
self.host = host
self.parent = parent
def set_time(self, t):
self.time = t
self.parent.set_time(t)
def get(self,id, exe=None):
ret = self.exes.get(id)
if ret == None:
ret = Exe(id, exe, self)
self.exes[id] = ret
return ret
#进程类
class Exe(object):
def __init__(self, pid, exe, parent):
self.id = pid
self.exe = exe
self.seqs = {}
self.time = 0
self.parent = parent
def set_time(self, t):
self.time = t
self.parent.set_time(t)
def get(self,id):
ret = self.seqs.get(id)
if ret == None:
ret = Seq(id, self)
self.seqs[id] = ret
return ret
#进程单个资源记录(CPU,RSS,VMS)
class Seq(object):
def __init__(self, name, parent):
self.id = name
self.vs = []
self.dict = {}
self.time = 0
self.parent = parent
def append_time(self, t):
self.time = t
self.parent.set_time(t)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。