本文整理汇总了Python中WMCore.Services.WMStats.WMStatsReader.WMStatsReader.getTaskJobSummaryByRequest方法的典型用法代码示例。如果您正苦于以下问题:Python WMStatsReader.getTaskJobSummaryByRequest方法的具体用法?Python WMStatsReader.getTaskJobSummaryByRequest怎么用?Python WMStatsReader.getTaskJobSummaryByRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WMCore.Services.WMStats.WMStatsReader.WMStatsReader
的用法示例。
在下文中一共展示了WMStatsReader.getTaskJobSummaryByRequest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: JobDetailInfo
# 需要导入模块: from WMCore.Services.WMStats.WMStatsReader import WMStatsReader [as 别名]
# 或者: from WMCore.Services.WMStats.WMStatsReader.WMStatsReader import getTaskJobSummaryByRequest [as 别名]
class JobDetailInfo(RESTEntity):
"""
This class need to move under WMStats server when wmstats server created
"""
def __init__(self, app, api, config, mount, t0flag=False):
# main CouchDB database where requests/workloads are stored
RESTEntity.__init__(self, app, api, config, mount)
wmstats_url = "%s/%s" % (self.config.couch_host, self.config.couch_wmstats_db)
reqdb_url = "%s/%s" % (self.config.couch_host, self.config.couch_reqmgr_db)
if t0flag:
couchAppName = "T0Request"
else:
couchAppName = "ReqMgr"
self.wmstats = WMStatsReader(wmstats_url, reqdbURL=reqdb_url, reqdbCouchApp=couchAppName)
def validate(self, apiobj, method, api, param, safe):
args_length = len(param.args)
if args_length == 1:
safe.args.append(param.args[0])
param.args.pop()
prop = 'sample_size'
safe.kwargs[prop] = int(param.kwargs.get(prop, 1))
if prop in param.kwargs:
del param.kwargs[prop]
return
@restcall(formats=[('text/plain', PrettyJSONFormat()), ('text/html', PrettyJSONHTMLFormat()), ('application/json', JSONFormat())])
@tools.expires(secs=-1)
def get(self, request_name, sample_size):
result = self.wmstats.getTaskJobSummaryByRequest(request_name, sample_size)
return rows([result])