本文整理汇总了Python中API.countUsers方法的典型用法代码示例。如果您正苦于以下问题:Python API.countUsers方法的具体用法?Python API.countUsers怎么用?Python API.countUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类API
的用法示例。
在下文中一共展示了API.countUsers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DatasetList
# 需要导入模块: import API [as 别名]
# 或者: from API import countUsers [as 别名]
def DatasetList(self, data,query_time):
# <td align="left"><a href=\"%s?dataset+%s\">%s</a></td>\
# self.baseDDUrl,'job::%s'%dataset,jobs,\
html = "<html><body><h2>List of Dataset</h2>\n "
html += '<table cellspacing="10" cellpadding=5>\n'
st = ['Dataset name','Numeber of users','Number of tasks','Total Number of jobs','Efficiency']
html += '<tr>'
for s in st:
html += '<th align="left"> %s</th>\n'%s
html += '</tr>'
for dataset in data.keys():
if dataset:
html += '<tr>'
users = API.countUsers(dataset,query_time)
tasks = API.countTasks(dataset,query_time)
jobs = API.countJobs(dataset,query_time)
exitcodes=API.getJobExit(dataset,query_time)
if not len(exitcodes):
TotEff = 'Not yet available'
eff = 'eff::%s::%s'%('None',dataset)
else:
tot = len(exitcodes)
countSucc = 0
for appl, wrapp in exitcodes:
if wrapp == 0: countSucc += 1
TotEff = countSucc*1./tot
eff = 'eff::%s::%s'%(query_time,dataset)
user = 'user::%s::%s'%(query_time,dataset)
task = 'task::%s::%s'%(query_time,dataset)
if dataset == 'None': dataset='User Private MC Production'
html += '<td align="left">%s</td><td align="left"><a href=\"%s?user=%s\">%s</a></td>\
<td align="left"><a href=\"%s?task=%s\">%s</a></td>\
<td align="left">%s</td>\
<td align="left"><a href=\"%s?eff=%s\">%s</a></td>\n'\
%(str(dataset),self.baseDDUrl,user,users,\
self.baseDDUrl,task,tasks,\
jobs,\
self.baseDDUrl,eff,TotEff)
html += '</tr>'
html += "</table>\n"
html += """</body></html>"""
return html